|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.portal.common.MediaType
public final class MediaType
This is a immutable wrapper to the activation MimeTpye.
This class contains some extensions to the activation MimeType, such as the typesafe enum pattern, and allows for a mime type to specify allowed sub types.
see also ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/
Field Summary | |
---|---|
static MediaType |
ANY
Mime type 'Any' maps to an accept mime type of '*.*' (used by IE for css, images, etc.) |
static MediaType |
CSS
Mime type css |
static MediaType |
FORM
Mime type form (application/x-www-form-urlencoded) |
static MediaType |
GIF
Mime type gif |
static MediaType |
HTML
Mime type html |
static MediaType |
ICO
Mime type ico (see http://filext.com/detaillist.php?extdetail=ICO) |
static MediaType |
JPEG
Mime type jpeg |
static MediaType |
JS
Mime type js |
static MediaType |
PNG
Mime type png |
static MediaType |
RSS
Mime type rss |
static MediaType |
SVG
Mime type svg |
static MediaType |
TEXT
Mime type text |
static MediaType |
WBMP
Mime type wbmp |
static MediaType |
WML
Mime type wml |
static MediaType |
XHTML
Mime type xhtml |
static MediaType |
XML
Mime type xml |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
compare the parameter with this instance and see if they are equals. |
java.util.List |
getAllowedSubTypes()
Get a list of allowed sub types for for this mime type. |
static java.util.List |
getAllowedSubTypes(MediaType mimeType)
Get a list of allowed sub types for the passed mime type. |
int |
hashCode()
Get the hascode for this mime type. |
static MediaType |
parseMimeType(java.lang.String mimeType)
Get the mime type for the presented string, if the string contains a valid mime type. |
static MediaType |
parseMimeTypeByExtension(java.lang.String extension)
Get the mime type for the presented string. |
java.lang.String |
toString()
Get the String representation of the mime type (i.e. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final MediaType ANY
public static final MediaType XHTML
public static final MediaType HTML
public static final MediaType FORM
public static final MediaType XML
public static final MediaType WML
public static final MediaType CSS
public static final MediaType TEXT
public static final MediaType JS
public static final MediaType SVG
public static final MediaType JPEG
public static final MediaType GIF
public static final MediaType PNG
public static final MediaType WBMP
public static final MediaType RSS
public static final MediaType ICO
Method Detail |
---|
public static MediaType parseMimeType(java.lang.String mimeType) throws javax.activation.MimeTypeParseException
mimeType
- the java.lang.String
to parse into a RegistryMimeTpye
RegistryMimeTpye
that matches with the presented string
javax.activation.MimeTypeParseException
- if the presented mimetype is not supported
java.lang.IllegalArgumentException
- if the presented string is null or emptypublic static MediaType parseMimeTypeByExtension(java.lang.String extension) throws javax.activation.MimeTypeParseException
The string is handles as a file name extension. example: 'xml' returns MediaType.XML
extension
- the java.lang.String
to parse into a RegistryMimeTpye
RegistryMimeTpye
that matches with the presented string
javax.activation.MimeTypeParseException
- if the presented mimetype is not supported
java.lang.IllegalArgumentException
- if the presented string is null or emptypublic static java.util.List getAllowedSubTypes(MediaType mimeType)
mimeType
- the RegistryMimeTpye
to get the list of allowed subtypes for
java.util.List
of PortalMimeTpye
spublic java.util.List getAllowedSubTypes()
java.util.List
of RegistryMimeTpye
spublic java.lang.String toString()
toString
in class java.lang.Object
java/lang.String
Object.toString()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the Object to compare this instance to
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |