Class BagItPolicyUtil


  • public class BagItPolicyUtil
    extends Object
    Operations for ResourcePolicy objects in BagIt bags Generates a Policy pojo for DSpaceObjects which can be easily serialized to XML
    Author:
    mikejritter
    • Constructor Detail

      • BagItPolicyUtil

        public BagItPolicyUtil()
    • Method Detail

      • getPolicy

        public static Policies getPolicy​(org.dspace.core.Context context,
                                         org.dspace.content.DSpaceObject dso)
                                  throws IOException
        Create a Policy for a DSpaceObject
        Parameters:
        dso - The DSpaceObject to get the Policy for
        Returns:
        the Policy
        Throws:
        IOException
      • registerPolicies

        public static void registerPolicies​(org.dspace.core.Context context,
                                            org.dspace.content.DSpaceObject dSpaceObject,
                                            Policies policies)
                                     throws SQLException,
                                            org.dspace.authorize.AuthorizeException,
                                            org.dspace.content.packager.PackageException
        Register all policies found from Policies.getPolicies() by mapping them to a new ResourcePolicy. This operation will replace all existing ResourcePolicies for a given DSpaceObject unless there is an error during the mapping from a Policy to a ResourcePolicy.
        Parameters:
        context - the context to use
        dSpaceObject - the DSpaceObject to register policies for
        policies - the Policies pojo to create each ResourcePolicy
        Throws:
        SQLException
        org.dspace.authorize.AuthorizeException
        org.dspace.content.packager.PackageException