public interface MimePart
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.
MimeUtility,
Part| Field Summary |
|---|
| Fields inherited from interface javax.mail.Part |
|---|
ATTACHMENT, INLINE |
| Method Summary | |
|---|---|
void |
addHeaderLine(String line)
Add a raw RFC822 header-line. |
Enumeration |
getAllHeaderLines()
Get all header lines as an Enumeration of Strings. |
String |
getContentID()
Get the Content-ID of this part. |
String[] |
getContentLanguage()
Get the language tags specified in the Content-Language header of this MimePart. |
String |
getContentMD5()
Get the Content-MD5 digest of this part. |
String |
getEncoding()
Get the transfer encoding of this part. |
String |
getHeader(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. |
Enumeration |
getMatchingHeaderLines(String[] names)
Get matching header lines as an Enumeration of Strings. |
Enumeration |
getNonMatchingHeaderLines(String[] names)
Get non-matching header lines as an Enumeration of Strings. |
void |
setContentLanguage(String[] languages)
Set the Content-Language header of this MimePart. |
void |
setContentMD5(String md5)
Set the Content-MD5 of this part. |
void |
setText(String text)
Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". |
void |
setText(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. |
void |
setText(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. |
| Methods inherited from interface javax.mail.Part |
|---|
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader, writeTo |
| Method Detail |
|---|
String getHeader(String name, String delimiter) throws MessagingException
null, only the
first value is returned.
name - the name of this headerdelimiter - delimiter between fields in returned string
MessagingExceptionvoid addHeaderLine(String line) throws MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
IllegalStateException - if this Part is
obtained from a READ_ONLY folder
MessagingExceptionEnumeration getAllHeaderLines() throws MessagingException
MessagingExceptionEnumeration getMatchingHeaderLines(String[] names) throws MessagingException
MessagingExceptionEnumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
MessagingExceptionString getEncoding() throws MessagingException
MessagingExceptionString getContentID() throws MessagingException
MessagingExceptionString getContentMD5() throws MessagingException
MessagingExceptionvoid setContentMD5(String md5) throws MessagingException
md5 - the MD5 value
IllegalWriteException - if the underlying
implementation does not support modification
IllegalStateException - if this Part is
obtained from a READ_ONLY folder
MessagingExceptionString[] getContentLanguage() throws MessagingException
null if this header is not
available.
MessagingExceptionvoid setContentLanguage(String[] languages) throws MessagingException
languages - array of language tags
IllegalWriteException - if the underlying
implementation does not support modification
IllegalStateException - if this Part is
obtained from a READ_ONLY folder
MessagingExceptionvoid setText(String text) throws MessagingException
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.
text - the text content to set
MessagingException - if an error occurssetText(String text, String charset)void setText(String text, String charset) throws MessagingException
text - the text content to setcharset - the charset to use for the text
MessagingException - if an error occursvoid setText(String text, String charset, String subtype) throws MessagingException
text - the text content to setcharset - the charset to use for the textsubtype - the MIME subtype to use (e.g., "html")
MessagingException - if an error occursCes informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)