org.jboss.portal.common.util
Class MediaType

java.lang.Object
  extended by org.jboss.portal.common.util.MediaType

Deprecated.

@Deprecated
public final class MediaType
extends java.lang.Object

This class is going to be removed any time soon in favoir of org.jboss.portal.common.net.media.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.

Version:
$LastChangedRevision: 6704 $, $LastChangedDate: 2007-03-15 23:36:31 +0100 (Thu, 15 Mar 2007) $
Author:
Martin Holzner
See Also:
see also ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/

Field Summary
static MediaType ANY
          Deprecated. Mime type 'Any' maps to an accept mime type of '*.*' (used by IE for css, images, etc.)
static MediaType CSS
          Deprecated. Mime type css
static MediaType FORM
          Deprecated. Mime type form (application/x-www-form-urlencoded)
static MediaType GIF
          Deprecated. Mime type gif
static MediaType HTML
          Deprecated. Mime type html
static MediaType ICO
          Deprecated. Mime type ico (see http://filext.com/detaillist.php?extdetail=ICO)
static MediaType JPEG
          Deprecated. Mime type jpeg
static MediaType JS
          Deprecated. Mime type js
static MediaType PNG
          Deprecated. Mime type png
static MediaType RSS
          Deprecated. Mime type rss
static MediaType SVG
          Deprecated. Mime type svg
static MediaType TEXT
          Deprecated. Mime type text
static MediaType WBMP
          Deprecated. Mime type wbmp
static MediaType WML
          Deprecated. Mime type wml
static MediaType XHTML
          Deprecated. Mime type xhtml
static MediaType XML
          Deprecated. Mime type xml
 
Method Summary
 boolean equals(java.lang.Object o)
          Deprecated. compare the parameter with this instance and see if they are equals.
 java.util.List getAllowedSubTypes()
          Deprecated. Get a list of allowed sub types for for this mime type.
static java.util.List getAllowedSubTypes(MediaType mimeType)
          Deprecated. Get a list of allowed sub types for the passed mime type.
 int hashCode()
          Deprecated. Get the hascode for this mime type.
 boolean isAllowedSubType(MediaType other)
          Deprecated. Return true if the allowed sub types contains the specified media type.
static MediaType parseMimeType(java.lang.String mimeType)
          Deprecated. Get the mime type for the presented string, if the string contains a valid mime type.
static MediaType parseMimeTypeByExtension(java.lang.String extension)
          Deprecated. Get the mime type for the presented string.
 java.lang.String toString()
          Deprecated. 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

ANY

public static final MediaType ANY
Deprecated. 
Mime type 'Any' maps to an accept mime type of '*.*' (used by IE for css, images, etc.)


XHTML

public static final MediaType XHTML
Deprecated. 
Mime type xhtml


HTML

public static final MediaType HTML
Deprecated. 
Mime type html


FORM

public static final MediaType FORM
Deprecated. 
Mime type form (application/x-www-form-urlencoded)


XML

public static final MediaType XML
Deprecated. 
Mime type xml


WML

public static final MediaType WML
Deprecated. 
Mime type wml


CSS

public static final MediaType CSS
Deprecated. 
Mime type css


TEXT

public static final MediaType TEXT
Deprecated. 
Mime type text


JS

public static final MediaType JS
Deprecated. 
Mime type js


SVG

public static final MediaType SVG
Deprecated. 
Mime type svg


JPEG

public static final MediaType JPEG
Deprecated. 
Mime type jpeg


GIF

public static final MediaType GIF
Deprecated. 
Mime type gif


PNG

public static final MediaType PNG
Deprecated. 
Mime type png


WBMP

public static final MediaType WBMP
Deprecated. 
Mime type wbmp


RSS

public static final MediaType RSS
Deprecated. 
Mime type rss


ICO

public static final MediaType ICO
Deprecated. 
Mime type ico (see http://filext.com/detaillist.php?extdetail=ICO)

Method Detail

parseMimeType

public static MediaType parseMimeType(java.lang.String mimeType)
                               throws javax.activation.MimeTypeParseException
Deprecated. 
Get the mime type for the presented string, if the string contains a valid mime type.

Parameters:
mimeType - the java.lang.String to parse into a RegistryMimeTpye
Returns:
the RegistryMimeTpye that matches with the presented string
Throws:
javax.activation.MimeTypeParseException - if the presented mimetype is not supported
java.lang.IllegalArgumentException - if the presented string is null or empty

parseMimeTypeByExtension

public static MediaType parseMimeTypeByExtension(java.lang.String extension)
                                          throws javax.activation.MimeTypeParseException
Deprecated. 
Get the mime type for the presented string.

The string is handles as a file name extension. example: 'xml' returns MediaType.XML

Parameters:
extension - the java.lang.String to parse into a RegistryMimeTpye
Returns:
the RegistryMimeTpye that matches with the presented string
Throws:
javax.activation.MimeTypeParseException - if the presented mimetype is not supported
java.lang.IllegalArgumentException - if the presented string is null or empty

getAllowedSubTypes

public static java.util.List getAllowedSubTypes(MediaType mimeType)
Deprecated. 
Get a list of allowed sub types for the passed mime type.

Parameters:
mimeType - the RegistryMimeTpye to get the list of allowed subtypes for
Returns:
a java.util.List of PortalMimeTpyes

getAllowedSubTypes

public java.util.List getAllowedSubTypes()
Deprecated. 
Get a list of allowed sub types for for this mime type.

Returns:
a java.util.List of RegistryMimeTpyes

isAllowedSubType

public boolean isAllowedSubType(MediaType other)
Deprecated. 
Return true if the allowed sub types contains the specified media type.

Parameters:
other - the sub type to test
Returns:
true if it is an allowed sub type

toString

public java.lang.String toString()
Deprecated. 
Get the String representation of the mime type (i.e. 'text/html').

Overrides:
toString in class java.lang.Object
Returns:
the mime type as a java.lang.String
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object o)
Deprecated. 
compare the parameter with this instance and see if they are equals.

Overrides:
equals in class java.lang.Object
Parameters:
o - the Object to compare this instance to
Returns:
true if this and the paramters o are equal
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Deprecated. 
Get the hascode for this mime type.

Overrides:
hashCode in class java.lang.Object
Returns:
an int value representing this instance
See Also:
Object.hashCode()


Copyright © 2008. All Rights Reserved.