Class ZipVaultPackage

    • Method Detail

      • getArchive

        public 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 VaultPackage.close().
        Specified by:
        getArchive in interface VaultPackage
        Returns:
        the archive or null if already closed
      • isValid

        public boolean isValid()
        Checks if this package is valid.
        Specified by:
        isValid in interface VaultPackage
        Returns:
        true if this package is valid.
      • isClosed

        public boolean isClosed()
        Checks if this package is closed.
        Specified by:
        isClosed in interface VaultPackage
        Returns:
        true if this package is closed.
      • getFile

        public File getFile()
        Returns the file this package is based on.
        Specified by:
        getFile in interface VaultPackage
        Returns:
        the file of this package or null.
      • getMetaInf

        public MetaInf getMetaInf()
        Returns the meta inf that was either loaded or specified during build.
        Specified by:
        getMetaInf in interface VaultPackage
        Returns:
        the meta inf or null.
      • getSize

        public long getSize()
        Returns the size of the package or -1 if n/a.
        Specified by:
        getSize in interface VaultPackage
        Returns:
        the size
      • extract

        public void extract​(javax.jcr.Session session,
                            ImportOptions opts,
                            @NotNull
                            AbstractPackageRegistry.SecurityConfig securityConfig,
                            boolean isStrict,
                            boolean isOverwritePrimaryTypesOfFolders,
                            IdConflictPolicy defaultIdConflictPolicy)
                     throws PackageException,
                            javax.jcr.RepositoryException
        Extracts the current package allowing additional users to do that in case the package contains hooks or requires the root user
        Parameters:
        session - the session to user
        opts - import options
        securityConfig - configuration for the security during package extraction
        Throws:
        PackageException - if an error during packaging occurs
        javax.jcr.RepositoryException - if a repository error during installation occurs.
      • extract

        public void extract​(javax.jcr.Session session,
                            ImportOptions opts)
                     throws javax.jcr.RepositoryException,
                            PackageException
        Extracts the package contents to the repository
        Specified by:
        extract in interface VaultPackage
        Parameters:
        session - repository session
        opts - import options
        Throws:
        javax.jcr.RepositoryException - if a repository error during installation occurs.
        PackageException - if an error during packaging occurs
      • prepareExtract

        protected InstallContextImpl prepareExtract​(javax.jcr.Session session,
                                                    ImportOptions opts,
                                                    @NotNull
                                                    AbstractPackageRegistry.SecurityConfig securityConfig,
                                                    boolean isStrictByDefault,
                                                    boolean overwritePrimaryTypesOfFoldersByDefault,
                                                    IdConflictPolicy defaultIdConflictPolicy)
                                             throws PackageException,
                                                    javax.jcr.RepositoryException
        Prepares extraction.
        Parameters:
        session - repository session
        opts - import options
        securityConfig - the security configuration determining e.g. the install hook limitations
        isStrictByDefault - is true if packages should be installed in strict mode by default (if not set otherwise in opts)
        overwritePrimaryTypesOfFoldersByDefault - if folder aggregates' JCR primary type should be changed if the node is already existing or not
        defaultIdConflictPolicy - the default IdConflictPolicy to use if no policy is set in opts. May be null.
        Returns:
        installation context
        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.
      • extract

        protected void extract​(InstallContextImpl ctx,
                               List<String> subPackages)
                        throws javax.jcr.RepositoryException,
                               PackageException
        Same as above but the given subPackages argument receives a list of potential sub packages.
        Parameters:
        ctx - install context
        subPackages - receives the list of potential sub packages
        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.