|
Apache JAMES Mime4j 0.6-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.mime4j.util.MimeUtil
public final class MimeUtil
A utility class, which provides some MIME related application logic.
Field Summary | |
---|---|
static String |
ENC_7BIT
The 7bit encoding. |
static String |
ENC_8BIT
The 8bit encoding. |
static String |
ENC_BASE64
The base64 encoding. |
static String |
ENC_BINARY
The binary encoding. |
static String |
ENC_QUOTED_PRINTABLE
The quoted-printable encoding. |
static String |
MIME_HEADER_CONTENT_DESCRIPTION
Content-Description header name (lowercase) |
static String |
MIME_HEADER_CONTENT_DISPOSITION
Content-Disposition header name (lowercase). |
static String |
MIME_HEADER_CONTENT_ID
Content-ID header name (lowercase) |
static String |
MIME_HEADER_LANGAUGE
Content-Langauge header (lower case). |
static String |
MIME_HEADER_LOCATION
Content-Location header (lower case). |
static String |
MIME_HEADER_MD5
Content-MD5 header (lower case). |
static String |
MIME_HEADER_MIME_VERSION
MIME-Version header name (lowercase) |
static String |
PARAM_CREATION_DATE
Content-Disposition creation-date parameter (lowercase). |
static String |
PARAM_FILENAME
Content-Disposition filename parameter (lowercase). |
static String |
PARAM_MODIFICATION_DATE
Content-Disposition modification-date parameter (lowercase). |
static String |
PARAM_READ_DATE
Content-Disposition read-date parameter (lowercase). |
static String |
PARAM_SIZE
Content-Disposition size parameter (lowercase). |
Method Summary | |
---|---|
static String |
createUniqueBoundary()
Creates a new unique message boundary string that can be used as boundary parameter for the Content-Type header field of a message. |
static String |
createUniqueMessageId(String hostName)
Creates a new unique message identifier that can be used in message header field such as Message-ID or In-Reply-To. |
static String |
fold(String s,
int usedCharacters)
Splits the specified string into a multiple-line representation with lines no longer than 76 characters (because the line might contain encoded words; see RFC 2047 section 2). |
static String |
formatDate(Date date,
TimeZone zone)
Formats the specified date into a RFC 822 date-time string. |
static Map<String,String> |
getHeaderParams(String pValue)
Parses a complex field value into a map of key/value pairs. |
static boolean |
isBase64Encoding(String pTransferEncoding)
Returns, whether the given transfer-encoding is "base64". |
static boolean |
isMessage(String pMimeType)
Returns true, if the given MIME type is that of a message. |
static boolean |
isMultipart(String pMimeType)
Return true, if the given MIME type indicates a multipart entity. |
static boolean |
isQuotedPrintableEncoded(String pTransferEncoding)
Returns, whether the given transfer-encoding is "quoted-printable". |
static boolean |
isSameMimeType(String pType1,
String pType2)
Returns, whether the given two MIME types are identical. |
static String |
unfold(String s)
Unfold a multiple-line representation into a single line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ENC_QUOTED_PRINTABLE
quoted-printable
encoding.
public static final String ENC_BINARY
binary
encoding.
public static final String ENC_BASE64
base64
encoding.
public static final String ENC_8BIT
8bit
encoding.
public static final String ENC_7BIT
7bit
encoding.
public static final String MIME_HEADER_MIME_VERSION
MIME-Version
header name (lowercase)
public static final String MIME_HEADER_CONTENT_ID
Content-ID
header name (lowercase)
public static final String MIME_HEADER_CONTENT_DESCRIPTION
Content-Description
header name (lowercase)
public static final String MIME_HEADER_CONTENT_DISPOSITION
Content-Disposition
header name (lowercase).
See RFC2183.
public static final String PARAM_FILENAME
Content-Disposition
filename parameter (lowercase).
See RFC2183.
public static final String PARAM_MODIFICATION_DATE
Content-Disposition
modification-date parameter (lowercase).
See RFC2183.
public static final String PARAM_CREATION_DATE
Content-Disposition
creation-date parameter (lowercase).
See RFC2183.
public static final String PARAM_READ_DATE
Content-Disposition
read-date parameter (lowercase).
See RFC2183.
public static final String PARAM_SIZE
Content-Disposition
size parameter (lowercase).
See RFC2183.
public static final String MIME_HEADER_LANGAUGE
Content-Langauge
header (lower case).
See RFC4646.
public static final String MIME_HEADER_LOCATION
Content-Location
header (lower case).
See RFC2557.
public static final String MIME_HEADER_MD5
Content-MD5
header (lower case).
See RFC1864.
Method Detail |
---|
public static boolean isSameMimeType(String pType1, String pType2)
public static boolean isMessage(String pMimeType)
public static boolean isMultipart(String pMimeType)
public static boolean isBase64Encoding(String pTransferEncoding)
public static boolean isQuotedPrintableEncoded(String pTransferEncoding)
public static Map<String,String> getHeaderParams(String pValue)
Parses a complex field value into a map of key/value pairs. You may use this, for example, to parse a definition like
text/plain; charset=UTF-8; boundary=foobarThe above example would return a map with the keys "", "charset", and "boundary", and the values "text/plain", "UTF-8", and "foobar".
Header value will be unfolded and excess white space trimmed.
pValue
- The field value to parse.
public static String createUniqueBoundary()
public static String createUniqueMessageId(String hostName)
null
it will be used as suffix for the message ID
(following an at sign).
The resulting string is enclosed in angle brackets (< and >);
hostName
- host name to be included in the message ID or
null
if no host name should be included.
public static String formatDate(Date date, TimeZone zone)
date
- date to be formatted into a string.zone
- the time zone to use or null
to use the default
time zone.
public static String fold(String s, int usedCharacters)
s
- string to split.usedCharacters
- number of characters already used up. Usually the number of
characters for header field name plus colon and one space.
public static String unfold(String s)
s
- string to unfold.
|
Apache JAMES Mime4j 0.6-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |