Class SitePacker

  • All Implemented Interfaces:
    Packer

    public class SitePacker
    extends Object
    implements Packer
    Packer for a DSpace Site object in to a BagIt bag
    Author:
    mikejritter
    • Constructor Detail

      • SitePacker

        public SitePacker​(org.dspace.core.Context context,
                          org.dspace.content.Site site,
                          String archFmt)
    • Method Detail

      • pack

        public File pack​(File packDir)
                  throws org.dspace.authorize.AuthorizeException,
                         IOException,
                         SQLException
        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:
        org.dspace.authorize.AuthorizeException - if authorize error
        IOException - if I/O error
        SQLException - if database error
      • unpack

        public void unpack​(File archive)
                    throws org.dspace.authorize.AuthorizeException,
                           IOException,
                           SQLException
        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:
        org.dspace.authorize.AuthorizeException - if authorize error
        IOException - if I/O error
        SQLException - if database error
      • getMembers

        public com.google.common.base.Optional<List<String>> getMembers()
        Get the members for this Site; only populated on unpack.
        Returns:
        the list of members for the site, each represented the objects handle
      • size

        public long size​(String method)
                  throws SQLException
        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
        Throws:
        SQLException - if database error
      • 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