public class BitstreamFormat
extends java.lang.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,
java.lang.String mimeType)
Find a bitstream format by its (unique) MIME type.
|
static BitstreamFormat |
findByShortDescription(Context context,
java.lang.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.
|
java.lang.String |
getDescription()
Get a description of this bitstream format, including full application or
format name
|
java.lang.String[] |
getExtensions()
Get the filename extensions associated with this format
|
int |
getID()
Get the internal identifier of this bitstream format
|
java.lang.String |
getMIMEType()
Get the MIME type of this bitstream format, for example
text/plain |
java.lang.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(java.lang.String slevel)
If you know the support level string, look up the corresponding type ID
constant.
|
java.lang.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(java.lang.String s)
Set the description of the bitstream format
|
void |
setExtensions(java.lang.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(java.lang.String s)
Set the MIME type of the bitstream format
|
void |
setShortDescription(java.lang.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 java.sql.SQLException
context - DSpace context objectid - ID of the bitstream formatjava.sql.SQLExceptionpublic static BitstreamFormat findByMIMEType(Context context, java.lang.String mimeType) throws java.sql.SQLException
context - DSpace context objectmimeType - MIME type valuenull if
there's no bitstream format with the given MIMEtype.java.sql.SQLExceptionpublic static BitstreamFormat findByShortDescription(Context context, java.lang.String desc) throws java.sql.SQLException
context - DSpace context objectdesc - the short descriptionnull if
there's no bitstream format with the given short descriptionjava.sql.SQLExceptionpublic static BitstreamFormat findUnknown(Context context) throws java.sql.SQLException
context - DSpace context objectjava.sql.SQLExceptionjava.lang.IllegalStateException - if the "unknown" bitstream format couldn't be foundpublic static BitstreamFormat[] findAll(Context context) throws java.sql.SQLException
context - DSpace context objectjava.sql.SQLExceptionpublic static BitstreamFormat[] findNonInternal(Context context) throws java.sql.SQLException
context - DSpace context objectjava.sql.SQLExceptionpublic static BitstreamFormat create(Context context) throws java.sql.SQLException, AuthorizeException
context - DSpace context objectjava.sql.SQLExceptionAuthorizeExceptionpublic final int getID()
public final java.lang.String getShortDescription()
public final void setShortDescription(java.lang.String s)
throws java.sql.SQLException
s - the new short descriptionjava.sql.SQLExceptionpublic final java.lang.String getDescription()
public final void setDescription(java.lang.String s)
s - the new descriptionpublic final java.lang.String getMIMEType()
text/plainpublic final void setMIMEType(java.lang.String s)
s - the new MIME typepublic final int getSupportLevel()
UNKNOWN,KNOWN or SUPPORTED.public java.lang.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 java.sql.SQLException,
AuthorizeException
java.sql.SQLExceptionAuthorizeExceptionpublic void delete()
throws java.sql.SQLException,
AuthorizeException
java.sql.SQLExceptionAuthorizeExceptionpublic java.lang.String[] getExtensions()
public void setExtensions(java.lang.String[] exts)
exts - String [] array of extensionspublic static int getSupportLevelID(java.lang.String slevel)
slevel - String with the name of the action (must be exact match)-1 if the action
string is unknownCopyright © 2013 DuraSpace. All Rights Reserved.