|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lutris.mime.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. |
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 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 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 void close() throws MimeException
MultipartMimeInputStream
object. No more parts
will be returned by nextPart
.
MimeException
- If an error occurs while closing the
input stream.
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |