Interface JcrPackage

    • Method Detail

      • getDefinition

        @Nullable
        @Nullable JcrPackageDefinition getDefinition()
                                              throws javax.jcr.RepositoryException
        Returns the package definition of this package
        Returns:
        the package definition or null if this package is not valid.
        Throws:
        javax.jcr.RepositoryException - if an error occurrs
      • isValid

        boolean isValid()
        Checks if the underlying node contains the correct structure.
        Returns:
        true if this package is valid.
      • getNode

        @Nullable
        @Nullable javax.jcr.Node getNode()
        Returns the underlying node
        Returns:
        the node
      • isSealed

        boolean isSealed()
        Checks if this package is sealed. this is the case, if it was not modified since it was unwrapped.
        Returns:
        true if this package is sealed.
      • getPackage

        @NotNull
        @NotNull VaultPackage getPackage()
                                  throws javax.jcr.RepositoryException,
                                         IOException
        Returns the vault package stored in the data of this package
        Returns:
        the package, this is closed when close() is called on this package
        Throws:
        javax.jcr.RepositoryException - if an error occurs
        IOException - if an I/O error occurs
      • extract

        void extract​(@NotNull
                     @NotNull ImportOptions opts)
              throws javax.jcr.RepositoryException,
                     PackageException,
                     IOException
        Extracts the package contents to the repository
        Parameters:
        opts - import options
        Throws:
        javax.jcr.RepositoryException - if a repository error during installation occurs.
        PackageException - if an error during packaging occurs
        IllegalStateException - if the package is not valid.
        IOException - if an I/O error occurs
        Since:
        2.3.14
      • install

        void install​(@NotNull
                     @NotNull ImportOptions opts)
              throws javax.jcr.RepositoryException,
                     PackageException,
                     IOException
        Installs the package contents to the repository but creates a snapshot if necessary.
        Parameters:
        opts - import options
        Throws:
        javax.jcr.RepositoryException - if a repository error during installation occurs.
        PackageException - if an error during packaging occurs
        IllegalStateException - if the package is not valid.
        IOException - if an I/O error occurs
        Since:
        2.3.14
      • extractSubpackages

        @NotNull
        @NotNull PackageId[] extractSubpackages​(@NotNull
                                                @NotNull ImportOptions opts)
                                         throws javax.jcr.RepositoryException,
                                                PackageException,
                                                IOException
        Processes this package and extracts all sub packages. No content of this package or its sub packages is extracted and not snapshots are taken. If ImportOptions.isNonRecursive() is true, then only the direct sub packages are extracted. The extraction ensures that the sub packages have a dependency to their parent package.
        Parameters:
        opts - import options
        Returns:
        the list of subpackages that were extracted
        Throws:
        javax.jcr.RepositoryException - if a repository error during installation occurs.
        PackageException - if an error during packaging occurs
        IllegalStateException - if the package is not valid.
        IOException - if an I/O error occurs
        Since:
        3.1.32
      • getUnresolvedDependencies

        @NotNull
        @NotNull Dependency[] getUnresolvedDependencies()
                                                 throws javax.jcr.RepositoryException
        Returns the dependencies that are not resolved. If the DependencyHandling is set to strict, the package will not installed if any unresolved dependencies are listed.
        Returns:
        the array of unresolved dependencies.
        Throws:
        javax.jcr.RepositoryException - if an error accessing the repository occurrs
        Since:
        3.1.32
      • getResolvedDependencies

        @NotNull
        @NotNull PackageId[] getResolvedDependencies()
                                              throws javax.jcr.RepositoryException
        Returns a list of the installed packages that this package depends on.
        Returns:
        the array of resolved dependencies
        Throws:
        javax.jcr.RepositoryException - if an error accessing the repository occurrs
        Since:
        3.1.32
      • snapshot

        @Nullable
        @Nullable JcrPackage snapshot​(@NotNull
                                      @NotNull ExportOptions opts,
                                      boolean replace)
                               throws javax.jcr.RepositoryException,
                                      PackageException,
                                      IOException
        Creates a snapshot of this package.
        Parameters:
        opts - export options
        replace - if true any existing snapshot is replaced.
        Returns:
        a package that represents the snapshot of this package or null if it wasn't created.
        Throws:
        javax.jcr.RepositoryException - if a repository error during installation occurs.
        PackageException - if an error during packaging occurs
        IllegalStateException - if the package is not valid.
        IOException - if an I/O error occurs
        Since:
        2.0
      • getSnapshot

        @Nullable
        @Nullable JcrPackage getSnapshot()
                                  throws javax.jcr.RepositoryException
        Returns the snapshot that was taken when installing this package.
        Returns:
        the snapshot package or null
        Throws:
        javax.jcr.RepositoryException - if an error occurs.
        Since:
        2.0
      • verifyId

        @Deprecated
        boolean verifyId​(boolean autoFix,
                         boolean autoSave)
                  throws javax.jcr.RepositoryException
        Deprecated.
        As of 3.1.42, the storage location is implementation details.
        Checks if the package id is correct in respect to the installation path and adjusts it accordingly.
        Parameters:
        autoFix - true to automatically fix the id
        autoSave - true to save changes immediately
        Returns:
        true if id is correct.
        Throws:
        javax.jcr.RepositoryException - if an error occurs.
        Since:
        2.2.18
      • isInstalled

        boolean isInstalled()
                     throws javax.jcr.RepositoryException
        Checks if this package is installed. Note: the default implementation only checks the JcrPackageDefinition.getLastUnpacked() date. If the package is replaced since it was installed. this method will return false.
        Returns:
        true if this package is installed.
        Throws:
        javax.jcr.RepositoryException - if an error occurs.
        Since:
        2.4.6
      • isEmpty

        boolean isEmpty()
        Checks if the package has content.
        Returns:
        true if this package doesn't have content
        Since:
        3.1.40
      • getSize

        long getSize()
        Returns the size of the underlying package.
        Returns:
        the size in bytes or -1 if not valid.
      • getData

        @Nullable
        @Nullable javax.jcr.Property getData()
                                      throws javax.jcr.RepositoryException
        Returns the jcr:data property of the package
        Returns:
        the jcr:data property
        Throws:
        javax.jcr.RepositoryException - if an error occurrs
      • getDefNode

        @Nullable
        @Nullable javax.jcr.Node getDefNode()
                                     throws javax.jcr.RepositoryException
        Returns the definition node or null if not exists
        Returns:
        the definition node.
        Throws:
        javax.jcr.RepositoryException - if an error occurrs