public class ParserStreamContentHandler extends Object implements ContentHandler
Constructor and Description |
---|
ParserStreamContentHandler(Entity entity,
BodyFactory bodyFactory) |
ParserStreamContentHandler(Entity entity,
MessageImplFactory messageImplFactory,
BodyFactory bodyFactory) |
Modifier and Type | Method and Description |
---|---|
void |
body(BodyDescriptor bd,
InputStream is)
Called when the body of a discrete (non-multipart) entity is about to
be parsed.
|
void |
endBodyPart()
Called when a body part ends.
|
void |
endHeader()
Called when there are no more header fields in a message or body part.
|
void |
endMessage()
Called when a message ends.
|
void |
endMultipart()
Called when the body of an entity has been parsed.
|
void |
epilogue(InputStream is)
Called for the epilogue (whatever comes after the final body part)
of a
multipart/* entity. |
void |
field(Field field)
Called for each field of a header.
|
void |
preamble(InputStream is)
Called for the preamble (whatever comes before the first body part)
of a
multipart/* entity. |
void |
raw(InputStream is)
Unsupported.
|
void |
startBodyPart()
Called when a new body part starts inside a
multipart/* entity. |
void |
startHeader()
Called when a header (of a message or body part) is about to be parsed.
|
void |
startMessage()
Called when a new message starts (a top level message or an embedded
rfc822 message).
|
void |
startMultipart(BodyDescriptor bd)
Called when the body of a multipart entity is about to be parsed.
|
public ParserStreamContentHandler(Entity entity, BodyFactory bodyFactory)
public ParserStreamContentHandler(Entity entity, MessageImplFactory messageImplFactory, BodyFactory bodyFactory)
public void startMessage() throws MimeException
ContentHandler
startMessage
in interface ContentHandler
MimeException
- on processing errorspublic void endMessage() throws MimeException
ContentHandler
endMessage
in interface ContentHandler
MimeException
- on processing errorspublic void startHeader() throws MimeException
ContentHandler
startHeader
in interface ContentHandler
MimeException
- on processing errorspublic void field(Field field) throws MimeException
ContentHandler
field
in interface ContentHandler
field
- the MIME field.MimeException
- on processing errorspublic void endHeader() throws MimeException
ContentHandler
endHeader
in interface ContentHandler
MimeException
- on processing errorspublic void startMultipart(BodyDescriptor bd) throws MimeException
ContentHandler
startMultipart
in interface ContentHandler
bd
- encapsulates the values (either read from the
message stream or, if not present, determined implictly
as described in the
MIME rfc:s) of the Content-Type
and
Content-Transfer-Encoding
header fields.MimeException
- on processing errorspublic void body(BodyDescriptor bd, InputStream is) throws MimeException, IOException
ContentHandler
body
in interface ContentHandler
bd
- see ContentHandler.startMultipart(BodyDescriptor)
is
- the contents of the body. NOTE: this is the raw body contents
- it will not be decoded if encoded. The bd
parameter should be used to determine how the stream data
should be decoded.MimeException
- on processing errorsIOException
- should be thrown on I/O errors.public void endMultipart() throws MimeException
ContentHandler
endMultipart
in interface ContentHandler
MimeException
- on processing errorspublic void startBodyPart() throws MimeException
ContentHandler
multipart/*
entity.startBodyPart
in interface ContentHandler
MimeException
- on processing errorspublic void endBodyPart() throws MimeException
ContentHandler
endBodyPart
in interface ContentHandler
MimeException
- on processing errorspublic void epilogue(InputStream is) throws MimeException, IOException
ContentHandler
multipart/*
entity.epilogue
in interface ContentHandler
is
- used to get the contents of the epilogue.MimeException
- on processing errorsIOException
- should be thrown on I/O errors.public void preamble(InputStream is) throws MimeException, IOException
ContentHandler
multipart/*
entity.preamble
in interface ContentHandler
is
- used to get the contents of the preamble.MimeException
- on processing errorsIOException
- should be thrown on I/O errors.public void raw(InputStream is) throws MimeException, IOException
raw
in interface ContentHandler
is
- the raw contents of the entity.UnsupportedOperationException
MimeException
- on processing errorsIOException
- should be thrown on I/O errors.MimeStreamParser.setRaw()
Copyright © 2004–2023 The Apache Software Foundation. All rights reserved.