Package org.nuxeo.client
Class MediaType
- java.lang.Object
-
- org.nuxeo.client.MediaType
-
public final class MediaType extends java.lang.Object- Since:
- 0.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static MediaTypeDEFAULTprotected static java.lang.StringDEFAULT_STRING
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.charset.Charsetcharset()Returns the charset of this media type, or null if this media type doesn't specify a charset.java.nio.charset.Charsetcharset(java.nio.charset.Charset defaultValue)Returns the charset of this media type, ordefaultValueif this media type doesn't specify a charset.booleanequals(java.lang.Object o)booleanequalsType(MediaType mediaType)booleanequalsTypeSubType(MediaType mediaType)booleanequalsTypeSubTypeWithoutSuffix(MediaType mediaType)static MediaTypefromOkHttpMediaType(okhttp3.MediaType mediaType)inthashCode()java.lang.StringnuxeoEntity()Returns the Nuxeo Entitystatic MediaTypeparse(java.lang.String string)java.lang.Stringsubtype()Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".okhttp3.MediaTypetoOkHttpMediaType()java.lang.StringtoString()Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in a Content-Type header.java.lang.Stringtype()Returns the high-level media type, such as "text", "image", "audio", "video", or "application".
-
-
-
Field Detail
-
DEFAULT_STRING
protected static final java.lang.String DEFAULT_STRING
- Since:
- 3.1
- See Also:
- Constant Field Values
-
DEFAULT
protected static final MediaType DEFAULT
- Since:
- 3.1
-
-
Method Detail
-
type
public java.lang.String type()
Returns the high-level media type, such as "text", "image", "audio", "video", or "application".
-
subtype
public java.lang.String subtype()
Returns a specific media subtype, such as "plain" or "png", "mpeg", "mp4" or "xml".
-
charset
public java.nio.charset.Charset charset()
Returns the charset of this media type, or null if this media type doesn't specify a charset.
-
nuxeoEntity
public java.lang.String nuxeoEntity()
Returns the Nuxeo Entity
-
charset
public java.nio.charset.Charset charset(java.nio.charset.Charset defaultValue)
Returns the charset of this media type, ordefaultValueif this media type doesn't specify a charset.
-
toOkHttpMediaType
public okhttp3.MediaType toOkHttpMediaType()
-
equalsType
public boolean equalsType(MediaType mediaType)
-
equalsTypeSubType
public boolean equalsTypeSubType(MediaType mediaType)
-
equalsTypeSubTypeWithoutSuffix
public boolean equalsTypeSubTypeWithoutSuffix(MediaType mediaType)
-
toString
public java.lang.String toString()
Returns the encoded media type, like "text/plain; charset=utf-8", appropriate for use in a Content-Type header.- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
fromOkHttpMediaType
public static MediaType fromOkHttpMediaType(okhttp3.MediaType mediaType)
- Returns:
- a media type by parsing
mediaType, orDEFAULTifmediaTypeis null
-
-