|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Part
Note: Parts are used in Collections so implementing classes must provide a suitable implementation of equals and hashCode.
Field Summary | |
---|---|
static String |
ATTACHMENT
This part should be presented as an attachment. |
static String |
INLINE
This part should be presented or rendered inline. |
Method Summary | |
---|---|
void |
addHeader(String name,
String value)
Add this value to the existing headers with the given name. |
Enumeration |
getAllHeaders()
Return all headers as an Enumeration of Header objects. |
Object |
getContent()
Return a content object for this Part. |
String |
getContentType()
Get the ContentType for this part, or null if the ContentType has not been set. |
DataHandler |
getDataHandler()
Returns a DataHandler instance for the content with in the Part. |
String |
getDescription()
Returns a description string for this Part. |
String |
getDisposition()
Return the disposition of the part. |
String |
getFileName()
Get a file name associated with this part. |
String[] |
getHeader(String name)
Get all Headers for this header name. |
InputStream |
getInputStream()
Return an InputStream for accessing the Part content. |
int |
getLineCount()
Return the number of lines in the content, or -1 if the line count cannot be determined. |
Enumeration |
getMatchingHeaders(String[] names)
Return all headers that match the list of names as an Enumeration of Header objects. |
Enumeration |
getNonMatchingHeaders(String[] names)
Return an Enumeration of all Headers except those that match the names given in the exclusion list. |
int |
getSize()
Return the size of this part, or -1 if the size cannot be reliably determined. |
boolean |
isMimeType(String mimeType)
Tests if the part is of the specified MIME type. |
void |
removeHeader(String name)
Remove all headers with the given name from the Part. |
void |
setContent(Multipart content)
|
void |
setContent(Object content,
String type)
Set a content object for this part. |
void |
setDataHandler(DataHandler handler)
Set a DataHandler for this part that defines the Part content. |
void |
setDescription(String description)
Set a descriptive string for this part. |
void |
setDisposition(String disposition)
Set the disposition for this Part. |
void |
setFileName(String name)
Set a descriptive file name for this part. |
void |
setHeader(String name,
String value)
Sets a value for the given header. |
void |
setText(String content)
Set the Part content as text. |
void |
writeTo(OutputStream out)
Write the Part content out to the provided OutputStream as a byte stream using an encoding appropriate to the Part content. |
Field Detail |
---|
static final String ATTACHMENT
static final String INLINE
Method Detail |
---|
void addHeader(String name, String value) throws MessagingException
name
- The name of the target header.value
- The value to be added to the header set.
MessagingException
Enumeration getAllHeaders() throws MessagingException
MessagingException
Object getContent() throws IOException, MessagingException
IOException
MessagingException
String getContentType() throws MessagingException
MessagingException
DataHandler getDataHandler() throws MessagingException
MessagingException
String getDescription() throws MessagingException
MessagingException
String getDisposition() throws MessagingException
MessagingException
String getFileName() throws MessagingException
MessagingException
String[] getHeader(String name) throws MessagingException
name
- The target header name.
MessagingException
InputStream getInputStream() throws IOException, MessagingException
IOException
MessagingException
int getLineCount() throws MessagingException
MessagingException
Enumeration getMatchingHeaders(String[] names) throws MessagingException
names
- An array of names of the desired headers.
MessagingException
Enumeration getNonMatchingHeaders(String[] names) throws MessagingException
names
- An array of String header names that will be excluded from the return
Enumeration set.
MessagingException
int getSize() throws MessagingException
MessagingException
boolean isMimeType(String mimeType) throws MessagingException
mimeType
- The target MIME type.
MessagingException
void removeHeader(String name) throws MessagingException
name
- The target header name used for removal.
MessagingException
void setContent(Multipart content) throws MessagingException
MessagingException
void setContent(Object content, String type) throws MessagingException
content
- The content object.type
- The MIME type for the inserted content Object.
MessagingException
void setDataHandler(DataHandler handler) throws MessagingException
handler
- The DataHandler instance.
MessagingException
void setDescription(String description) throws MessagingException
description
- The new description.
MessagingException
void setDisposition(String disposition) throws MessagingException
disposition
- The disposition string.
MessagingException
void setFileName(String name) throws MessagingException
name
- The new name value.
MessagingException
void setHeader(String name, String value) throws MessagingException
name
- The name of the target header.value
- The new value for the indicated header.
MessagingException
void setText(String content) throws MessagingException
content
- The new text content, as a String object.
MessagingException
void writeTo(OutputStream out) throws IOException, MessagingException
out
- The target OutputStream.
IOException
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |