Interface JcrPackage

    • Method Detail

      • isValid

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

        @Nullable
        @Nullable 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 RepositoryException,
                                         IOException
        Returns the vault package stored in the data of this package. Opens the package implicitly therefore close() needs to be afterwards. This is potentially a costly operation as this requires uncompressing the ZIP stream (and potentially creating temporary files) therefore prefer using getDefinition() whenever possible to access meta data.
        Returns:
        the package, this is closed when close() is called on this package
        Throws:
        RepositoryException - if an error occurs
        IOException - if an I/O error occurs
      • getUnresolvedDependencies

        @NotNull
        @NotNull Dependency[] getUnresolvedDependencies()
                                                 throws 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:
        RepositoryException - if an error accessing the repository occurrs
        Since:
        3.1.32
      • getResolvedDependencies

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

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

        @Deprecated
        boolean verifyId​(boolean autoFix,
                         boolean autoSave)
                  throws 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:
        RepositoryException - if an error occurs.
        Since:
        2.2.18
      • isInstalled

        boolean isInstalled()
                     throws 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:
        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.