|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MessagingPart
MessagingPart - A message part.
| Field Summary | |
|---|---|
static java.lang.String |
ATTACHMENT
The part should be presented as an attachment. |
static java.lang.String |
INLINE
The part should be presented inline. |
| Method Summary | |
|---|---|
MessagingContent |
getContent()
Gets the content. |
ContentType |
getContentType()
Gets the Content-Type header of this part's content. |
java.lang.String |
getDisposition()
Gets the disposition. |
java.lang.String |
getFileName()
Get the filename associated with this part, if possible. |
MessagingHeader |
getFirstHeader(java.lang.String name)
Gets the first header value associated with specified name or null if not present |
java.util.Collection<MessagingHeader> |
getHeader(java.lang.String name)
Gets the header associated with specified name or null if not present |
java.util.Map<java.lang.String,java.util.Collection<MessagingHeader>> |
getHeaders()
Gets the headers as an unmodifiable Map. |
java.lang.String |
getSectionId()
Gets the section identifier. |
long |
getSize()
Get the size of this part in bytes. |
void |
writeTo(java.io.OutputStream os)
Writes this part's bytes to given output stream. |
| Field Detail |
|---|
static final java.lang.String ATTACHMENT
static final java.lang.String INLINE
| Method Detail |
|---|
java.util.Map<java.lang.String,java.util.Collection<MessagingHeader>> getHeaders()
throws MessagingException
Map.
Map.
MessagingException - If headers cannot be returned
java.util.Collection<MessagingHeader> getHeader(java.lang.String name)
throws MessagingException
null if not present
name - The header name
null if not present
MessagingException - If header cannot be returned
MessagingHeader getFirstHeader(java.lang.String name)
throws MessagingException
null if not present
name - The header name
null if not present
MessagingException - If header cannot be returned
java.lang.String getDisposition()
throws MessagingException
The disposition describes how the part should be presented (see RFC 2183). The return value should be compared case-insensitive. For example:
String disposition = part.getDisposition(); if (disposition == null || MessagingPart.ATTACHMENT.equalsIgnoreCase(disposition)) // treat as attachment if not first part
MessagingException - If disposition cannot be returnedATTACHMENT,
INLINE
ContentType getContentType()
throws MessagingException
Content-Type header of this part's content. null is returned if the Content-Type
header could not be determined.
Content-Type header of this part
MessagingException - If content type cannot be returned
long getSize()
throws MessagingException
-1 if the size cannot be determined.
-1
MessagingException - If size cannot be returned
java.lang.String getFileName()
throws MessagingException
Useful if this part represents an "attachment" that was loaded from a file. The filename will usually be a simple name, not including directory components.
MessagingException - If filename cannot be returnedjava.lang.String getSectionId()
null if top level
MessagingContent getContent()
throws MessagingException
MessagingException - If content cannot be returned
void writeTo(java.io.OutputStream os)
throws java.io.IOException,
MessagingException
The bytes are typically used for transport.
java.io.IOException - If an I/O error occurs
MessagingException - If an error occurs fetching the data to be written
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||