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 VaultPackageassemble(Session s, ExportOptions opts, File file)Assembles a package using the given meta information and file to store to. if file isnulla temp file is generated.voidassemble(Session s, ExportOptions opts, OutputStream out)Assembles a package using the given meta information.@NotNull VaultPackageopen(@NotNull Archive archive)Opens the given archive and creates a package@NotNull VaultPackageopen(@NotNull Archive archive, boolean strict)Opens the given archive and creates a packageVaultPackageopen(File file)Opens the given file and creates a packageVaultPackageopen(File file, boolean strict)Opens the given file and creates a packageVaultPackagerewrap(ExportOptions opts, VaultPackage src, File file)Re-wraps a package using the given meta information and file to store to.voidrewrap(ExportOptions opts, VaultPackage src, OutputStream out)Re-wraps the given package with the definition provided in the export options.voidsetDispatcher(@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:
openin 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:
openin interfacePackageManager- Parameters:
archive- the archivestrict- iftruethe 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:
openin 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:
openin interfacePackageManager- Parameters:
file- the filestrict- iftruethe 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 isnulla temp file is generated.- Specified by:
assemblein 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:
assemblein 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:
rewrapin 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:
rewrapin 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)
-
-