public class BitstreamFormat extends Object
Changes to the bitstream format metadata are only written to the database
when update is called.
| Modifier and Type | Field and Description |
|---|---|
static int |
KNOWN
The "known" support level - for bitstream formats that are known to the
system, but not fully supported
|
static int |
SUPPORTED
The "supported" support level - for bitstream formats known to the system
and fully supported.
|
static int |
UNKNOWN
The "unknown" support level - for bitstream formats that are unknown to
the system
|
| Modifier and Type | Method and Description |
|---|---|
static BitstreamFormat |
create(Context context)
Create a new bitstream format
|
void |
delete()
Delete this bitstream format.
|
static BitstreamFormat |
find(Context context,
int id)
Get a bitstream format from the database.
|
static BitstreamFormat[] |
findAll(Context context)
Retrieve all bitstream formats from the registry, ordered by ID
|
static BitstreamFormat |
findByMIMEType(Context context,
String mimeType)
Find a bitstream format by its (unique) MIME type.
|
static BitstreamFormat |
findByShortDescription(Context context,
String desc)
Find a bitstream format by its (unique) short description
|
static BitstreamFormat[] |
findNonInternal(Context context)
Retrieve all non-internal bitstream formats from the registry.
|
static BitstreamFormat |
findUnknown(Context context)
Get the generic "unknown" bitstream format.
|
String |
getDescription()
Get a description of this bitstream format, including full application or
format name
|
String[] |
getExtensions()
Get the filename extensions associated with this format
|
int |
getID()
Get the internal identifier of this bitstream format
|
String |
getMIMEType()
Get the MIME type of this bitstream format, for example
text/plain |
String |
getShortDescription()
Get a short (one or two word) description of this bitstream format
|
int |
getSupportLevel()
Get the support level for this bitstream format - one of
UNKNOWN,KNOWN or SUPPORTED. |
static int |
getSupportLevelID(String slevel)
If you know the support level string, look up the corresponding type ID
constant.
|
String |
getSupportLevelText()
Get the support level text for this bitstream format - one of
UNKNOWN,KNOWN or SUPPORTED. |
boolean |
isInternal()
Find out if the bitstream format is an internal format - that is, one
that is used to store system information, rather than the content of
items in the system
|
void |
setDescription(String s)
Set the description of the bitstream format
|
void |
setExtensions(String[] exts)
Set the filename extensions associated with this format
|
void |
setInternal(boolean b)
Set whether the bitstream format is an internal format
|
void |
setMIMEType(String s)
Set the MIME type of the bitstream format
|
void |
setShortDescription(String s)
Set the short description of the bitstream format
|
void |
setSupportLevel(int sl)
Set the support level for this bitstream format - one of
UNKNOWN,KNOWN or SUPPORTED. |
void |
update()
Update the bitstream format metadata
|
public static final int UNKNOWN
public static final int KNOWN
public static final int SUPPORTED
public static BitstreamFormat find(Context context, int id) throws SQLException
context - DSpace context objectid - ID of the bitstream formatSQLExceptionpublic static BitstreamFormat findByMIMEType(Context context, String mimeType) throws SQLException
context - DSpace context objectmimeType - MIME type valuenull if
there's no bitstream format with the given MIMEtype.SQLExceptionpublic static BitstreamFormat findByShortDescription(Context context, String desc) throws SQLException
context - DSpace context objectdesc - the short descriptionnull if
there's no bitstream format with the given short descriptionSQLExceptionpublic static BitstreamFormat findUnknown(Context context) throws SQLException
context - DSpace context objectSQLExceptionIllegalStateException - if the "unknown" bitstream format couldn't be foundpublic static BitstreamFormat[] findAll(Context context) throws SQLException
context - DSpace context objectSQLExceptionpublic static BitstreamFormat[] findNonInternal(Context context) throws SQLException
context - DSpace context objectSQLExceptionpublic static BitstreamFormat create(Context context) throws SQLException, AuthorizeException
context - DSpace context objectSQLExceptionAuthorizeExceptionpublic final int getID()
public final String getShortDescription()
public final void setShortDescription(String s) throws SQLException
s - the new short descriptionSQLExceptionpublic final String getDescription()
public final void setDescription(String s)
s - the new descriptionpublic final String getMIMEType()
text/plainpublic final void setMIMEType(String s)
s - the new MIME typepublic final int getSupportLevel()
UNKNOWN,KNOWN or SUPPORTED.public String getSupportLevelText()
UNKNOWN,KNOWN or SUPPORTED.public final void setSupportLevel(int sl)
UNKNOWN,KNOWN or SUPPORTED.sl - the new support levelpublic final boolean isInternal()
true if the bitstream format is an internal typepublic final void setInternal(boolean b)
b - pass in true if the bitstream format is an
internal typepublic void update()
throws SQLException,
AuthorizeException
SQLExceptionAuthorizeExceptionpublic void delete()
throws SQLException,
AuthorizeException
SQLExceptionAuthorizeExceptionpublic String[] getExtensions()
public void setExtensions(String[] exts)
exts - String [] array of extensionspublic static int getSupportLevelID(String slevel)
slevel - String with the name of the action (must be exact match)-1 if the action
string is unknownCopyright © 2014 DuraSpace. All Rights Reserved.