|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.mime.ParameterizedHeader
com.openexchange.mail.mime.ContentType
com.openexchange.mail.mime.ContentType.UnmodifiableContentType
public static final class ContentType.UnmodifiableContentType
ContentType.UnmodifiableContentType - An unmodifiable content type.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.openexchange.mail.mime.ContentType |
|---|
ContentType.UnmodifiableContentType |
| Field Summary |
|---|
| Fields inherited from class com.openexchange.mail.mime.ContentType |
|---|
DEFAULT_CONTENT_TYPE |
| Constructor Summary | |
|---|---|
ContentType.UnmodifiableContentType(ContentType contentType)
Initializes a new ContentType.UnmodifiableContentType. |
|
| Method Summary | |
|---|---|
void |
addParameter(java.lang.String key,
java.lang.String value)
Adds specified value to given parameter name. |
int |
compareTo(ParameterizedHeader other)
|
boolean |
containsCharsetParameter()
|
boolean |
containsNameParameter()
|
boolean |
containsParameter(java.lang.String key)
Checks if parameter is present |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getBaseType()
Gets this content type's base type without any parameters appended; e.g. |
java.lang.String |
getCharsetParameter()
|
java.lang.String |
getNameParameter()
|
java.lang.String |
getParameter(java.lang.String key)
Gets specified parameter's value |
java.util.Iterator<java.lang.String> |
getParameterNames()
Gets all parameter names wrapped in an Iterator |
java.lang.String |
getPrimaryType()
|
java.lang.String |
getSubType()
|
int |
hashCode()
|
boolean |
isMimeType(java.lang.String pattern)
Checks if Content-Type's base type matches given wildcard pattern (e.g text/plain, text/* or text/htm*) |
java.lang.String |
removeParameter(java.lang.String key)
Removes specified parameter and returns its value |
ContentType |
setBaseType(java.lang.String baseType)
Sets base type (e.g. text/plain) |
ContentType |
setCharsetParameter(java.lang.String charset)
Sets "charset" parameter |
void |
setContentType(ContentType contentType)
Applies given content type to this content type |
void |
setContentType(java.lang.String contentType)
Sets the content type to specified content type string; e.g. |
ContentType |
setNameParameter(java.lang.String filename)
Sets "name" parameter |
void |
setParameter(java.lang.String key,
java.lang.String value)
Sets the given parameter. |
ContentType |
setPrimaryType(java.lang.String primaryType)
Sets primary type |
ContentType |
setSubType(java.lang.String subType)
Sets sub-type |
boolean |
startsWith(java.lang.String prefix)
Checks if Content-Type's base type ignore-case starts with specified prefix. |
java.lang.String |
toString()
|
java.lang.String |
toString(boolean skipEmptyParams)
Returns a RFC2045 style (ASCII-only) string representation of this content type. |
| Methods inherited from class com.openexchange.mail.mime.ContentType |
|---|
getBaseType, isMimeType, prepareContentTypeString, prepareContentTypeString, reset |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ContentType.UnmodifiableContentType(ContentType contentType)
ContentType.UnmodifiableContentType.
contentType - The backing content type| Method Detail |
|---|
public void addParameter(java.lang.String key,
java.lang.String value)
ParameterizedHeader
addParameter in class ParameterizedHeaderkey - The parameter namevalue - The parameter value to addpublic int compareTo(ParameterizedHeader other)
compareTo in interface java.lang.Comparable<ParameterizedHeader>compareTo in class ContentTypepublic boolean containsCharsetParameter()
containsCharsetParameter in class ContentTypetrue if "charset" parameter is present, false otherwisepublic boolean containsNameParameter()
containsNameParameter in class ContentTypetrue if "name" parameter is present, false otherwisepublic boolean containsParameter(java.lang.String key)
ParameterizedHeader
containsParameter in class ParameterizedHeaderkey - the parameter name
true if parameter is present; otherwise falsepublic boolean equals(java.lang.Object obj)
equals in class ContentTypepublic java.lang.String getBaseType()
ContentType"text/plain".
getBaseType in class ContentTypepublic java.lang.String getCharsetParameter()
getCharsetParameter in class ContentType"charset" value or null if not presentpublic java.lang.String getNameParameter()
getNameParameter in class ContentType"name" value or null if not presentpublic java.lang.String getParameter(java.lang.String key)
ParameterizedHeader
getParameter in class ParameterizedHeaderkey - The parameter name
null if not existingpublic java.util.Iterator<java.lang.String> getParameterNames()
ParameterizedHeaderIterator
getParameterNames in class ParameterizedHeaderIteratorpublic java.lang.String getPrimaryType()
getPrimaryType in class ContentTypepublic java.lang.String getSubType()
getSubType in class ContentTypepublic int hashCode()
hashCode in class ContentTypepublic boolean isMimeType(java.lang.String pattern)
ContentType
isMimeType in class ContentTypetrue if Content-Type's base type matches given pattern, false otherwisepublic java.lang.String removeParameter(java.lang.String key)
ParameterizedHeader
removeParameter in class ParameterizedHeaderkey - The parameter name
null if not existing
public ContentType setBaseType(java.lang.String baseType)
throws MailException
ContentType
setBaseType in class ContentTypeMailExceptionpublic ContentType setCharsetParameter(java.lang.String charset)
ContentType"charset" parameter
setCharsetParameter in class ContentTypecharset - The charset parameter value; e.g. "UTF-8"
"charset" parameter appliedpublic void setContentType(ContentType contentType)
ContentType
setContentType in class ContentTypecontentType - The content type to apply
public void setContentType(java.lang.String contentType)
throws MailException
ContentType
setContentType in class ContentTypecontentType - The content type string
MailException - If specified content type string cannot be parsedpublic ContentType setNameParameter(java.lang.String filename)
ContentType"name" parameter
setNameParameter in class ContentTypefilename - The name parameter
"name" parameter applied
public void setParameter(java.lang.String key,
java.lang.String value)
ParameterizedHeader
setParameter in class ParameterizedHeaderkey - The parameter namevalue - The parameter valuepublic ContentType setPrimaryType(java.lang.String primaryType)
ContentType
setPrimaryType in class ContentTypepublic ContentType setSubType(java.lang.String subType)
ContentType
setSubType in class ContentTypepublic boolean startsWith(java.lang.String prefix)
ContentType
startsWith in class ContentTypeprefix - The prefix
true if Content-Type's base type ignore-case starts with specified prefix; otherwise falsepublic java.lang.String toString()
toString in class ContentTypepublic java.lang.String toString(boolean skipEmptyParams)
ContentType
toString in class ContentTypeskipEmptyParams - true to skip empty parameters; otherwise false
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||