org.openjena.atlas.web
Class MediaType

java.lang.Object
  extended by org.openjena.atlas.web.MediaType
Direct Known Subclasses:
MediaRange

public class MediaType
extends Object

A structure to represent a media type. Se also the Apache httpd documentation.


Constructor Summary
MediaType(MediaType other)
           
MediaType(String type, String subType)
          Create a media type from type and subType
MediaType(String type, String subType, String charset)
          Create a media type from type and subType
 
Method Summary
static MediaType create(String string)
           
static MediaType create(String contentType, String charset)
           
static MediaType create(String contentType, String subType, String charset)
           
static MediaType createFromContentType(String string)
           
 boolean equals(Object object)
           
 String getCharset()
           
 String getContentType()
           
 String getParameter(String name)
           
 String getSubType()
           
 String getType()
           
 int hashCode()
           
static org.openjena.atlas.web.ParsedMediaType parse(String string)
           
 String toHeaderString()
          Format for use in HTTP header
 String toString()
          Format to show structure - intentionally different from header form so you can tell parsing happened correctly
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MediaType

public MediaType(MediaType other)

MediaType

public MediaType(String type,
                 String subType)
Create a media type from type and subType


MediaType

public MediaType(String type,
                 String subType,
                 String charset)
Create a media type from type and subType

Method Detail

create

public static MediaType create(String contentType,
                               String charset)

createFromContentType

public static MediaType createFromContentType(String string)

create

public static MediaType create(String contentType,
                               String subType,
                               String charset)

create

public static MediaType create(String string)

parse

public static org.openjena.atlas.web.ParsedMediaType parse(String string)

toHeaderString

public String toHeaderString()
Format for use in HTTP header


toString

public String toString()
Format to show structure - intentionally different from header form so you can tell parsing happened correctly

Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

getParameter

public String getParameter(String name)

getContentType

public String getContentType()

getCharset

public String getCharset()

getSubType

public String getSubType()

getType

public String getType()


Licenced under the Apache License, Version 2.0