Package org.dspace.content.service
Interface BitstreamFormatService
- All Superinterfaces:
DSpaceCRUDService<BitstreamFormat>
- All Known Implementing Classes:
BitstreamFormatServiceImpl
Service interface class for the BitstreamFormat object.
The implementation of this class is responsible for all business logic calls for the BitstreamFormat object and is
autowired by spring
- Author:
- kevinvandevelde at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve all bitstream formats from the registry, ordered by IDfindByMIMEType(Context context, String mimeType) Find a bitstream format by its (unique) MIME type.findByShortDescription(Context context, String desc) Find a bitstream format by its (unique) short descriptionfindNonInternal(Context context) Retrieve all non-internal bitstream formats from the registry.findUnknown(Context context) Get the generic "unknown" bitstream format.intgetSupportLevelID(String supportLevel) If you know the support level string, look up the corresponding type ID constant.getSupportLevelText(BitstreamFormat bitstreamFormat) Get the support level text for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.guessFormat(Context context, Bitstream bitstream) Attempt to identify the format of a particular bitstream.voidsetShortDescription(Context context, BitstreamFormat bitstreamFormat, String shortDescription) Set the short description of the bitstream formatvoidsetSupportLevel(BitstreamFormat bitstreamFormat, int supportLevel) Set the support level for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.
-
Method Details
-
findByMIMEType
Find a bitstream format by its (unique) MIME type. If more than one bitstream format has the same MIME type, the one returned is unpredictable.- Parameters:
context- DSpace context objectmimeType- MIME type value- Returns:
- the corresponding bitstream format, or
nullif there's no bitstream format with the given MIMEtype. - Throws:
SQLException- if database error
-
findByShortDescription
Find a bitstream format by its (unique) short description- Parameters:
context- DSpace context objectdesc- the short description- Returns:
- the corresponding bitstream format, or
nullif there's no bitstream format with the given short description - Throws:
SQLException- if database error
-
findUnknown
Get the generic "unknown" bitstream format.- Parameters:
context- DSpace context object- Returns:
- the "unknown" bitstream format.
- Throws:
SQLException- if database errorIllegalStateException- if the "unknown" bitstream format couldn't be found
-
findAll
Retrieve all bitstream formats from the registry, ordered by ID- Parameters:
context- DSpace context object- Returns:
- the bitstream formats.
- Throws:
SQLException- if database error
-
findNonInternal
Retrieve all non-internal bitstream formats from the registry. The "unknown" format is not included, and the formats are ordered by support level (highest first) first then short description.- Parameters:
context- DSpace context object- Returns:
- the bitstream formats.
- Throws:
SQLException- if database error
-
setShortDescription
void setShortDescription(Context context, BitstreamFormat bitstreamFormat, String shortDescription) throws SQLException Set the short description of the bitstream format- Parameters:
context- contextbitstreamFormat- formatshortDescription- the new short description- Throws:
SQLException- if database error
-
getSupportLevelText
Get the support level text for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.- Parameters:
bitstreamFormat- format- Returns:
- the support level
-
setSupportLevel
Set the support level for this bitstream format - one ofUNKNOWN,KNOWNorSUPPORTED.- Parameters:
bitstreamFormat- formatsupportLevel- the new support level
-
getSupportLevelID
If you know the support level string, look up the corresponding type ID constant.- Parameters:
supportLevel- String with the name of the action (must be exact match)- Returns:
- the corresponding action ID, or
-1if the action string is unknown
-
guessFormat
Attempt to identify the format of a particular bitstream. If the format is unknown, null is returned.- Parameters:
context- contextbitstream- the bitstream to identify the format of- Returns:
- a format from the bitstream format registry, or null
- Throws:
SQLException- if database error
-