Class JarExporter
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.io.AbstractExporter
-
- org.apache.jackrabbit.vault.fs.io.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 (asZipEntryzip entries.The exporter can optimize the export throughput for binaries, by avoiding to compress incompressible binaries. The optimization is enabled for all
Deflatercompression levels butDeflater.DEFAULT_COMPRESSION,Deflater.NO_COMPRESSIONandDeflater.BEST_COMPRESSION.The exporter uses the
PlatformNameFormatfor formatting the jcr file names to local ones.
-
-
Constructor Summary
Constructors Constructor Description JarExporter(java.io.File jarFile)Constructs a new jar exporter that writes to the given file.JarExporter(java.io.File jarFile, int level)Constructs a new jar exporter that writes to the given file.JarExporter(java.io.OutputStream out)Constructs a new jar exporter that writes to the output stream.JarExporter(java.io.OutputStream out, int level)Constructs a new jar exporter that writes to the output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the exporter and releases the undelying structures.voidcreateDirectory(java.lang.String relPath)voidcreateDirectory(VaultFile file, java.lang.String relPath)voidopen()Opens the exporter and initializes the undelying structures.voidwrite(java.util.zip.ZipFile zip, java.util.zip.ZipEntry entry)voidwriteFile(java.io.InputStream in, java.lang.String relPath)The specified stream remains open after this method returns.voidwriteFile(VaultFile file, java.lang.String relPath)-
Methods inherited from class org.apache.jackrabbit.vault.fs.io.AbstractExporter
export, export, export, getExportInfo, getRootPath, isNoMetaInf, isRelativePaths, isVerbose, setNoMetaInf, setProperties, setProperty, setProperty, setRelativePaths, setRootPath, setVerbose
-
-
-
-
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 filelevel- 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 streamlevel- level the compression level
-
-
Method Detail
-
open
public void open() throws java.io.IOExceptionOpens the exporter and initializes the undelying structures.- Specified by:
openin classAbstractExporter- Throws:
java.io.IOException- if an I/O error occurs
-
close
public void close() throws java.io.IOExceptionDescription copied from class:AbstractExporterCloses the exporter and releases the undelying structures.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein classAbstractExporter- Throws:
java.io.IOException- if an I/O error occurs
-
createDirectory
public void createDirectory(VaultFile file, java.lang.String relPath) throws RepositoryException, java.io.IOException
- Specified by:
createDirectoryin classAbstractExporter- Throws:
RepositoryExceptionjava.io.IOException
-
createDirectory
public void createDirectory(java.lang.String relPath) throws java.io.IOException- Specified by:
createDirectoryin classAbstractExporter- Throws:
java.io.IOException
-
writeFile
public void writeFile(VaultFile file, java.lang.String relPath) throws RepositoryException, java.io.IOException
- Specified by:
writeFilein classAbstractExporter- Throws:
RepositoryExceptionjava.io.IOException
-
writeFile
public void writeFile(java.io.InputStream in, java.lang.String relPath) throws java.io.IOExceptionDescription copied from class:AbstractExporterThe specified stream remains open after this method returns.
- Specified by:
writeFilein classAbstractExporter- 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
-
-