public class MIMEPart extends Object implements Closeable
read()
and readOnce()
may trigger the actual parsing the message. In fact,
parsing of an attachment part may be triggered by calling read()
methods
on some other attachment parts. All this happens behind the scenes so the
application developer need not worry about these details.Modifier and Type | Method and Description |
---|---|
void |
close()
Cleans up any resources that are held by this part (for e.g.
|
List<? extends Header> |
getAllHeaders()
Return all the headers
|
String |
getContentId()
Returns Content-ID MIME header for this attachment part
|
String |
getContentTransferEncoding()
Returns Content-Transfer-Encoding MIME header for this attachment part
|
String |
getContentType()
Returns Content-Type MIME header for this attachment part
|
List<String> |
getHeader(String name)
Return all the values for the specified header.
|
boolean |
isClosed()
Return
true if this part has already been closed, false otherwise. |
void |
moveTo(File f) |
InputStream |
read()
Can get the attachment part's content multiple times.
|
InputStream |
readOnce()
Can get the attachment part's content only once.
|
String |
toString() |
public InputStream read()
public void close()
read()
or readOnce()
close
in interface Closeable
close
in interface AutoCloseable
public InputStream readOnce()
public void moveTo(File f)
public String getContentId()
public String getContentTransferEncoding()
public String getContentType()
public List<String> getHeader(String name)
null
if no headers with the
specified name exist.name
- header namepublic List<? extends Header> getAllHeaders()
public boolean isClosed()
true
if this part has already been closed, false
otherwise.true
if this part has already been closed, false
otherwise.Copyright © 2019 Oracle Corporation. All rights reserved.