|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.mime.MultipartMimeInput
public class MultipartMimeInput
Presents an incoming Multipart MIME message as a series of distinct MultipartMimeInputStream streams.
Field Summary | |
---|---|
protected boolean |
atEOF
True if the end of the input source has been reached and no more multipart sections are available to be read. |
protected MultipartMimeInputStream |
currentStream
The current section of Multipart input. |
protected BMByteSearch |
inputPattern
Pre-compiled Boyer-Moore pattern search object for the Mime boundary string. |
protected java.lang.String |
inputSeparator
The boundary string which separates different sections of the multipart Mime input. |
protected BMByteSearchStream |
inputSource
An input stream that does exact pattern searching using an efficient string matching algorithm. |
protected java.lang.String |
newlineString
The string that represents a newline for this instance of input. |
Constructor Summary | |
---|---|
MultipartMimeInput(java.io.InputStream source,
ContentHeader contentHeader)
Constructs a new MultipartMimeInput object from an input source of type InputStream and a ContentHeader object. |
Method Summary | |
---|---|
void |
close()
Closes the input source and the current MultipartMimeInputStream object. |
MultipartMimeInputStream |
nextPart()
Returns the next section of the Multipart MIME stream as a MultipartMimeInputStream object. |
MultipartMimeInputStream |
nextPart(java.lang.String encoding)
Returns the next section of the Multipart MIME stream as a MultipartMimeInputStream object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MultipartMimeInputStream currentStream
protected BMByteSearchStream inputSource
protected java.lang.String newlineString
protected java.lang.String inputSeparator
protected BMByteSearch inputPattern
protected boolean atEOF
Constructor Detail |
---|
public MultipartMimeInput(java.io.InputStream source, ContentHeader contentHeader) throws com.lutris.mime.MimeException
InputStream
and a ContentHeader
object. The
ContentHeader
object will usually be a
Content-Type
header and its value must begin with
"multipart/"
to indicate multipart Mime input. Other Mime
types will cause a MimeException
to be thrown. In
addition, a parameter called "boundary"
must exist
in the header, since multipart Mime input is split using a boundary
string passed in the Content-Type
header.
source
- Input stream from which Mime input will be read.contentHeader
- ContentHeader
object containing a
boundary
field and Mime type to be used in
scanning the input.
MimeException
- Thrown if an illegal header or Mime type is encountered
while processing the input.Method Detail |
---|
public MultipartMimeInputStream nextPart() throws com.lutris.mime.MimeException
null
if the end
of the input source has been reached.
Note:
Since Multipart MIME data flows in a single stream, calling this method causes the previously returned MultipartMimeInputStream to be automatically closed and its input to be skipped.
MimeException
- If an error occurs while skipping to the next section of
input.public MultipartMimeInputStream nextPart(java.lang.String encoding) throws com.lutris.mime.MimeException
null
if the end
of the input source has been reached.
Note:
Since Multipart MIME data flows in a single stream, calling this method causes the previously returned MultipartMimeInputStream to be automatically closed and its input to be skipped.
encoding
- String encoding to apply during MultipartMimeInputStream initialization.
MimeException
- If an error occurs while skipping to the next section of
input.public void close() throws com.lutris.mime.MimeException
MultipartMimeInputStream
object. No more parts
will be returned by nextPart
.
MimeException
- If an error occurs while closing the
input stream.
|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |