public class MimeStreamParser
extends java.lang.Object
Description:
Title:首亨软件 - TSS/CRM等
构造器和说明 |
---|
MimeStreamParser() |
MimeStreamParser(MimeConfig config) |
MimeStreamParser(MimeConfig config,
DecodeMonitor monitor,
BodyDescriptorBuilder bodyDescBuilder) |
MimeStreamParser(MimeTokenStream tokenStream) |
限定符和类型 | 方法和说明 |
---|---|
boolean |
isContentDecoding()
Determines whether this parser automatically decodes body content
based on the on the MIME fields with the standard defaults.
|
boolean |
isRaw()
Determines if this parser is currently in raw mode.
|
void |
parse(java.io.InputStream instream)
Parses a stream of bytes containing a MIME message.
|
void |
setContentDecoding(boolean b)
Defines whether parser should automatically decode body content
based on the on the MIME fields with the standard defaults.
|
void |
setContentHandler(ContentHandler h)
Sets the
ContentHandler to use when reporting
parsing events. |
void |
setFlat()
Enables flat mode.
|
void |
setRaw()
Enables raw mode.
|
void |
setRecurse()
Enables recursive mode.
|
void |
stop()
Finishes the parsing and stops reading lines.
|
public MimeStreamParser(MimeTokenStream tokenStream)
public MimeStreamParser(MimeConfig config, DecodeMonitor monitor, BodyDescriptorBuilder bodyDescBuilder)
public MimeStreamParser(MimeConfig config)
public MimeStreamParser()
public boolean isContentDecoding()
public void setContentDecoding(boolean b)
b
- booleanpublic void parse(java.io.InputStream instream) throws MimeException, java.io.IOException
MimeConfig
associated with the mime stream returns a not null Content-Type
value from its MimeConfig.getHeadlessParsing()
method, the message is
assumed to have no head section and the headless parsing mode will be used.instream
- the stream to parse.MimeException
- if the message can not be processedjava.io.IOException
- on I/O errors.public boolean isRaw()
true
if in raw mode, false
otherwise.setRaw()
public void setRaw()
ContentHandler.raw(InputStream)
handler method only.
The stream will contain the entire unparsed entity contents
including header fields and whatever is in the body.public void setFlat()
public void setRecurse()
public void stop()
ContentHandler.endMultipart()
,
ContentHandler.endBodyPart()
,
ContentHandler.endMessage()
, etc to match previous calls
to
ContentHandler.startMultipart(BodyDescriptor)
,
ContentHandler.startBodyPart()
,
ContentHandler.startMessage()
, etc.public void setContentHandler(ContentHandler h)
ContentHandler
to use when reporting
parsing events.h
- the ContentHandler
.