Class PackageManagerImpl

    • Constructor Detail

      • PackageManagerImpl

        public PackageManagerImpl()
    • Method Detail

      • open

        @NotNull
        public @NotNull VaultPackage open​(@NotNull
                                          @NotNull Archive archive)
                                   throws IOException
        Opens the given archive and creates a package
        Specified by:
        open in interface PackageManager
        Parameters:
        archive - the archive
        Returns:
        the package
        Throws:
        IOException - if an error occurs
      • open

        @NotNull
        public @NotNull VaultPackage open​(@NotNull
                                          @NotNull Archive archive,
                                          boolean strict)
                                   throws IOException
        Opens the given archive and creates a package
        Specified by:
        open in interface PackageManager
        Parameters:
        archive - the archive
        strict - if true the import is more strict with regards to errors.
        Returns:
        the package
        Throws:
        IOException - if an error occurs
      • open

        public VaultPackage open​(File file,
                                 boolean strict)
                          throws IOException
        Opens the given file and creates a package
        Specified by:
        open in interface PackageManager
        Parameters:
        file - the file
        strict - if true the import is more strict with regards to errors.
        Returns:
        the package
        Throws:
        IOException - if an error occurs
      • assemble

        public VaultPackage assemble​(javax.jcr.Session s,
                                     ExportOptions opts,
                                     File file)
                              throws IOException,
                                     javax.jcr.RepositoryException
        Assembles a package using the given meta information and file to store to. if file is null a temp file is generated.
        Specified by:
        assemble in interface PackageManager
        Parameters:
        s - the repository session
        opts - export options
        file - the file to write to
        Returns:
        the newly created vault package
        Throws:
        IOException - if an I/O error occurs.
        javax.jcr.RepositoryException - if a repository error during building occurs.
      • assemble

        public void assemble​(javax.jcr.Session s,
                             ExportOptions opts,
                             OutputStream out)
                      throws IOException,
                             javax.jcr.RepositoryException
        Assembles a package using the given meta information. The package is directly streamed to the given output stream.

        The specified stream is closed after this method returns.

        Specified by:
        assemble in interface PackageManager
        Parameters:
        s - the repository session
        opts - the export options
        out - the output stream to write to
        Throws:
        IOException - if an I/O error occurs.
        javax.jcr.RepositoryException - if a repository error during building occurs.
      • rewrap

        public VaultPackage rewrap​(ExportOptions opts,
                                   VaultPackage src,
                                   File file)
                            throws IOException,
                                   javax.jcr.RepositoryException
        Re-wraps a package using the given meta information and file to store to.
        Specified by:
        rewrap in interface PackageManager
        Parameters:
        opts - export options
        src - source package
        file - the file to write to (may be null) to create a new temp file
        Returns:
        the newly created vault package
        Throws:
        IOException - if an I/O error occurs.
        javax.jcr.RepositoryException - if a repository error during building occurs.
      • rewrap

        public void rewrap​(ExportOptions opts,
                           VaultPackage src,
                           OutputStream out)
                    throws IOException
        Re-wraps the given package with the definition provided in the export options.

        The specified stream is closed after this method returns.

        Specified by:
        rewrap in interface PackageManager
        Parameters:
        opts - export options
        src - source package
        out - destination output stream
        Throws:
        IOException - if an I/O error occurs