Method Summary |
|
public void | addHeader(String header_name, String header_value) Add this value to the existing values for this header_name. |
public Enumeration | getAllHeaders() Return all the headers from this part as an Enumeration of
Header objects. |
public Object | getContent() Return the content as a Java object. |
public String | getContentType() Returns the Content-Type of the content of this part.
Returns null if the Content-Type could not be determined. |
public DataHandler | getDataHandler() Return a DataHandler for the content within this part. |
public String | getDescription() Return a description String for this part. |
public String | getDisposition() Return the disposition of this part. |
public String | getFileName() Get the filename associated with this part, if possible.
Useful if this part represents an "attachment" that was
loaded from a file. |
public String[] | getHeader(String header_name) Get all the headers for this header name. |
public InputStream | getInputStream() Return an input stream for this part's "content". |
public int | getLineCount() Return the number of lines in the content of this part. |
public Enumeration | getMatchingHeaders(String[] header_names) Return matching headers from this part as an Enumeration of
Header objects. |
public Enumeration | getNonMatchingHeaders(String[] header_names) Return non-matching headers from this envelope as an Enumeration
of Header objects. |
public int | getSize() Return the size of the content of this part in bytes.
Return -1 if the size cannot be determined. |
public boolean | isMimeType(String mimeType) Is this Part of the specified MIME type? This method
compares only the primaryType and
subType .
The parameters of the content types are ignored. |
public void | removeHeader(String header_name) Remove all headers with this name. |
public void | setContent(Object obj, String type) A convenience method for setting this part's content. |
public void | setContent(Multipart mp) This method sets the given Multipart object as this message's
content. |
public void | setDataHandler(DataHandler dh) This method provides the mechanism to set this part's content. |
public void | setDescription(String description) Set a description String for this part. |
public void | setDisposition(String disposition) Set the disposition of this part. |
public void | setFileName(String filename) Set the filename associated with this part, if possible.
Useful if this part represents an "attachment" that was
loaded from a file. |
public void | setHeader(String header_name, String header_value) Set the value for this header_name. |
public void | setText(String text) A convenience method that sets the given String as this
part's content with a MIME type of "text/plain". |
public void | writeTo(OutputStream os) Output a bytestream for this Part. |