Class JarExporter
java.lang.Object
org.apache.jackrabbit.vault.fs.io.AbstractExporter
org.apache.jackrabbit.vault.fs.io.JarExporter
- All Implemented Interfaces:
AutoCloseable
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.
-
Field Summary
Fields inherited from class org.apache.jackrabbit.vault.fs.io.AbstractExporter
exportInfo -
Constructor Summary
ConstructorsConstructorDescriptionJarExporter(File jarFile) Constructs a new jar exporter that writes to the given file.JarExporter(File jarFile, int level) Constructs a new jar exporter that writes to the given file.JarExporter(OutputStream out) Constructs a new jar exporter that writes to the output stream.JarExporter(OutputStream out, int level) Constructs a new jar exporter that writes to the output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the exporter and releases the undelying structures.voidcreateDirectory(String relPath) voidcreateDirectory(VaultFile file, String relPath) voidopen()Opens the exporter and initializes the undelying structures.voidvoidwriteFile(InputStream in, String relPath) The specified stream is automatically closed after this method returns or throws an exception.voidMethods inherited from class org.apache.jackrabbit.vault.fs.io.AbstractExporter
export, export, export, getExportInfo, getGenerator, getPlatformFilePath, getRootPath, isNoMetaInf, isRelativePaths, isVerbose, setGenerator, setNoMetaInf, setProperties, setProperty, setProperty, setRelativePaths, setRootPath, setVerbose, track, track
-
Constructor Details
-
JarExporter
Constructs a new jar exporter that writes to the given file.- Parameters:
jarFile- the jar file
-
JarExporter
Constructs a new jar exporter that writes to the given file.- Parameters:
jarFile- the jar filelevel- level the compression level
-
JarExporter
Constructs a new jar exporter that writes to the output stream. The given output stream is closed when callingclose().- Parameters:
out- the output stream
-
JarExporter
Constructs a new jar exporter that writes to the output stream. The given output stream is closed when callingclose().- Parameters:
out- the output streamlevel- level the compression level
-
-
Method Details
-
open
Opens the exporter and initializes the undelying structures.- Specified by:
openin classAbstractExporter- Throws:
IOException- if an I/O error occurs
-
close
Description copied from class:AbstractExporterCloses the exporter and releases the undelying structures.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classAbstractExporter- Throws:
IOException- if an I/O error occurs
-
createDirectory
- Specified by:
createDirectoryin classAbstractExporter- Throws:
RepositoryExceptionIOException
-
createDirectory
- Specified by:
createDirectoryin classAbstractExporter- Throws:
IOException
-
writeFile
- Specified by:
writeFilein classAbstractExporter- Throws:
RepositoryExceptionIOException
-
writeFile
Description copied from class:AbstractExporterThe specified stream is automatically closed after this method returns or throws an exception.
- Specified by:
writeFilein classAbstractExporter- Throws:
IOException
-
write
- Throws:
IOException
-