Class AbstractExporter
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.io.AbstractExporter
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
JarExporter,JcrExporter,PlatformExporter
public abstract class AbstractExporter extends Object implements AutoCloseable
Generic context for exporters
-
-
Field Summary
Fields Modifier and Type Field Description protected ExportInfoexportInfo
-
Constructor Summary
Constructors Constructor Description AbstractExporter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidclose()Closes the exporter and releases the undelying structures.abstract voidcreateDirectory(String relPath)abstract voidcreateDirectory(VaultFile file, String relPath)voidexport(VaultFile parent)Exports the given vault file and writes the META-INF data.voidexport(VaultFile parent, boolean noClose)Exports the given vault file and writes the META-INF data.voidexport(VaultFile parent, String relPath)Exports the vault file to the relative path.ExportInfogetExportInfo()StringgetGenerator()protected StringgetPlatformFilePath(VaultFile file, String relPath)StringgetRootPath()booleanisNoMetaInf()booleanisRelativePaths()booleanisVerbose()abstract 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)voidsetVerbose(ProgressTrackerListener out)protected voidtrack(Exception e, String path)protected voidtrack(String action, String path)abstract voidwriteFile(InputStream in, String relPath)The specified stream is automatically closed after this method returns or throws an exception.abstract voidwriteFile(VaultFile file, String relPath)
-
-
-
Field Detail
-
exportInfo
protected ExportInfo exportInfo
-
-
Method Detail
-
isVerbose
public boolean isVerbose()
-
setVerbose
public void setVerbose(ProgressTrackerListener out)
-
isRelativePaths
public boolean isRelativePaths()
-
setProperties
public void setProperties(Properties properties)
-
getGenerator
public String getGenerator()
- Returns:
- generator information (for diagnostical purposes; usually in
"name:version" format).
nullwhen n/a. Defaults to "org.apache.jackrabbit.vault:version".
-
setGenerator
public void setGenerator(String generator)
- Parameters:
generator- generator information (for diagnostical purposes; usually in "name:version" format).nullwhen n/a.
-
getRootPath
public String getRootPath()
-
setRootPath
public void setRootPath(String rootPath)
-
isNoMetaInf
public boolean isNoMetaInf()
-
setNoMetaInf
public void setNoMetaInf(boolean noMetaInf)
-
getExportInfo
public ExportInfo 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
public void export(VaultFile parent) throws RepositoryException, IOException
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
public void export(VaultFile parent, boolean noClose) throws RepositoryException, IOException
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
public void export(VaultFile parent, String relPath) throws RepositoryException, IOException
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
-
open
public abstract void open() throws IOException, RepositoryExceptionOpens the exporter and initializes the undelying structures.- Throws:
IOException- if an I/O error occursRepositoryException- if a repository error occurs
-
close
public abstract void close() throws IOException, RepositoryExceptionCloses 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
public abstract void createDirectory(String relPath) throws IOException
- Throws:
IOException
-
createDirectory
public abstract void createDirectory(VaultFile file, String relPath) throws RepositoryException, IOException
- Throws:
RepositoryExceptionIOException
-
writeFile
public abstract void writeFile(InputStream in, String relPath) throws IOException
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
-
-