Class AbstractExporter
java.lang.Object
org.apache.jackrabbit.vault.fs.io.AbstractExporter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
JarExporter,JcrExporter,PlatformExporter
Generic context for exporters
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Closes the exporter and releases the undelying structures.abstract voidcreateDirectory(String relPath) abstract voidcreateDirectory(VaultFile file, String relPath) voidExports the given vault file and writes the META-INF data.voidExports the given vault file and writes the META-INF data.voidExports the vault file to the relative path.protected StringgetPlatformFilePath(VaultFile file, String relPath) booleanbooleanbooleanabstract voidopen()Opens the exporter and initializes the undelying structures.voidsetGenerator(String generator) voidsetNoMetaInf(boolean noMetaInf) voidsetProperties(Properties properties) voidsetProperty(String name, String value) voidsetProperty(String name, Calendar value) voidsetRelativePaths(boolean relativePaths) Defines if the exported files should include their entire path or just be relative to the export root. eg.: exporting /apps/components relative would not include /apps in the path.voidsetRootPath(String rootPath) voidprotected voidprotected voidabstract voidwriteFile(InputStream in, String relPath) The specified stream is automatically closed after this method returns or throws an exception.abstract void
-
Field Details
-
exportInfo
-
-
Constructor Details
-
AbstractExporter
public AbstractExporter()
-
-
Method Details
-
isVerbose
public boolean isVerbose() -
setVerbose
-
isRelativePaths
public boolean isRelativePaths() -
setProperty
-
setProperty
-
setProperties
-
getGenerator
- Returns:
- generator information (for diagnostical purposes; usually in
"name:version" format).
nullwhen n/a. Defaults to "org.apache.jackrabbit.vault:version".
-
setGenerator
- Parameters:
generator- generator information (for diagnostical purposes; usually in "name:version" format).nullwhen n/a.
-
getRootPath
-
setRootPath
-
isNoMetaInf
public boolean isNoMetaInf() -
setNoMetaInf
public void setNoMetaInf(boolean noMetaInf) -
getExportInfo
-
setRelativePaths
public void setRelativePaths(boolean relativePaths) Defines if the exported files should include their entire path or just be relative to the export root. eg.: exporting /apps/components relative would not include /apps in the path.- Parameters:
relativePaths- relative flag
-
export
Exports the given vault file and writes the META-INF data.- Parameters:
parent- the vault file- Throws:
RepositoryException- if an error occursIOException- if an I/O error occurs
-
export
Exports the given vault file and writes the META-INF data.- Parameters:
parent- the vault filenoClose- iftrueexporter will not be closed after export- Throws:
RepositoryException- if an error occursIOException- if an I/O error occurs
-
export
Exports the vault file to the relative path.- Parameters:
parent- the filerelPath- the path- Throws:
RepositoryException- if an error occursIOException- if an I/O error occurs
-
track
-
track
-
getPlatformFilePath
-
open
Opens the exporter and initializes the undelying structures.- Throws:
IOException- if an I/O error occursRepositoryException- if a repository error occurs
-
close
Closes the exporter and releases the undelying structures.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if an I/O error occursRepositoryException- if a repository error occurs
-
createDirectory
- Throws:
IOException
-
createDirectory
public abstract void createDirectory(VaultFile file, String relPath) throws RepositoryException, IOException - Throws:
RepositoryExceptionIOException
-
writeFile
The specified stream is automatically closed after this method returns or throws an exception.
- Parameters:
in-relPath-- Throws:
IOException
-
writeFile
public abstract void writeFile(VaultFile file, String relPath) throws RepositoryException, IOException - Throws:
RepositoryExceptionIOException
-