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 Details

  • Constructor Details

    • AbstractExporter

      public AbstractExporter()
  • Method Details

    • isVerbose

      public boolean isVerbose()
    • setVerbose

      public void setVerbose(ProgressTrackerListener out)
    • isRelativePaths

      public boolean isRelativePaths()
    • setProperty

      public void setProperty(String name, String value)
    • setProperty

      public void setProperty(String name, Calendar value)
    • setProperties

      public void setProperties(Properties properties)
    • 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 javax.jcr.RepositoryException, IOException
      Exports the given vault file and writes the META-INF data.
      Parameters:
      parent - the vault file
      Throws:
      javax.jcr.RepositoryException - if an error occurs
      IOException - if an I/O error occurs
    • export

      public void export(VaultFile parent, boolean noClose) throws javax.jcr.RepositoryException, IOException
      Exports the given vault file and writes the META-INF data.
      Parameters:
      parent - the vault file
      noClose - if true exporter will not be closed after export
      Throws:
      javax.jcr.RepositoryException - if an error occurs
      IOException - if an I/O error occurs
    • export

      public void export(VaultFile parent, String relPath) throws javax.jcr.RepositoryException, IOException
      Exports the vault file to the relative path.
      Parameters:
      parent - the file
      relPath - the path
      Throws:
      javax.jcr.RepositoryException - if an error occurs
      IOException - if an I/O error occurs
    • track

      protected void track(String action, String path)
    • track

      protected void track(Exception e, String path)
    • getPlatformFilePath

      protected String getPlatformFilePath(VaultFile file, String relPath)
    • open

      public abstract void open() throws IOException, javax.jcr.RepositoryException
      Opens the exporter and initializes the undelying structures.
      Throws:
      IOException - if an I/O error occurs
      javax.jcr.RepositoryException - if a repository error occurs
    • close

      public abstract void close() throws IOException, javax.jcr.RepositoryException
      Closes the exporter and releases the undelying structures.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if an I/O error occurs
      javax.jcr.RepositoryException - 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 javax.jcr.RepositoryException, IOException
      Throws:
      javax.jcr.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 javax.jcr.RepositoryException, IOException
      Throws:
      javax.jcr.RepositoryException
      IOException