Class JarExporter

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class JarExporter
    extends AbstractExporter
    Implements a Vault filesystem exporter that exports Vault files to a jar file. The entries are stored compressed in the jar (as ZipEntry zip entries.

    The exporter can optimize the export throughput for binaries, by avoiding to compress incompressible binaries. The optimization is enabled for all Deflater compression levels but Deflater.DEFAULT_COMPRESSION, Deflater.NO_COMPRESSION and Deflater.BEST_COMPRESSION.

    The exporter uses the PlatformNameFormat for formatting the jcr file names to local ones.

    • Constructor Detail

      • JarExporter

        public JarExporter​(java.io.File jarFile)
        Constructs a new jar exporter that writes to the given file.
        Parameters:
        jarFile - the jar file
      • JarExporter

        public JarExporter​(java.io.File jarFile,
                           int level)
        Constructs a new jar exporter that writes to the given file.
        Parameters:
        jarFile - the jar file
        level - level the compression level
      • JarExporter

        public JarExporter​(java.io.OutputStream out)
        Constructs a new jar exporter that writes to the output stream.
        Parameters:
        out - the output stream
      • JarExporter

        public JarExporter​(java.io.OutputStream out,
                           int level)
        Constructs a new jar exporter that writes to the output stream.
        Parameters:
        out - the output stream
        level - level the compression level
    • Method Detail

      • open

        public void open()
                  throws java.io.IOException
        Opens the exporter and initializes the undelying structures.
        Specified by:
        open in class AbstractExporter
        Throws:
        java.io.IOException - if an I/O error occurs
      • close

        public void close()
                   throws java.io.IOException
        Description copied from class: AbstractExporter
        Closes the exporter and releases the undelying structures.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in class AbstractExporter
        Throws:
        java.io.IOException - if an I/O error occurs
      • createDirectory

        public void createDirectory​(java.lang.String relPath)
                             throws java.io.IOException
        Specified by:
        createDirectory in class AbstractExporter
        Throws:
        java.io.IOException
      • writeFile

        public void writeFile​(java.io.InputStream in,
                              java.lang.String relPath)
                       throws java.io.IOException
        Description copied from class: AbstractExporter

        The specified stream remains open after this method returns.

        Specified by:
        writeFile in class AbstractExporter
        Throws:
        java.io.IOException
      • write

        public void write​(java.util.zip.ZipFile zip,
                          java.util.zip.ZipEntry entry)
                   throws java.io.IOException
        Throws:
        java.io.IOException