Java Doc for MimePart.java in  » EJB-Server-GlassFish » mail » javax » mail » internet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server GlassFish » mail » javax.mail.internet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.mail.internet.MimePart

All known Subclasses:   javax.mail.internet.MimeMessage,  javax.mail.internet.MimeBodyPart,
MimePart
public interface MimePart extends Part(Code)
The MimePart interface models an Entity as defined by MIME (RFC2045, Section 2.4).

MimePart extends the Part interface to add additional RFC822 and MIME specific semantics and attributes. It provides the base interface for the MimeMessage and MimeBodyPart classes


A note on RFC822 and MIME headers

RFC822 and MIME header fields must contain only US-ASCII characters. If a header contains non US-ASCII characters, it must be encoded as per the rules in RFC 2047. The MimeUtility class provided in this package can be used to to achieve this. Callers of the setHeader, addHeader, and addHeaderLine methods are responsible for enforcing the MIME requirements for the specified headers. In addition, these header fields must be folded (wrapped) before being sent if they exceed the line length limitation for the transport (1000 bytes for SMTP). Received headers may have been folded. The application is responsible for folding and unfolding headers as appropriate.


See Also:   MimeUtility
See Also:   javax.mail.Part
author:
   John Mani





Method Summary
public  voidaddHeaderLine(String line)
     Add a raw RFC822 header-line.
public  EnumerationgetAllHeaderLines()
     Get all header lines as an Enumeration of Strings.
public  StringgetContentID()
     Get the Content-ID of this part.
public  String[]getContentLanguage()
     Get the language tags specified in the Content-Language header of this MimePart.
public  StringgetContentMD5()
     Get the Content-MD5 digest of this part.
public  StringgetEncoding()
     Get the transfer encoding of this part.
public  StringgetHeader(String name, String delimiter)
     Get the values of all header fields available for this header, returned as a single String, with the values separated by the delimiter.
public  EnumerationgetMatchingHeaderLines(String[] names)
     Get matching header lines as an Enumeration of Strings.
public  EnumerationgetNonMatchingHeaderLines(String[] names)
     Get non-matching header lines as an Enumeration of Strings.
public  voidsetContentLanguage(String[] languages)
     Set the Content-Language header of this MimePart.
public  voidsetContentMD5(String md5)
     Set the Content-MD5 of this part.
public  voidsetText(String text)
     Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".
public  voidsetText(String text, String charset)
     Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.
public  voidsetText(String text, String charset, String subtype)
     Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.



Method Detail
addHeaderLine
public void addHeaderLine(String line) throws MessagingException(Code)
Add a raw RFC822 header-line.
exception:
  IllegalWriteException - if the underlyingimplementation does not support modification
exception:
  IllegalStateException - if this Part isobtained from a READ_ONLY folder



getAllHeaderLines
public Enumeration getAllHeaderLines() throws MessagingException(Code)
Get all header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.



getContentID
public String getContentID() throws MessagingException(Code)
Get the Content-ID of this part. Returns null if none present. content-ID



getContentLanguage
public String[] getContentLanguage() throws MessagingException(Code)
Get the language tags specified in the Content-Language header of this MimePart. The Content-Language header is defined by RFC 1766. Returns null if this header is not available.



getContentMD5
public String getContentMD5() throws MessagingException(Code)
Get the Content-MD5 digest of this part. Returns null if none present. content-MD5



getEncoding
public String getEncoding() throws MessagingException(Code)
Get the transfer encoding of this part. content-transfer-encoding
exception:
  MessagingException -



getHeader
public String getHeader(String name, String delimiter) throws MessagingException(Code)
Get the values of all header fields available for this header, returned as a single String, with the values separated by the delimiter. If the delimiter is null, only the first value is returned.
Parameters:
  name - the name of this header
Parameters:
  delimiter - delimiter between fields in returned string the value fields for all headers with this name
exception:
  MessagingException -



getMatchingHeaderLines
public Enumeration getMatchingHeaderLines(String[] names) throws MessagingException(Code)
Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.



getNonMatchingHeaderLines
public Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException(Code)
Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.



setContentLanguage
public void setContentLanguage(String[] languages) throws MessagingException(Code)
Set the Content-Language header of this MimePart. The Content-Language header is defined by RFC1766.
Parameters:
  languages - array of language tags
exception:
  IllegalWriteException - if the underlyingimplementation does not support modification
exception:
  IllegalStateException - if this Part isobtained from a READ_ONLY folder



setContentMD5
public void setContentMD5(String md5) throws MessagingException(Code)
Set the Content-MD5 of this part.
Parameters:
  md5 - the MD5 value
exception:
  IllegalWriteException - if the underlyingimplementation does not support modification
exception:
  IllegalStateException - if this Part isobtained from a READ_ONLY folder



setText
public void setText(String text) throws MessagingException(Code)
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". If the string contains non US-ASCII characters. it will be encoded using the platform's default charset. The charset is also used to set the "charset" parameter.

Note that there may be a performance penalty if text is large, since this method may have to scan all the characters to determine what charset to use.

If the charset is already known, use the setText method that takes the charset parameter.
Parameters:
  text - the text content to set
exception:
  MessagingException - if an error occurs
See Also:   MimePart.setText(String text,String charset)




setText
public void setText(String text, String charset) throws MessagingException(Code)
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set "charset" parameter.
Parameters:
  text - the text content to set
Parameters:
  charset - the charset to use for the text
exception:
  MessagingException - if an error occurs



setText
public void setText(String text, String charset, String subtype) throws MessagingException(Code)
Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.
Parameters:
  text - the text content to set
Parameters:
  charset - the charset to use for the text
Parameters:
  subtype - the MIME subtype to use (e.g., "html")
exception:
  MessagingException - if an error occurs
since:
   JavaMail 1.4



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.