|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.content.packager.PackageUtils
public class PackageUtils
Container class for code that is useful to many packagers.
| Nested Class Summary | |
|---|---|
static class |
PackageUtils.UnclosableInputStream
Stream wrapper that does not allow its wrapped stream to be closed. |
| Constructor Summary | |
|---|---|
PackageUtils()
|
|
| Method Summary | |
|---|---|
static void |
addDepositLicense(Context context,
String license,
Item item,
Collection collection)
Add DSpace Deposit License to an Item. |
static void |
checkMetadata(Item item)
Test that item has adequate metadata. |
static BitstreamFormat |
findOrCreateBitstreamFormat(Context context,
String shortDesc,
String MIMEType,
String desc)
Find or create a bitstream format to match the given short description. |
static Bitstream |
getBitstreamByFormat(Item item,
BitstreamFormat bsf,
String bnName)
Find bitstream by its format, looking in a specific bundle. |
static Bitstream |
getBitstreamByName(Item item,
String name)
Find bitstream by its Name, looking in all bundles. |
static Bitstream |
getBitstreamByName(Item item,
String bsName,
String bnName)
Find bitstream by its Name, looking in specific named bundle. |
static boolean |
isMetaInfoBundle(Bundle bn)
Predicate, does this bundle container meta-information. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PackageUtils()
| Method Detail |
|---|
public static void checkMetadata(Item item)
throws PackageValidationException
item - - item to test.
PackageValidationException
public static void addDepositLicense(Context context,
String license,
Item item,
Collection collection)
throws SQLException,
IOException,
AuthorizeException
context - - dspace contextlicense - - license string to add, may be null to invoke default.item - - the item.collection - - get the default license from here.
SQLException
IOException
AuthorizeException
public static Bitstream getBitstreamByName(Item item,
String name)
throws SQLException
item - Item whose bitstreams to search.name - Bitstream's name to match.
SQLException
public static Bitstream getBitstreamByName(Item item,
String bsName,
String bnName)
throws SQLException
item - - dspace item whose bundles to search.bsName - - name of bitstream to match.bnName - - bundle name to match, or null for all.
SQLException
public static Bitstream getBitstreamByFormat(Item item,
BitstreamFormat bsf,
String bnName)
throws SQLException
item - - dspace item whose bundles to search.bsf - - BitstreamFormat object to match.bnName - - bundle name to match, or null for all.
SQLExceptionpublic static boolean isMetaInfoBundle(Bundle bn)
bn - -- the bundle
public static BitstreamFormat findOrCreateBitstreamFormat(Context context,
String shortDesc,
String MIMEType,
String desc)
throws SQLException,
AuthorizeException
NOTE: When creating a new format, do NOT set any extensions, since we don't want any file with the same extension, which may be something generic like ".xml", to accidentally get set to this format.
context - - the context.shortDesc - - short descriptive name, used to locate existing format.MIMEtype - - mime content-typedesc - - long description
SQLException
AuthorizeException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||