| Modifier and Type | Class and Description |
|---|---|
| public static class | ContentType.
Mutable |
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private String | |
| private static final byte[] | |
| private static final String | |
| private String | |
| private byte[] | |
| private boolean | |
| private boolean | |
| private int | |
| private String | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public static byte[] | Returns: a content-type array, composed of the mime-type represented by a byte array and a charset attribute value, represented by aStringa mime-type part of the content-type (doesn't contain charset attribute) mimeType, final String charset attribute value charset)Composes a content-type array, based on the mime-type represented by a byte array and a charset attribute value,
represented by a |
| public String | |
| public int | Returns: the data length within the array returned bygetByteArray()Used in conjunction with |
| public byte[] | |
| public String | |
| public static String | Returns: the contentType's charset attribute valuea content type header contentType)Parse the character encoding from the specified content type header. |
| public String | Returns: the mime-type part of the content-type (the part without charset attribute)Returns the mime-type part of the content-type (the part without charset attribute). |
| public boolean | |
| public boolean | |
| public static ContentType | newContentType(final String
String content-type representationCreates a |
| public static ContentType | Returns: aContentType wrapper over the passed mime-type and character encodingString mimeType-type representation (like "text/plain", "text/html", etc), which doesn't
contain charset informationcharset attribute to be used with the mime-type characterEncoding)Creates a |
| public static ContentType. | |
| private void | |
| public ContentType | |
| public static byte[] | Returns: a new array, which represents the same content-type as a given one, but without charset attributethe content-type represented by an array contentType)Removes the charset attribute from the content-type represented by an array. |
| protected void | |
| public void | |
| protected void | |
| protected void | |
| protected void | setCharacterEncoding(final String
the character encoding (the content-type's charset attribute value) charset)Sets the the character encoding (the content-type's charset attribute value). |
| protected void | setMimeType(final String
the mime-type part of the content-type (the part without charset attribute) mimeType)Sets the mime-type part of the content-type (the part without charset attribute). |
| public String |
| array | back to summary |
|---|---|
| private byte[] array | |
| characterEncoding | back to summary |
|---|---|
| private String characterEncoding | |
| CHARSET_BYTES | back to summary |
|---|---|
| private static final byte[] CHARSET_BYTES | |
| CHARSET_STRING | back to summary |
|---|---|
| private static final String CHARSET_STRING | |
| compiledContentType | back to summary |
|---|---|
| private String compiledContentType | |
| compiledContentTypeArray | back to summary |
|---|---|
| private byte[] compiledContentTypeArray | |
| isCharsetSet | back to summary |
|---|---|
| private boolean isCharsetSet | |
| isParsed | back to summary |
|---|---|
| private boolean isParsed | |
| len | back to summary |
|---|---|
| private int len | |
| mimeType | back to summary |
|---|---|
| private String mimeType | |
| quotedCharsetValue | back to summary |
|---|---|
| private String quotedCharsetValue | |
| unparsedContentType | back to summary |
|---|---|
| private String unparsedContentType | |
| ContentType | back to summary |
|---|---|
| pack-priv ContentType() | |
| ContentType | back to summary |
|---|---|
| pack-priv ContentType(final String contentType) | |
| checkArray | back to summary |
|---|---|
| private void checkArray(final int len) | |
| compose | back to summary |
|---|---|
| public static byte[] compose(final byte[] mimeType, final String charset) Composes a content-type array, based on the mime-type represented by a byte array and a charset attribute value,
represented by a | |
| get | back to summary |
|---|---|
public String get()
| |
| getArrayLen | back to summary |
|---|---|
| public int getArrayLen() Used in conjunction with
| |
| getByteArray | back to summary |
|---|---|
public byte[] getByteArray()
| |
| getCharacterEncoding | back to summary |
|---|---|
public String getCharacterEncoding()
| |
| getCharsetFromContentType | back to summary |
|---|---|
| public static String getCharsetFromContentType(String contentType) Parse the character encoding from the specified content type header. If the content type is null, or there is no
explicit character encoding, | |
| getMimeType | back to summary |
|---|---|
| public String getMimeType() Returns the mime-type part of the content-type (the part without charset attribute).
| |
| isMimeTypeSet | back to summary |
|---|---|
public boolean isMimeTypeSet()
| |
| isSet | back to summary |
|---|---|
public boolean isSet()
| |
| newContentType | back to summary |
|---|---|
| public static ContentType newContentType(final String contentType) Creates a
| |
| newContentType | back to summary |
|---|---|
| public static ContentType newContentType(final String mimeType, final String characterEncoding) Creates a
| |
| newSettableContentType | back to summary |
|---|---|
public static ContentType.
| |
| parse | back to summary |
|---|---|
| private void parse() Parse the unparsedContentType and splitting it into mime-type and character encoding. | |
| prepare | back to summary |
|---|---|
| public ContentType prepare() Prepare the ContentType for the serialization. This method might be particularly useful if we use the same ContentType over and over for different responses, so that the ContentType will not have to be parsed and prepared for each response separately.
| |
| removeCharset | back to summary |
|---|---|
| public static byte[] removeCharset(final byte[] contentType) Removes the charset attribute from the content-type represented by an array. The returned array will be completely independent of the source one.
| |
| reset | back to summary |
|---|---|
| protected void reset() Resets the ContentType state. | |
| serializeToDataChunk | back to summary |
|---|---|
| public void serializeToDataChunk(final DataChunk dc) Serializes this ContentType value into a passed | |
| set | back to summary |
|---|---|
| protected void set(final String contentType) Sets the content type. This method must preserve any charset that may already have been set via a call to request/response.setContentType(), request/response.setLocale(), or request/response.setCharacterEncoding().
| |
| set | back to summary |
|---|---|
| protected void set(final ContentType contentType) Sets the content type. This method must preserve any charset that may already have been set via a call to request/response.setContentType(), request/response.setLocale(), or request/response.setCharacterEncoding(). This method copies the passed contentType state into this ContentType.
| |
| setCharacterEncoding | back to summary |
|---|---|
| protected void setCharacterEncoding(final String charset) Sets the the character encoding (the content-type's charset attribute value).
| |
| setMimeType | back to summary |
|---|---|
| protected void setMimeType(final String mimeType) Sets the mime-type part of the content-type (the part without charset attribute).
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
ContentType object.
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | set(final ContentType contentType)
Overrides org. Sets the content type. |
| public void | set(final String type)
Overrides org. Sets the content type. |
| public void | setCharacterEncoding(final String charset)
Overrides org. Sets the the character encoding (the content-type's charset attribute value). |
| public void | setMimeType(final String mimeType)
Overrides org. Sets the mime-type part of the content-type (the part without charset attribute). |
| SettableContentType | back to summary |
|---|---|
| pack-priv SettableContentType() | |
| reset | back to summary |
|---|---|
| public void reset() Overrides org. Doc from org. Resets the ContentType state.
| |
| set | back to summary |
|---|---|
| public void set(final ContentType contentType) Overrides org. Doc from org. Sets the content type. This method must preserve any charset that may already have been set via a call to request/response.setContentType(), request/response.setLocale(), or request/response.setCharacterEncoding(). This method copies the passed contentType state into this ContentType.
| |
| set | back to summary |
|---|---|
| public void set(final String type) Overrides org. Doc from org. Sets the content type. This method must preserve any charset that may already have been set via a call to request/response.setContentType(), request/response.setLocale(), or request/response.setCharacterEncoding().
| |
| setCharacterEncoding | back to summary |
|---|---|
| public void setCharacterEncoding(final String charset) Overrides org. Doc from org. Sets the the character encoding (the content-type's charset attribute value).
| |
| setMimeType | back to summary |
|---|---|
| public void setMimeType(final String mimeType) Overrides org. Doc from org. Sets the mime-type part of the content-type (the part without charset attribute).
| |