|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.BasicItem<MimeTypeData>
org.proteios.core.MimeType
public class MimeType
This class is used to represent mime types. The mime types are important for file handling, for example when downloading a file on the web.
| Field Summary | |
|---|---|
static int |
MAX_EXTENSION_LENGTH
The maximum length of the extension variable that can be stored in the database. |
static Item |
TYPE
The type of item represented by this class. |
| Fields inherited from interface org.proteios.core.Nameable |
|---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
| Method Summary | |
|---|---|
static MimeType |
getByExtension(DbControl dc,
String extension)
Get a MimeType item when you know the file extension. |
static MimeType |
getById(DbControl dc,
int id)
Get a MimeType object when you know the ID. |
String |
getDescription()
Get the description for the item. |
String |
getExtension()
Get the extension for this MimeType item. |
static List<MimeTypeData> |
getMimeTypeDataList(DbControl dc)
Get a list of MimeTypeData items. |
static String |
getMimeTypeStringByExtension(DbControl dc,
String extension)
Get a MimeType string when you know the file extension. |
String |
getName()
Get the name of the item. |
static ItemQuery<MimeType> |
getQuery()
Get a query configured to retrieve MIME types. |
Item |
getType()
Get the type of item represented by the object. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
boolean |
isUsed()
A MimeType is not used by other items. |
void |
setDescription(String description)
Set the description for the item. |
void |
setExtension(String extension)
Set the extension variable for this MimeType item. |
void |
setName(String name)
Set the name of the item. |
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
| Methods inherited from class org.proteios.core.BasicItem |
|---|
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.proteios.core.Identifiable |
|---|
getId, getVersion |
| Methods inherited from interface org.proteios.core.AccessControlled |
|---|
checkPermission, hasPermission |
| Field Detail |
|---|
public static final Item TYPE
Item.MIMETYPE,
getType()public static final int MAX_EXTENSION_LENGTH
setExtension(String) method to avoid exceptions.
| Method Detail |
|---|
public static MimeType getById(DbControl dc,
int id)
throws ItemNotFoundException,
PermissionDeniedException,
BaseException
MimeType object when you know the ID.
dc - The DbControl which will be used for permission
checking and database access.id - The ID of the item to load
MimeType item
ItemNotFoundException - If an item with the specified ID is not
found
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the items
BaseException - If there is another error
public static MimeType getByExtension(DbControl dc,
String extension)
throws PermissionDeniedException,
ItemNotFoundException,
BaseException
MimeType item when you know the file extension.
dc - The DbControl which will be used for permission
checking and database access.extension - The extension of the mime type, do not include the dot
in the extension
MimeType item
ItemNotFoundException - If an item with the specified ID is not
found
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the items
BaseException - If there is another error
public static String getMimeTypeStringByExtension(DbControl dc,
String extension)
throws BaseException
MimeType string when you know the file extension.
dc - The DbControl which will be used for database access.extension - The extension of the mime type, do not include the dot
in the extension.
MimeType string
BaseException - If there is another error
public static List<MimeTypeData> getMimeTypeDataList(DbControl dc)
throws BaseException
MimeTypeData items.
dc - The DbControl which will be used for database access.
BaseException - If there is another error
public static ItemQuery<MimeType> getQuery()
throws BaseException
ItemQuery object
BaseExceptionpublic Item getType()
IdentifiableItem enumeration.
getType in interface Identifiablepublic String getName()
Nameable
getName in interface NameableString with the name of the item
public void setName(String name)
throws PermissionDeniedException,
InvalidDataException
NameableNameable.MAX_NAME_LENGTH constant.
setName in interface Nameablename - The new name for the item
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH constantpublic String getDescription()
Nameable
getDescription in interface NameableString with a description of the item
public void setDescription(String description)
throws PermissionDeniedException,
InvalidDataException
NameableNameable.MAX_DESCRIPTION_LENGTH constant.
setDescription in interface Nameabledescription - The new description for the item
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH constantpublic boolean isRemoved()
Removable
isRemoved in interface Removable
public void setRemoved(boolean removed)
throws PermissionDeniedException
Removable
setRemoved in interface Removableremoved - TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException - If the logged in user doesn't
have Permission.DELETE permission for setting the flag
to TRUE or Permission.WRITE permission for setting the
flag to FALSE
public boolean isUsed()
throws BaseException
isUsed in class BasicItem<MimeTypeData>BaseException - If there is an error.
public void setExtension(String extension)
throws PermissionDeniedException,
InvalidDataException
MimeType item.
extension - A string with the extension of this item. Note that this
extension should be without leading dot.
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission to the mimetype.
InvalidDataException - If the new value is null or longer than
MAX_EXTENSION_LENGTHpublic String getExtension()
MimeType item.
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||