public class MailHeaders extends javax.mail.internet.InternetHeaders implements Serializable, Cloneable
name: value
| Constructor and Description |
|---|
MailHeaders()
No argument constructor
|
MailHeaders(InputStream in)
Constructor that takes an InputStream containing the contents of the set
of mail headers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String arg0,
String arg1)
If the new header is a Return-Path we get sure that we add it to the top
Javamail, at least until 1.4.0 does the wrong thing if it loaded a stream
with a return-path in the middle.
|
void |
addHeaderLine(String line) |
long |
getSize()
Return the size of the headers
|
boolean |
isSet(String name)
Check if a particular header is present.
|
boolean |
isValid()
Check if all REQUIRED headers fields as specified in RFC 822 are present.
|
void |
removeHeader(String name) |
void |
setHeader(String arg0,
String arg1)
If the new header is a Return-Path we get sure that we add it to the top
Javamail, at least until 1.4.0 does the wrong thing if it loaded a stream
with a return-path in the middle.
|
byte[] |
toByteArray()
Generate a representation of the headers as a series of bytes.
|
void |
writeTo(OutputStream out)
Write the headers to an output stream
|
public MailHeaders()
throws javax.mail.MessagingException
javax.mail.MessagingException - if the super class cannot be properly instantiatedpublic MailHeaders(InputStream in) throws javax.mail.MessagingException
in - the InputStream containing the header datajavax.mail.MessagingException - if the super class cannot be properly instantiated based on
the streampublic void writeTo(OutputStream out) throws javax.mail.MessagingException
out - the OutputStream to which to write the headersjavax.mail.MessagingExceptionpublic byte[] toByteArray()
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic boolean isSet(String name)
public void addHeader(String arg0, String arg1)
addHeader in class javax.mail.internet.InternetHeadersInternetHeaders.addHeader(java.lang.String,
java.lang.String)public void setHeader(String arg0, String arg1)
setHeader in class javax.mail.internet.InternetHeadersInternetHeaders.setHeader(java.lang.String,
java.lang.String)public void removeHeader(String name)
removeHeader in class javax.mail.internet.InternetHeaderspublic void addHeaderLine(String line)
addHeaderLine in class javax.mail.internet.InternetHeaderspublic boolean isValid()
public long getSize()
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.