| |
|
| java.lang.Object com.lutris.mime.MultipartMimeInput
MultipartMimeInput | public class MultipartMimeInput (Code) | | 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 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 String | newlineString The string that represents a newline for this instance of input. |
Method Summary | |
public void | close() Closes the input source and the current
MultipartMimeInputStream object. | public MultipartMimeInputStream | nextPart() Returns the next section of the Multipart MIME stream as a
MultipartMimeInputStream object. | public MultipartMimeInputStream | nextPart(String encoding) Returns the next section of the Multipart MIME stream as a
MultipartMimeInputStream object. |
atEOF | protected boolean atEOF(Code) | | True if the end of the input source has been reached and no more
multipart sections are available to be read.
|
currentStream | protected MultipartMimeInputStream currentStream(Code) | | The current section of Multipart input. This is maintained so that it can
be invalidated if a request is made to go to the next section.
|
inputPattern | protected BMByteSearch inputPattern(Code) | | Pre-compiled Boyer-Moore pattern search object for the Mime boundary
string.
|
inputSeparator | protected String inputSeparator(Code) | | The boundary string which separates different sections of the multipart
Mime input.
|
inputSource | protected BMByteSearchStream inputSource(Code) | | An input stream that does exact pattern searching using an efficient
string matching algorithm.
|
newlineString | protected String newlineString(Code) | | The string that represents a newline for this instance of input. This is
necessary because some web browsers (typically on Unix hosts) send LF
instead of the Mime-required CR+LF.
|
MultipartMimeInput | public MultipartMimeInput(InputStream source, ContentHeader contentHeader) throws MimeException(Code) | | Constructs a new MultipartMimeInput object from an input source of type
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.
Parameters: source - Input stream from which Mime input will be read. Parameters: contentHeader - ContentHeader object containing aboundary field and Mime type to be used inscanning the input. exception: MimeException - Thrown if an illegal header or Mime type is encounteredwhile processing the input. |
close | public void close() throws MimeException(Code) | | Closes the input source and the current
MultipartMimeInputStream object. No more parts
will be returned by nextPart .
exception: MimeException - If an error occurs while closing theinput stream. |
nextPart | public MultipartMimeInputStream nextPart() throws MimeException(Code) | | Returns the next section of the Multipart MIME stream as a
MultipartMimeInputStream object. Returns 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.
A MultipartMimeInputStream object for the next section of themultipart message. exception: MimeException - If an error occurs while skipping to the next section ofinput. |
nextPart | public MultipartMimeInputStream nextPart(String encoding) throws MimeException(Code) | | Returns the next section of the Multipart MIME stream as a
MultipartMimeInputStream object. Returns 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.
Parameters: encoding - String encoding to apply during MultipartMimeInputStream initialization. A MultipartMimeInputStream object for the next section of themultipart message. exception: MimeException - If an error occurs while skipping to the next section ofinput. |
|
|
|