Class CatalogPacker

  • All Implemented Interfaces:
    Packer

    public class CatalogPacker
    extends Object
    implements Packer
    CatalogPacker packs and unpacks Object catalogs in Bagit format. These catalogs are typically used as deletion 'receipts' - i.e. records of what was deleted.
    Author:
    richardrodgers
    • Constructor Detail

      • CatalogPacker

        public CatalogPacker​(org.dspace.core.Context context,
                             String objectId)
      • CatalogPacker

        public CatalogPacker​(org.dspace.core.Context context,
                             String objectId,
                             String ownerId,
                             List<String> members)
    • Method Detail

      • getOwnerId

        public String getOwnerId()
      • pack

        public File pack​(File packDir)
                  throws IOException,
                         SQLException,
                         org.dspace.authorize.AuthorizeException
        Description copied from interface: Packer
        Packs (maps) the contents of this object into an archive file.
        Specified by:
        pack in interface Packer
        Parameters:
        packDir - the locus of the packing
        Returns:
        the packed archive file
        Throws:
        IOException - if I/O error
        SQLException - if database error
        org.dspace.authorize.AuthorizeException - if authorize error
      • unpack

        public void unpack​(File archive)
                    throws IOException
        Description copied from interface: Packer
        Unpacks (maps) the contents of the passed archive file into this object.
        Specified by:
        unpack in interface Packer
        Parameters:
        archive - the archive file to unpack
        Throws:
        IOException - if I/O error
      • size

        public long size​(String method)
        Description copied from interface: Packer
        Estimate the size of the object as packed into a bag. This estimate uses any defined content filters.
        Specified by:
        size in interface Packer
        Parameters:
        method - how to estimate - not currently implemented
        Returns:
        the bagged object size in bytes
      • setContentFilter

        public void setContentFilter​(String filter)
        Description copied from interface: Packer
        Sets a filter on this packer. A filter will ignore (skip) object content when packing to a bag. Filter syntax: ["+"]{BundleName,}+ That is, a list of Item bundle names taken to be exclusions, unless preceeded by a '+", where the list is taken to be inclusive.
        Specified by:
        setContentFilter in interface Packer
        Parameters:
        filter - filter