Interface VaultPackage

All Superinterfaces:
AutoCloseable, PackageProperties
All Known Implementing Classes:
HollowVaultPackage, ZipVaultPackage

@ProviderType public interface VaultPackage extends PackageProperties, AutoCloseable
Defines a vault package. A vault package is a binary assembled representation of a vault export. This is just a thin wrapper of an Archive.

Note that VaultPackage currently extends from PackageProperties to keep the interface backwards compatible.

  • Method Details

    • getId

      PackageId getId()
      Returns the id of this package or null if the id can't be determined.
      Specified by:
      getId in interface PackageProperties
      Returns:
      the id of this package.
    • getProperties

      PackageProperties getProperties()
      Returns the properties of this package.
      Returns:
      the properties.
      Since:
      3.1
    • isValid

      boolean isValid()
      Checks if this package is valid.
      Returns:
      true if this package is valid.
    • isClosed

      boolean isClosed()
      Checks if this package is closed.
      Returns:
      true if this package is closed.
    • getMetaInf

      MetaInf getMetaInf()
      Returns the meta inf that was either loaded or specified during build.
      Returns:
      the meta inf or null.
    • getSize

      long getSize()
      Returns the size of the package or -1 if n/a.
      Returns:
      the size
    • extract

      void extract(Session session, ImportOptions opts) throws RepositoryException, PackageException
      Extracts the package contents to the repository
      Parameters:
      session - repository session
      opts - import options
      Throws:
      RepositoryException - if a repository error during installation occurs.
      PackageException - if an error during packaging occurs
      IllegalStateException - if the package is not valid.
    • getFile

      File getFile()
      Returns the underlying file or null if not available.
      Returns:
      the file
      Since:
      2.0
    • close

      void close()
      Closes this package and releases underlying data. This will also close the underlying Archive if it has been opened. Only necessary to call if package has been opened via getArchive() or getMetaInf().
      Specified by:
      close in interface AutoCloseable
    • getArchive

      Archive getArchive()
      Returns the underlying package archive. Opens the archive when called for the first time. This does not need to be closed explicitly but rather is implicitly closed via a call to close().
      Returns:
      the archive or null if already closed