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