|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.mail.BodyPart
javax.mail.internet.MimeBodyPart
com.sun.mail.imap.IMAPBodyPart
public class IMAPBodyPart
This class
| 字段摘要 |
|---|
| 从类 javax.mail.internet.MimeBodyPart 继承的字段 |
|---|
content, contentStream, dh, headers |
| 从类 javax.mail.BodyPart 继承的字段 |
|---|
parent |
| 从接口 javax.mail.Part 继承的字段 |
|---|
ATTACHMENT, INLINE |
| 构造方法摘要 | |
|---|---|
protected |
IMAPBodyPart(BODYSTRUCTURE bs,
String sid,
IMAPMessage message)
|
| 方法摘要 | |
|---|---|
void |
addHeader(String name,
String value)
Add this value to the existing values for this header_name. |
void |
addHeaderLine(String line)
Add a header line to this body part |
Enumeration |
getAllHeaderLines()
Get all header lines as an Enumeration of Strings. |
Enumeration |
getAllHeaders()
Return all the headers from this Message as an Enumeration of Header objects. |
String |
getContentID()
Returns the value of the "Content-ID" header field. |
String |
getContentMD5()
Return the value of the "Content-MD5" header field. |
protected InputStream |
getContentStream()
Produce the raw bytes of the content. |
String |
getContentType()
Returns the value of the RFC 822 "Content-Type" header field. |
DataHandler |
getDataHandler()
Return a DataHandler for this body part's content. |
String |
getDescription()
Returns the "Content-Description" header field of this body part. |
String |
getDisposition()
Returns the value of the "Content-Disposition" header field. |
String |
getEncoding()
Returns the content transfer encoding from the "Content-Transfer-Encoding" header field. |
String |
getFileName()
Get the filename associated with this body part. |
String[] |
getHeader(String name)
Get all the headers for this header_name. |
int |
getLineCount()
Return the number of lines for the content of this Part. |
Enumeration |
getMatchingHeaderLines(String[] names)
Get matching header lines as an Enumeration of Strings. |
Enumeration |
getMatchingHeaders(String[] names)
Return matching headers from this Message as an Enumeration of Header objects. |
Enumeration |
getNonMatchingHeaderLines(String[] names)
Get non-matching header lines as an Enumeration of Strings. |
Enumeration |
getNonMatchingHeaders(String[] names)
Return non-matching headers from this Message as an Enumeration of Header objects. |
int |
getSize()
Return the size of the content of this body part in bytes. |
void |
removeHeader(String name)
Remove all headers with this name. |
void |
setContent(Multipart mp)
This method sets the body part's content to a Multipart object. |
void |
setContent(Object o,
String type)
A convenience method for setting this body part's content. |
void |
setContentMD5(String md5)
Set the "Content-MD5" header field of this body part. |
void |
setDataHandler(DataHandler content)
This method provides the mechanism to set this body part's content. |
void |
setDescription(String description,
String charset)
Set the "Content-Description" header field for this body part. |
void |
setDisposition(String disposition)
Set the "Content-Disposition" header field of this body part. |
void |
setFileName(String filename)
Set the filename associated with this body part, if possible. |
void |
setHeader(String name,
String value)
Set the value for this header_name. |
protected void |
updateHeaders()
Examine the content of this body part and update the appropriate MIME headers. |
| 从类 javax.mail.internet.MimeBodyPart 继承的方法 |
|---|
attachFile, attachFile, getContent, getContentLanguage, getHeader, getInputStream, getRawInputStream, isMimeType, saveFile, saveFile, setContentID, setContentLanguage, setDescription, setText, setText, setText, writeTo |
| 从类 javax.mail.BodyPart 继承的方法 |
|---|
getParent |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
protected IMAPBodyPart(BODYSTRUCTURE bs,
String sid,
IMAPMessage message)
| 方法详细信息 |
|---|
protected void updateHeaders()
MimeBodyPart 复制的描述Content-Type and Content-Transfer-Encoding.
Headers might need to be updated in two cases:
Message.saveChanges method.
MimeBodyPart 中的 updateHeaders
public int getSize()
throws MessagingException
MimeBodyPart 复制的描述Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.
This implementation returns the size of the content
array (if not null), or, if contentStream is not
null, and the available method returns a positive
number, it returns that number as the size. Otherwise, it returns
-1.
Part 中的 getSizeMimeBodyPart 中的 getSizeMessagingException
public int getLineCount()
throws MessagingException
MimeBodyPart 复制的描述Note that this number may not be an exact measure of the content length and may or may not account for any transfer encoding of the content.
This implementation returns -1.
Part 中的 getLineCountMimeBodyPart 中的 getLineCountMessagingException
public String getContentType()
throws MessagingException
MimeBodyPart 复制的描述
This implementation uses getHeader(name)
to obtain the requisite header field.
Part 中的 getContentTypeMimeBodyPart 中的 getContentTypeMessagingExceptionDataHandler
public String getDisposition()
throws MessagingException
MimeBodyPart 复制的描述If the Content-Disposition field is unavailable, null is returned.
This implementation uses getHeader(name)
to obtain the requisite header field.
Part 中的 getDispositionMimeBodyPart 中的 getDispositionMessagingExceptionMimeBodyPart.headers
public void setDisposition(String disposition)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 setDispositionMimeBodyPart 中的 setDispositiondisposition - disposition of this part
MessagingException
IllegalWriteException - if the underlying implementation
does not support modification of this headerPart.ATTACHMENT,
Part.INLINE,
Part.setFileName(java.lang.String)
public String getEncoding()
throws MessagingException
MimeBodyPart 复制的描述null if the header is unavailable
or its value is absent.
This implementation uses getHeader(name)
to obtain the requisite header field.
MimePart 中的 getEncodingMimeBodyPart 中的 getEncodingMessagingExceptionMimeBodyPart.headers
public String getContentID()
throws MessagingException
MimeBodyPart 复制的描述null if the field is unavailable or its value is
absent.
This implementation uses getHeader(name)
to obtain the requisite header field.
MimePart 中的 getContentIDMimeBodyPart 中的 getContentIDMessagingException
public String getContentMD5()
throws MessagingException
MimeBodyPart 复制的描述null if this field is unavailable or its value
is absent.
This implementation uses getHeader(name)
to obtain the requisite header field.
MimePart 中的 getContentMD5MimeBodyPart 中的 getContentMD5MessagingException
public void setContentMD5(String md5)
throws MessagingException
MimeBodyPart 复制的描述
MimePart 中的 setContentMD5MimeBodyPart 中的 setContentMD5md5 - the MD5 value
IllegalWriteException - if the underlying
implementation does not support modification
MessagingException
public String getDescription()
throws MessagingException
MimeBodyPart 复制的描述If the Content-Description field is encoded as per RFC 2047, it is decoded and converted into Unicode. If the decoding or conversion fails, the raw data is returned as is.
This implementation uses getHeader(name)
to obtain the requisite header field.
Part 中的 getDescriptionMimeBodyPart 中的 getDescriptionMessagingException
public void setDescription(String description,
String charset)
throws MessagingException
MimeBodyPart 复制的描述null, then any
existing "Content-Description" fields are removed. If the description contains non US-ASCII characters, it will be encoded using the specified charset. If the description contains only US-ASCII characters, no encoding is done and it is used as is.
Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.
MimeBodyPart 中的 setDescriptiondescription - Descriptioncharset - Charset for encoding
IllegalWriteException - if the underlying
implementation does not support modification
MessagingException - otherwise; an
UnsupportedEncodingException may be included
in the exception chain if the charset
conversion fails.
public String getFileName()
throws MessagingException
MimeBodyPart 复制的描述
Returns the value of the "filename" parameter from the
"Content-Disposition" header field of this body part. If its
not available, returns the value of the "name" parameter from
the "Content-Type" header field of this body part.
Returns null if both are absent.
If the mail.mime.encodefilename System property
is set to true, the MimeUtility.decodeText method will be used to decode the
filename. While such encoding is not supported by the MIME
spec, many mailers use this technique to support non-ASCII
characters in filenames. The default value of this property
is false.
Part 中的 getFileNameMimeBodyPart 中的 getFileNameMessagingException
public void setFileName(String filename)
throws MessagingException
MimeBodyPart 复制的描述Sets the "filename" parameter of the "Content-Disposition" header field of this body part. For compatibility with older mailers, the "name" parameter of the "Content-Type" header is also set.
If the mail.mime.encodefilename System property
is set to true, the MimeUtility.encodeText method will be used to encode the
filename. While such encoding is not supported by the MIME
spec, many mailers use this technique to support non-ASCII
characters in filenames. The default value of this property
is false.
Part 中的 setFileNameMimeBodyPart 中的 setFileNamefilename - Filename to associate with this part
IllegalWriteException - if the underlying implementation
does not support modification of this header
MessagingException
protected InputStream getContentStream()
throws MessagingException
MimeBodyPart 复制的描述
MimeBodyPart 中的 getContentStreamMessagingExceptionMimeBodyPart.content,
MimeMessage.getContentStream()
public DataHandler getDataHandler()
throws MessagingException
MimeBodyPart 复制的描述The implementation provided here works just like the the implementation in MimeMessage.
Part 中的 getDataHandlerMimeBodyPart 中的 getDataHandlerMessagingExceptionMimeMessage.getDataHandler()
public void setDataHandler(DataHandler content)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 setDataHandlerMimeBodyPart 中的 setDataHandlercontent - The DataHandler for the content
MessagingException
IllegalWriteException - if the underlying implementation
does not support modification of existing values
public void setContent(Object o,
String type)
throws MessagingException
MimeBodyPart 复制的描述
The content is wrapped in a DataHandler object. Note that a
DataContentHandler class for the specified type should be
available to the JavaMail implementation for this to work right.
That is, to do setContent(foobar, "application/x-foobar"),
a DataContentHandler for "application/x-foobar" should be installed.
Refer to the Java Activation Framework for more information.
Part 中的 setContentMimeBodyPart 中的 setContento - the content objecttype - Mime type of the object
IllegalWriteException - if the underlying implementation
does not support modification of existing values
MessagingException
public void setContent(Multipart mp)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 setContentMimeBodyPart 中的 setContentmp - The multipart object that is the Message's content
IllegalWriteException - if the underlying
implementation does not support modification of
existing values
MessagingException
public String[] getHeader(String name)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 getHeaderMimeBodyPart 中的 getHeadername - name of header
MessagingExceptionMimeUtility
public void setHeader(String name,
String value)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 setHeaderMimeBodyPart 中的 setHeadername - header namevalue - header value
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing valuesMimeUtility
public void addHeader(String name,
String value)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 addHeaderMimeBodyPart 中的 addHeadername - header namevalue - header value
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing valuesMimeUtility
public void removeHeader(String name)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 removeHeaderMimeBodyPart 中的 removeHeadername - the name of this header
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
public Enumeration getAllHeaders()
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 getAllHeadersMimeBodyPart 中的 getAllHeadersMessagingException
public Enumeration getMatchingHeaders(String[] names)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 getMatchingHeadersMimeBodyPart 中的 getMatchingHeadersMessagingException
public Enumeration getNonMatchingHeaders(String[] names)
throws MessagingException
MimeBodyPart 复制的描述
Part 中的 getNonMatchingHeadersMimeBodyPart 中的 getNonMatchingHeadersMessagingException
public void addHeaderLine(String line)
throws MessagingException
MimeBodyPart 复制的描述
MimePart 中的 addHeaderLineMimeBodyPart 中的 addHeaderLineIllegalWriteException - if the underlying
implementation does not support modification
MessagingException
public Enumeration getAllHeaderLines()
throws MessagingException
MimeBodyPart 复制的描述
MimePart 中的 getAllHeaderLinesMimeBodyPart 中的 getAllHeaderLinesMessagingException
public Enumeration getMatchingHeaderLines(String[] names)
throws MessagingException
MimeBodyPart 复制的描述
MimePart 中的 getMatchingHeaderLinesMimeBodyPart 中的 getMatchingHeaderLinesMessagingException
public Enumeration getNonMatchingHeaderLines(String[] names)
throws MessagingException
MimeBodyPart 复制的描述
MimePart 中的 getNonMatchingHeaderLinesMimeBodyPart 中的 getNonMatchingHeaderLinesMessagingException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||