Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.james.mime4j.util
Class MimeUtil

    java.lang.Object
      org.apache.james.mime4j.util.MimeUtil

    public final class MimeUtil

extends java.lang.Object

A utility class, which provides some MIME related application logic.

Field Summary
`static java.lang.String` | `ENC_7BIT` The `7bit` encoding.
`static java.lang.String` | `ENC_8BIT` The `8bit` encoding.
`static java.lang.String` | `ENC_BASE64` The `base64` encoding.
`static java.lang.String` | `ENC_BINARY` The `binary` encoding.
`static java.lang.String` | `ENC_QUOTED_PRINTABLE` The `quoted-printable` encoding.
`static java.lang.String` | `MIME_HEADER_CONTENT_DESCRIPTION` `Content-Description` header name (lowercase)
`static java.lang.String` | `MIME_HEADER_CONTENT_DISPOSITION` `Content-Disposition` header name (lowercase).
`static java.lang.String` | `MIME_HEADER_CONTENT_ID` `Content-ID` header name (lowercase)
`static java.lang.String` | `MIME_HEADER_LANGAUGE` `Content-Langauge` header (lower case).
`static java.lang.String` | `MIME_HEADER_LOCATION` `Content-Location` header (lower case).
`static java.lang.String` | `MIME_HEADER_MD5` `Content-MD5` header (lower case).
`static java.lang.String` | `MIME_HEADER_MIME_VERSION` `MIME-Version` header name (lowercase)
`static java.lang.String` | `PARAM_CREATION_DATE` `Content-Disposition` creation-date parameter (lowercase).
`static java.lang.String` | `PARAM_FILENAME` `Content-Disposition` filename parameter (lowercase).
`static java.lang.String` | `PARAM_MODIFICATION_DATE` `Content-Disposition` modification-date parameter (lowercase).
`static java.lang.String` | `PARAM_READ_DATE` `Content-Disposition` read-date parameter (lowercase).
`static java.lang.String` | `PARAM_SIZE` `Content-Disposition` size parameter (lowercase).

Method Summary
`static java.lang.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 java.lang.String` | `createUniqueMessageId(java.lang.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 java.util.Map` | `getHeaderParams(java.lang.String pValue)` Parses a complex field value into a map of key/value pairs.
`static boolean` | `isBase64Encoding(java.lang.String pTransferEncoding)` Returns, whether the given transfer-encoding is "base64".
`static boolean` | `isMessage(java.lang.String pMimeType)` Returns true, if the given MIME type is that of a message.
`static boolean` | `isMultipart(java.lang.String pMimeType)` Return true, if the given MIME type indicates a multipart entity.
`static boolean` | `isQuotedPrintableEncoded(java.lang.String pTransferEncoding)` Returns, whether the given transfer-encoding is "quoted-printable".
`static boolean` | `isSameMimeType(java.lang.String pType1, java.lang.String pType2)` Returns, whether the given two MIME types are identical.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ENC_QUOTED_PRINTABLE

    public static final java.lang.String ENC_QUOTED_PRINTABLE

  The `quoted-printable` encoding.

  See Also:
    Constant Field Values

### ENC_BINARY

    public static final java.lang.String ENC_BINARY

  The `binary` encoding.

  See Also:
    Constant Field Values

### ENC_BASE64

    public static final java.lang.String ENC_BASE64

  The `base64` encoding.

  See Also:
    Constant Field Values

### ENC_8BIT

    public static final java.lang.String ENC_8BIT

  The `8bit` encoding.

  See Also:
    Constant Field Values

### ENC_7BIT

    public static final java.lang.String ENC_7BIT

  The `7bit` encoding.

  See Also:
    Constant Field Values

### MIME_HEADER_MIME_VERSION

    public static final java.lang.String MIME_HEADER_MIME_VERSION

  `MIME-Version` header name (lowercase)

  See Also:
    Constant Field Values

