public class MIMEMessage extends Object implements Closeable
Constructor and Description |
---|
MIMEMessage(InputStream in,
String boundary) |
MIMEMessage(InputStream in,
String boundary,
MIMEConfig config)
Creates a MIME message from the content's stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all parsed
parts . |
List<MIMEPart> |
getAttachments()
Gets all the attachments by parsing the entire MIME message.
|
MIMEPart |
getPart(int index)
Creates nth attachment lazily.
|
MIMEPart |
getPart(String contentId)
Creates a lazy attachment for a given Content-ID.
|
boolean |
makeProgress()
Parses the MIME message in a pull fashion.
|
void |
parseAll()
Parses the whole MIME message eagerly
|
public MIMEMessage(InputStream in, String boundary)
in
- MIME message streamboundary
- the separator for parts(pass it without --)MIMEMessage(InputStream, String, MIMEConfig)
public MIMEMessage(InputStream in, String boundary, MIMEConfig config)
in
- MIME message streamboundary
- the separator for parts(pass it without --)config
- various configuration parameterspublic List<MIMEPart> getAttachments()
public MIMEPart getPart(int index)
index
- sequential order of the part. starts with zero.public MIMEPart getPart(String contentId)
contentId
- Content-ID of the part, expects Content-ID without <, >
public final void parseAll()
public void close()
parts
.
This method is safe to call even if parsing of message failed.
Does not throw MIMEParsingException
if an
error occurred during closing a MIME part. The exception (if any) is
still logged.
close
in interface Closeable
close
in interface AutoCloseable
public boolean makeProgress()
Copyright © 2019 Oracle Corporation. All rights reserved.