Package org.dspace.pack.bagit
Class SitePacker
- java.lang.Object
-
- org.dspace.pack.bagit.SitePacker
-
-
Constructor Summary
Constructors Constructor Description SitePacker(org.dspace.core.Context context, org.dspace.content.Site site, String archFmt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.base.Optional<List<String>>getMembers()Get themembersfor this Site; only populated on unpack.Filepack(File packDir)Packs (maps) the contents of this object into an archive file.voidsetContentFilter(String filter)Sets a filter on this packer.voidsetReferenceFilter(String filter)longsize(String method)Estimate the size of the object as packed into a bag.voidunpack(File archive)Unpacks (maps) the contents of the passed archive file into this object.
-
-
-
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:PackerPacks (maps) the contents of this object into an archive file.- Specified by:
packin interfacePacker- Parameters:
packDir- the locus of the packing- Returns:
- the packed archive file
- Throws:
org.dspace.authorize.AuthorizeException- if authorize errorIOException- if I/O errorSQLException- if database error
-
unpack
public void unpack(File archive) throws org.dspace.authorize.AuthorizeException, IOException, SQLException
Description copied from interface:PackerUnpacks (maps) the contents of the passed archive file into this object.- Specified by:
unpackin interfacePacker- Parameters:
archive- the archive file to unpack- Throws:
org.dspace.authorize.AuthorizeException- if authorize errorIOException- if I/O errorSQLException- if database error
-
getMembers
public com.google.common.base.Optional<List<String>> getMembers()
Get themembersfor 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:PackerEstimate the size of the object as packed into a bag. This estimate uses any defined content filters.- Specified by:
sizein interfacePacker- 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:PackerSets 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:
setContentFilterin interfacePacker- Parameters:
filter- filter
-
setReferenceFilter
public void setReferenceFilter(String filter)
- Specified by:
setReferenceFilterin interfacePacker
-
-