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 ExportInfo
exportInfo
-
Constructor Summary
Constructors Constructor Description AbstractExporter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close()
Closes the exporter and releases the undelying structures.abstract void
createDirectory(String relPath)
abstract void
createDirectory(VaultFile file, String relPath)
void
export(VaultFile parent)
Exports the given vault file and writes the META-INF data.void
export(VaultFile parent, boolean noClose)
Exports the given vault file and writes the META-INF data.void
export(VaultFile parent, String relPath)
Exports the vault file to the relative path.ExportInfo
getExportInfo()
String
getGenerator()
protected String
getPlatformFilePath(VaultFile file, String relPath)
String
getRootPath()
boolean
isNoMetaInf()
boolean
isRelativePaths()
boolean
isVerbose()
abstract void
open()
Opens the exporter and initializes the undelying structures.void
setGenerator(String generator)
void
setNoMetaInf(boolean noMetaInf)
void
setProperties(Properties properties)
void
setProperty(String name, String value)
void
setProperty(String name, Calendar value)
void
setRelativePaths(boolean relativePaths)
Defines if the exported files should include their entire path or just be relative to the export root.void
setRootPath(String rootPath)
void
setVerbose(ProgressTrackerListener out)
protected void
track(Exception e, String path)
protected void
track(String action, String path)
abstract void
writeFile(InputStream in, String relPath)
The specified stream is automatically closed after this method returns or throws an exception.abstract void
writeFile(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).
null
when 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).null
when 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
- iftrue
exporter 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, RepositoryException
Opens 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, RepositoryException
Closes the exporter and releases the undelying structures.- Specified by:
close
in 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:
RepositoryException
IOException
-
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:
RepositoryException
IOException
-
-