public class Headers extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Headers.Entry
A header entry.
|
Constructor and Description |
---|
Headers() |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
int value)
Add a header.
|
void |
addHeader(String name,
long value)
Add a header.
|
void |
addHeader(String name,
String value)
Add a header.
|
long |
getDateHeader(String name)
Return the first header matching a given name.
|
Headers.Entry[] |
getEntries()
Return all entries.
|
String |
getHeader(String name)
Return the first header matching a given name.
|
String[] |
getHeaders(String name)
Return all headers matching a given name.
|
int |
getIntHeader(String name)
Return the first header matching a given name.
|
void |
load(InputStream in)
Load stored headers from an input stream.
|
void |
save(OutputStream out)
Store headers to an output stream.
|
void |
setHeader(String name,
int value)
Set a header.
|
void |
setHeader(String name,
long value)
Set a header.
|
void |
setHeader(String name,
String value)
Set a header.
|
String |
toString() |
public String getHeader(String name)
name
- namenull
public String[] getHeaders(String name)
name
- namenull
public long getDateHeader(String name)
name
- name-1
public int getIntHeader(String name)
name
- name0
public void setHeader(String name, String value)
name
- namevalue
- value, if null
remove an existing headerpublic void setHeader(String name, long value)
name
- namevalue
- valuepublic void setHeader(String name, int value)
name
- namevalue
- valuepublic void addHeader(String name, String value)
name
- namevalue
- valuepublic void addHeader(String name, long value)
name
- namevalue
- valuepublic void addHeader(String name, int value)
name
- namevalue
- valuepublic Headers.Entry[] getEntries()
public void save(OutputStream out) throws IOException
out
- output streamIOException
- if an I/O error occurspublic void load(InputStream in) throws IOException
in
- input streamIOException
- if an I/O error occursCopyright © 2010 - 2020 Adobe. All Rights Reserved