Package org.dspace.pack.bagit
Class CommunityPacker
- java.lang.Object
-
- org.dspace.pack.bagit.CommunityPacker
-
-
Constructor Summary
Constructors Constructor Description CommunityPacker(org.dspace.core.Context context, org.dspace.content.Community community, String archFmt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.dspace.content.CommunitygetCommunity()Filepack(File packDir)Packs (maps) the contents of this object into an archive file.voidsetCommunity(org.dspace.content.Community community)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
-
CommunityPacker
public CommunityPacker(org.dspace.core.Context context, org.dspace.content.Community community, String archFmt)
-
-
Method Detail
-
getCommunity
public org.dspace.content.Community getCommunity()
-
setCommunity
public void setCommunity(org.dspace.content.Community community)
-
pack
public File pack(File packDir) throws org.dspace.authorize.AuthorizeException, SQLException, IOException
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 errorSQLException- if database errorIOException- if I/O 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
-
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
-
-