Class AbstractExporter

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    JarExporter, JcrExporter, PlatformExporter

    public abstract class AbstractExporter
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Generic context for exporters
    • 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​(java.lang.String relPath)  
      abstract void createDirectory​(VaultFile file, java.lang.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, java.lang.String relPath)
      Exports the vault file to the relative path.
      ExportInfo getExportInfo()  
      java.lang.String getRootPath()  
      boolean isNoMetaInf()  
      boolean isRelativePaths()  
      boolean isVerbose()  
      abstract void open()
      Opens the exporter and initializes the undelying structures.
      void setNoMetaInf​(boolean noMetaInf)  
      void setProperties​(java.util.Properties properties)  
      void setProperty​(java.lang.String name, java.lang.String value)  
      void setProperty​(java.lang.String name, java.util.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​(java.lang.String rootPath)  
      void setVerbose​(ProgressTrackerListener out)  
      abstract void writeFile​(java.io.InputStream in, java.lang.String relPath)
      The specified stream is automatically closed after this method returns or throws an exception.
      abstract void writeFile​(VaultFile file, java.lang.String relPath)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractExporter

        public AbstractExporter()
    • Method Detail

      • isVerbose

        public boolean isVerbose()
      • isRelativePaths

        public boolean isRelativePaths()
      • setProperty

        public void setProperty​(java.lang.String name,
                                java.lang.String value)
      • setProperty

        public void setProperty​(java.lang.String name,
                                java.util.Calendar value)
      • setProperties

        public void setProperties​(java.util.Properties properties)
      • getRootPath

        public java.lang.String getRootPath()
      • setRootPath

        public void setRootPath​(java.lang.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,
                           java.io.IOException
        Exports the given vault file and writes the META-INF data.
        Parameters:
        parent - the vault file
        Throws:
        RepositoryException - if an error occurs
        java.io.IOException - if an I/O error occurs
      • export

        public void export​(VaultFile parent,
                           boolean noClose)
                    throws RepositoryException,
                           java.io.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:
        RepositoryException - if an error occurs
        java.io.IOException - if an I/O error occurs
      • export

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

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

        public abstract void close()
                            throws java.io.IOException,
                                   RepositoryException
        Closes the exporter and releases the undelying structures.
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException - if an I/O error occurs
        RepositoryException - if a repository error occurs
      • createDirectory

        public abstract void createDirectory​(java.lang.String relPath)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • writeFile

        public abstract void writeFile​(java.io.InputStream in,
                                       java.lang.String relPath)
                                throws java.io.IOException

        The specified stream is automatically closed after this method returns or throws an exception.

        Parameters:
        in -
        relPath -
        Throws:
        java.io.IOException