### MIME_HEADER_CONTENT_ID

    public static final java.lang.String MIME_HEADER_CONTENT_ID

  `Content-ID` header name (lowercase)

  See Also:
    Constant Field Values

### MIME_HEADER_CONTENT_DESCRIPTION

    public static final java.lang.String MIME_HEADER_CONTENT_DESCRIPTION

  `Content-Description` header name (lowercase)

  See Also:
    Constant Field Values

### MIME_HEADER_CONTENT_DISPOSITION

    public static final java.lang.String MIME_HEADER_CONTENT_DISPOSITION

  `Content-Disposition` header name (lowercase). See RFC2183.

  See Also:
    Constant Field Values

### PARAM_FILENAME

    public static final java.lang.String PARAM_FILENAME

  `Content-Disposition` filename parameter (lowercase). See RFC2183.

  See Also:
    Constant Field Values

### PARAM_MODIFICATION_DATE

    public static final java.lang.String PARAM_MODIFICATION_DATE

  `Content-Disposition` modification-date parameter (lowercase). See RFC2183.

  See Also:
    Constant Field Values

### PARAM_CREATION_DATE

    public static final java.lang.String PARAM_CREATION_DATE

  `Content-Disposition` creation-date parameter (lowercase). See RFC2183.

  See Also:
    Constant Field Values

### PARAM_READ_DATE

    public static final java.lang.String PARAM_READ_DATE

  `Content-Disposition` read-date parameter (lowercase). See RFC2183.

  See Also:
    Constant Field Values

### PARAM_SIZE

    public static final java.lang.String PARAM_SIZE

  `Content-Disposition` size parameter (lowercase). See RFC2183.

  See Also:
    Constant Field Values

### MIME_HEADER_LANGAUGE

    public static final java.lang.String MIME_HEADER_LANGAUGE

  `Content-Langauge` header (lower case). See RFC4646.

  See Also:
    Constant Field Values

### MIME_HEADER_LOCATION

    public static final java.lang.String MIME_HEADER_LOCATION

  `Content-Location` header (lower case). See RFC2557.

  See Also:
    Constant Field Values

### MIME_HEADER_MD5

    public static final java.lang.String MIME_HEADER_MD5

  `Content-MD5` header (lower case). See RFC1864.

  See Also:
    Constant Field Values

Method Detail

### isSameMimeType

    public static boolean isSameMimeType(java.lang.String pType1,
                                         java.lang.String pType2)

  Returns, whether the given two MIME types are identical.

### isMessage

    public static boolean isMessage(java.lang.String pMimeType)

  Returns true, if the given MIME type is that of a message.

### isMultipart

    public static boolean isMultipart(java.lang.String pMimeType)

  Return true, if the given MIME type indicates a multipart entity.

### isBase64Encoding

    public static boolean isBase64Encoding(java.lang.String pTransferEncoding)

  Returns, whether the given transfer-encoding is "base64".

### isQuotedPrintableEncoded

    public static boolean isQuotedPrintableEncoded(java.lang.String pTransferEncoding)

  Returns, whether the given transfer-encoding is "quoted-printable".

### getHeaderParams

    public static java.util.Map getHeaderParams(java.lang.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=foobar

  The 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.

  Parameters:
    `pValue` - The field value to parse.
  Returns:
    The result map; use the key "" to retrieve the first value.

### createUniqueBoundary

    public static java.lang.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.

  Returns:
    a new unique message boundary string.

### createUniqueMessageId

    public static java.lang.String createUniqueMessageId(java.lang.String hostName)

  Creates a new unique message identifier that can be used in message header field such as Message-ID or In-Reply-To. If the given host name is not `null` it will be used as suffix for the message ID (following an at sign). The resulting string is enclosed in angle brackets (< and >);

  Parameters:
    `hostName` - host name to be included in the message ID or `null` if no host name should be included.
  Returns:
    a new unique message identifier.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.