public class Headers
extends java.lang.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(java.lang.String name,
int value)
Add a header.
|
void |
addHeader(java.lang.String name,
long value)
Add a header.
|
void |
addHeader(java.lang.String name,
java.lang.String value)
Add a header.
|
long |
getDateHeader(java.lang.String name)
Return the first header matching a given name.
|
Headers.Entry[] |
getEntries()
Return all entries.
|
java.lang.String |
getHeader(java.lang.String name)
Return the first header matching a given name.
|
java.lang.String[] |
getHeaders(java.lang.String name)
Return all headers matching a given name.
|
int |
getIntHeader(java.lang.String name)
Return the first header matching a given name.
|
void |
load(java.io.InputStream in)
Load stored headers from an input stream.
|
void |
save(java.io.OutputStream out)
Store headers to an output stream.
|
void |
setHeader(java.lang.String name,
int value)
Set a header.
|
void |
setHeader(java.lang.String name,
long value)
Set a header.
|
void |
setHeader(java.lang.String name,
java.lang.String value)
Set a header.
|
java.lang.String |
toString() |
public java.lang.String getHeader(java.lang.String name)
name
- namenull
public java.lang.String[] getHeaders(java.lang.String name)
name
- namenull
public long getDateHeader(java.lang.String name)
name
- name-1
public int getIntHeader(java.lang.String name)
name
- name0
public void setHeader(java.lang.String name, java.lang.String value)
name
- namevalue
- value, if null
remove an existing headerpublic void setHeader(java.lang.String name, long value)
name
- namevalue
- valuepublic void setHeader(java.lang.String name, int value)
name
- namevalue
- valuepublic void addHeader(java.lang.String name, java.lang.String value)
name
- namevalue
- valuepublic void addHeader(java.lang.String name, long value)
name
- namevalue
- valuepublic void addHeader(java.lang.String name, int value)
name
- namevalue
- valuepublic Headers.Entry[] getEntries()
public void save(java.io.OutputStream out) throws java.io.IOException
out
- output streamjava.io.IOException
- if an I/O error occurspublic void load(java.io.InputStream in) throws java.io.IOException
in
- input streamjava.io.IOException
- if an I/O error occurspublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved