Class PackageManagerImpl
- java.lang.Object
-
- org.apache.jackrabbit.vault.packaging.impl.PackageManagerImpl
-
- All Implemented Interfaces:
PackageManager
- Direct Known Subclasses:
JcrPackageManagerImpl
public class PackageManagerImpl extends Object implements PackageManager
Implements the package manager
-
-
Constructor Summary
Constructors Constructor Description PackageManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VaultPackage
assemble(Session s, ExportOptions opts, File file)
Assembles a package using the given meta information and file to store to.void
assemble(Session s, ExportOptions opts, OutputStream out)
Assembles a package using the given meta information.@NotNull VaultPackage
open(@NotNull Archive archive)
Opens the given archive and creates a package@NotNull VaultPackage
open(@NotNull Archive archive, boolean strict)
Opens the given archive and creates a packageVaultPackage
open(File file)
Opens the given file and creates a packageVaultPackage
open(File file, boolean strict)
Opens the given file and creates a packageVaultPackage
rewrap(ExportOptions opts, VaultPackage src, File file)
Re-wraps a package using the given meta information and file to store to.void
rewrap(ExportOptions opts, VaultPackage src, OutputStream out)
Re-wraps the given package with the definition provided in the export options.void
setDispatcher(@Nullable PackageEventDispatcher dispatcher)
-
-
-
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 interfacePackageManager
- 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 interfacePackageManager
- Parameters:
archive
- the archivestrict
- iftrue
the import is more strict with regards to errors.- Returns:
- the package
- Throws:
IOException
- if an error occurs
-
open
public VaultPackage open(File file) throws IOException
Opens the given file and creates a package- Specified by:
open
in interfacePackageManager
- Parameters:
file
- the file- 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 interfacePackageManager
- Parameters:
file
- the filestrict
- iftrue
the import is more strict with regards to errors.- Returns:
- the package
- Throws:
IOException
- if an error occurs
-
assemble
public VaultPackage assemble(Session s, ExportOptions opts, File file) throws IOException, RepositoryException
Assembles a package using the given meta information and file to store to. if file isnull
a temp file is generated.- Specified by:
assemble
in interfacePackageManager
- Parameters:
s
- the repository sessionopts
- export optionsfile
- the file to write to- Returns:
- the newly created vault package
- Throws:
IOException
- if an I/O error occurs.RepositoryException
- if a repository error during building occurs.
-
assemble
public void assemble(Session s, ExportOptions opts, OutputStream out) throws IOException, 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 interfacePackageManager
- Parameters:
s
- the repository sessionopts
- the export optionsout
- the output stream to write to- Throws:
IOException
- if an I/O error occurs.RepositoryException
- if a repository error during building occurs.
-
rewrap
public VaultPackage rewrap(ExportOptions opts, VaultPackage src, File file) throws IOException, RepositoryException
Re-wraps a package using the given meta information and file to store to.- Specified by:
rewrap
in interfacePackageManager
- Parameters:
opts
- export optionssrc
- source packagefile
- the file to write to (may benull
) to create a new temp file- Returns:
- the newly created vault package
- Throws:
IOException
- if an I/O error occurs.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 interfacePackageManager
- Parameters:
opts
- export optionssrc
- source packageout
- destination output stream- Throws:
IOException
- if an I/O error occurs
-
setDispatcher
public void setDispatcher(@Nullable @Nullable PackageEventDispatcher dispatcher)
-
-