public class InternetHeaders
extends java.lang.Object
Constructor and Description |
---|
InternetHeaders()
Create an empty InternetHeaders
|
InternetHeaders(java.io.InputStream in)
Create a new InternetHeaders initialized by reading headers from the
stream.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Add a new value to the header with the supplied name.
|
void |
addHeaderLine(java.lang.String line)
Add an RFC822 header line to the header store.
|
java.util.Enumeration |
getAllHeaderLines()
Return all the header lines as an Enumeration of Strings.
|
java.util.Enumeration |
getAllHeaders()
Return all headers.
|
java.lang.String[] |
getHeader(java.lang.String name)
Return all the values for the specified header.
|
java.lang.String |
getHeader(java.lang.String name,
java.lang.String delimiter)
Return the values for the specified header as a single String.
|
java.util.Enumeration |
getMatchingHeaderLines(java.lang.String[] names)
Return all matching header lines as an Enumeration of Strings.
|
java.util.Enumeration |
getMatchingHeaders(java.lang.String[] names)
Return all matching Header objects.
|
java.util.Enumeration |
getNonMatchingHeaderLines(java.lang.String[] names)
Return all non-matching header lines.
|
java.util.Enumeration |
getNonMatchingHeaders(java.lang.String[] names)
Return all non matching Header objects.
|
void |
load(java.io.InputStream in)
Read and parse the supplied stream and add all headers to the current
set.
|
void |
removeHeader(java.lang.String name)
Remove all header entries with the supplied name
|
void |
setHeader(java.lang.String name,
java.lang.String value)
Set the value of the header to the supplied value; any existing headers
are removed.
|
public InternetHeaders()
public InternetHeaders(java.io.InputStream in) throws MessagingException
in
- the RFC822 input stream to load fromMessagingException
- if there is a problem pasring the streampublic void load(java.io.InputStream in) throws MessagingException
in
- the RFC822 input stream to load fromMessagingException
- if there is a problem pasring the streampublic java.lang.String[] getHeader(java.lang.String name)
name
- the header to returnpublic java.lang.String getHeader(java.lang.String name, java.lang.String delimiter)
name
- the header to returndelimiter
- the delimiter used in concatenationpublic void setHeader(java.lang.String name, java.lang.String value)
name
- the name of the headervalue
- the new valuepublic void addHeader(java.lang.String name, java.lang.String value)
name
- the name of the header to add a new value forvalue
- another valuepublic void removeHeader(java.lang.String name)
name
- the header to removepublic java.util.Enumeration getAllHeaders()
public java.util.Enumeration getMatchingHeaders(java.lang.String[] names)
public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names)
public void addHeaderLine(java.lang.String line)
line
- raw RFC822 header linepublic java.util.Enumeration getAllHeaderLines()
public java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names)
public java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names)