|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectSK.gnome.dwarf.mail.mime.StreamMimePart
Provides a stream-based MimePart implementation.
This class implements the MimePart interface. The source data is read from
input stream via a SharedInputStreamSource instance.
| Constructor Summary | |
|
StreamMimePart(SharedInputStreamSource in)
Creates a new StreamMimePart. |
protected |
StreamMimePart(SharedInputStreamSource source,
int offset,
int length)
Creates a new StreamMimePart with the given offset and length. |
| 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public StreamMimePart(SharedInputStreamSource in)
throws MimeException
in - the stream source
protected StreamMimePart(SharedInputStreamSource source,
int offset,
int length)
throws MimeException
The new MIME part will begin at the given offset of the stream source and will be limited to the length bytes.
source - the stream sourceoffset - the stream offsetlength - the stream length| Method Detail |
public java.util.Iterator getHeaderNames()
throws MimeException
MimePart
getHeaderNames in interface MimePartMimeException - if a MIME syntax error occured
public java.lang.String[] getHeader(java.lang.String name)
throws MimeException
MimePart
getHeader in interface MimePartname - the header name
MimeException - if a MIME syntax error occured
public java.lang.String getHeader(java.lang.String name,
java.lang.String delimiter)
throws MimeException
MimePart
getHeader in interface MimePartname - the header namedelimiter - the value delimiter
MimeException - if a MIME syntax error occured
public java.util.Iterator getHeaderLines()
throws MimeException
MimePartThe header lines are returned in the exact form as they appear in the MIME part.
getHeaderLines in interface MimePartMimeException - if a MIME syntax error occured
public java.util.Iterator getMatchingHeaderLines(java.lang.String[] names)
throws MimeException
MimePartThe header lines are returned in the exact form as they appear in the MIME part.
getMatchingHeaderLines in interface MimePartnames - the header names
MimeException - if a MIME syntax error occured
public java.util.Iterator getNonMatchingHeaderLines(java.lang.String[] names)
throws MimeException
MimePartThe header lines are returned in the exact form as they appear in the MIME part.
getNonMatchingHeaderLines in interface MimePartnames - the header names
MimeException - if a MIME syntax error occured
public boolean isMimeType(java.lang.String type)
throws MimeException
MimePartThe 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.
isMimeType in interface MimeParttype - the mime type
MimeException - if a MIME syntax error occuredpublic int getRawSize()
MimePartReturns the size of the whole MIME part including the header.
getRawSize in interface MimePart
public int getContentSize()
throws MimeException
MimePartReturns the size of content-encoded MIME part body.
getContentSize in interface MimePartMimeException - if a MIME syntax error occured
public int getLineCount()
throws java.io.IOException,
MimeException
MimePartReturns the total line count of the content-encoded MIME part body.
getLineCount in interface MimePartMimeException - if a MIME syntax error occured
java.io.IOException - if an I/O error occured
public java.io.InputStream getRawInputStream()
throws java.io.IOException,
MimeException
MimePartReturns the input stream of the whole MIME part including the header.
getRawInputStream in interface MimePartMimeException - if a MIME syntax error occured
java.io.IOException - if an I/O error occured
public java.io.InputStream getContentInputStream()
throws java.io.IOException,
MimeException
MimePartReturns the input stream of the content-encoded MIME part body.
getContentInputStream in interface MimePartjava.io.IOException - if an I/O error occured
MimeException - if a MIME syntax error occured
public java.io.InputStream getDecodedInputStream()
throws java.io.IOException,
MimeException
MimePartReturns the input stream of the content-decoded MIME part body.
getDecodedInputStream in interface MimePartjava.io.IOException - if an I/O error occured
MimeException - if a MIME syntax error occured
public int getMimePartCount()
throws MimeException
MimePartReturns 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.
getMimePartCount in interface MimePartMimeException - if a MIME syntax error occured
public MimePart getMimePart(int number)
throws MimeException
MimePart
getMimePart in interface MimePartnumber - 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 | |||||||||