org.eclipse.webdav.http.client
Class ContentType

java.lang.Object
  extended by org.eclipse.webdav.http.client.ContentType

public class ContentType
extends Object

Parses an HTTP Content-Type entity-header field. See section 14.18 of RFC2068 for more information on this field.

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Constructor Summary
ContentType(String contentType)
          Parses the given HTTP Content-Type entity-header field.
 
Method Summary
 Enumeration getAttributes()
          Returns an Enumeration of this content type's attributes.
 String getSubtype()
          Returns this content type's subtype.
 String getType()
          Returns this content type's type.
 String getValue(String attribute)
          Returns the value of the given attribute for this content type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentType

public ContentType(String contentType)
            throws IllegalArgumentException
Parses the given HTTP Content-Type entity-header field. For example, if the content type is "text/xml; charset="ISO-8859-4"" the type is "text", the subtype is "xml", and the value of the attribute "charset" is "ISO-8859-4".

Parameters:
contentType - the value of the content type field to parse
Throws:
IllegalArgumentException - if the content type is malformed
Method Detail

getAttributes

public Enumeration getAttributes()
Returns an Enumeration of this content type's attributes. For example, if the content type is "text/xml; charset="ISO-8859-4"", it has one attribute namely, "charset".

Returns:
an Enumeration of Strings

getSubtype

public String getSubtype()
Returns this content type's subtype. For example, if the content type is "text/xml; charset="ISO-8859-4"", the the subtype is "xml".

Returns:
this content type's subtype

getType

public String getType()
Returns this content type's type. For example, if the content type is "text/xml; charset="ISO-8859-4"", the the type is "text".

Returns:
this content type's type

getValue

public String getValue(String attribute)
Returns the value of the given attribute for this content type. For example, if the content type is "text/xml; charset="ISO-8859-4"", then the value for the attribute "charset" is "IS-8859-4".

Returns:
the value of the given attribute for this content type


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.