Class PackagingService


  • public class PackagingService
    extends Object
    Default access point to package managers for non OSGi clients.
    Since:
    2.0
    • Constructor Detail

      • PackagingService

        public PackagingService()
    • Method Detail

      • getPackageManager

        public static PackageManager getPackageManager()
        Returns a non-repository based package manager.
        Returns:
        the package manager
      • getPackageManager

        public static JcrPackageManager getPackageManager​(Session session)
        Returns a repository based package manager.
        Parameters:
        session - repository session
        Returns:
        the package manager
      • createPackageDefinition

        public static JcrPackageDefinition createPackageDefinition​(Node defNode)
        Creates a new jcr package definition based on the given node.
        Parameters:
        defNode - the node
        Returns:
        the definition
        Since:
        2.2.14
      • open

        public static JcrPackage open​(Node node,
                                      boolean allowInvalid)
                               throws RepositoryException
        Opens a package that is based on the given node. If allowInvalid is true also invalid packages are returned, but only if the node is file like (i.e. is nt:hierarchyNode and has a jcr:content/jcr:data property). This is a shortcut version of JcrPackageManager.open(Node, boolean) which does not create a package manager instance.
        Parameters:
        node - the underlying node
        allowInvalid - if true invalid packages are openend, too.
        Returns:
        the new package or null it the package is not valid unless allowInvalid is true.
        Throws:
        RepositoryException - if an error occurs
        Since:
        2.3.0