|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides base interface for MIME parts.
This class represents a MIME part, which may be a RFC8288 message, a MIME-formatted message attachment or a MIME representation of a standalone arbitrary data.
Method Summary | |
java.io.InputStream |
getContentInputStream()
Returns the content input stream. |
int |
getContentSize()
Returns the content size. |
java.io.InputStream |
getDecodedInputStream()
Returns the decoded content input stream. |
java.lang.String[] |
getHeader(java.lang.String name)
Returns all values of the given header. |
java.lang.String |
getHeader(java.lang.String name,
java.lang.String delimiter)
Returns all values of the given header, delimited by the given character sequence. |
java.util.Iterator |
getHeaderLines()
Returns all header lines. |
java.util.Iterator |
getHeaderNames()
Returns all header names. |
int |
getLineCount()
Returns the line count of the body. |
java.util.Iterator |
getMatchingHeaderLines(java.lang.String[] names)
Returns matching header lines. |
MimePart |
getMimePart(int number)
Returns the nested MIME part. |
int |
getMimePartCount()
Returns the number of nested MIME parts. |
java.util.Iterator |
getNonMatchingHeaderLines(java.lang.String[] names)
Returns non matching header lines. |
java.io.InputStream |
getRawInputStream()
Returns the raw input stream. |
int |
getRawSize()
Returns the raw size of this part. |
boolean |
isMimeType(java.lang.String type)
Whether this MIME part if of the given type. |
Method Detail |
public java.util.Iterator getHeaderNames() throws MimeException
MimeException
- if a MIME syntax error occuredpublic java.lang.String[] getHeader(java.lang.String name) throws MimeException
name
- the header name
MimeException
- if a MIME syntax error occuredpublic java.lang.String getHeader(java.lang.String name, java.lang.String delimiter) throws MimeException
name
- the header namedelimiter
- the value delimiter
MimeException
- if a MIME syntax error occuredpublic java.util.Iterator getHeaderLines() throws MimeException
The header lines are returned in the exact form as they appear in the MIME part.
MimeException
- if a MIME syntax error occuredpublic java.util.Iterator getMatchingHeaderLines(java.lang.String[] names) throws MimeException
The header lines are returned in the exact form as they appear in the MIME part.
names
- the header names
MimeException
- if a MIME syntax error occuredpublic java.util.Iterator getNonMatchingHeaderLines(java.lang.String[] names) throws MimeException
The header lines are returned in the exact form as they appear in the MIME part.
names
- the header names
MimeException
- if a MIME syntax error occuredpublic boolean isMimeType(java.lang.String type) throws MimeException
The type argument must be in the form of "type/subtype" pair. If wildcard character "*" is used as the subtype, the method will test only the main type. The type matching is case insensitive.
type
- the mime type
MimeException
- if a MIME syntax error occuredpublic int getRawSize() throws MimeException
Returns the size of the whole MIME part including the header.
MimeException
- if a MIME syntax error occuredpublic int getContentSize() throws MimeException
Returns the size of content-encoded MIME part body.
MimeException
- if a MIME syntax error occuredpublic int getLineCount() throws java.io.IOException, MimeException
Returns the total line count of the content-encoded MIME part body.
java.io.IOException
- if an I/O error occured
MimeException
- if a MIME syntax error occuredpublic java.io.InputStream getRawInputStream() throws java.io.IOException, MimeException
Returns the input stream of the whole MIME part including the header.
java.io.IOException
- if an I/O error occured
MimeException
- if a MIME syntax error occuredpublic java.io.InputStream getContentInputStream() throws java.io.IOException, MimeException
Returns the input stream of the content-encoded MIME part body.
java.io.IOException
- if an I/O error occured
MimeException
- if a MIME syntax error occuredpublic java.io.InputStream getDecodedInputStream() throws java.io.IOException, MimeException
Returns the input stream of the content-decoded MIME part body.
java.io.IOException
- if an I/O error occured
MimeException
- if a MIME syntax error occuredpublic int getMimePartCount() throws MimeException
Returns the total number of nested MIME parts. The parts are numbered from zero. Only parts of type "multipart/*" or "message/rfc822" are regarded as multipart. If the part if of type "message/rfc822", it has only one directly nested part - the RFC822 message itself, which may in turn contain another MIME parts, if it is a multipart message.
MimeException
- if a MIME syntax error occuredpublic MimePart getMimePart(int number) throws MimeException
number
- the part number
MimeException
- if a MIME syntax error occured
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |