|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

java.lang.Objectorg.xlightweb.Header
public class Header
Implementation base for a header
| Constructor Summary | |
|---|---|
Header()
constructor |
|
Header(String contentType)
constructor |
|
| Method Summary | |
|---|---|
void |
addHeader(String headername,
String headervalue)
Adds a header with the given name and value. |
void |
addHeaderLine(String line)
adds a header line |
void |
addHeaderlines(String... lines)
adds raw header lines |
protected Object |
clone()
|
boolean |
containsHeader(String headername)
Returns a boolean indicating whether the named header has already been set. |
List<ContentType> |
getAccept()
|
String |
getCharacterEncoding()
Returns the name of the character encoding used in the body of this message. |
String |
getContentType()
Returns the MIME type of the body of the messag, or null if the type is not known. |
String |
getDisposition()
returns the content disposition header of the part, or null if the type is not known. |
String |
getDispositionParam(String name)
returns the content disposition param value or null if not setsee also rfc2183 |
String |
getDispositionType()
returns the content disposition type or null if not setsee also rfc2183 |
String |
getHeader(String headername)
Returns the value of the specified header as a String. |
String |
getHeader(String headername,
String dflt)
Returns the value of the specified header as a String. |
List<String> |
getHeaderList(String headername)
Returns all the values of the specified header as an List of String objects. |
Enumeration |
getHeaderNames()
Returns an enumeration of all the header names. |
Set<String> |
getHeaderNameSet()
Returns an set of all the header names. |
Enumeration |
getHeaders(String headername)
Returns all the values of the specified header as an Enumeration of String objects. |
String |
getTransferEncoding()
returns the Transfer-Encoding header parameter or null if the header is not set |
void |
removeHeader(String headername)
removes a header with the given name |
void |
setContentType(String contentType)
sets the MIME type of the body of the part |
void |
setHeader(String headername,
String headervalue)
Sets a header with the given name and value. |
void |
setTransferEncoding(String transferEncoding)
sets the Transfer-Encoding parameter |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Header()
public Header(String contentType)
contentType - the contentType| Method Detail |
|---|
public final void addHeaderLine(String line)
addHeaderLine in interface IHeaderline - the header linepublic final void addHeaderlines(String... lines)
addHeaderlines in interface IHeaderlines - the headerlines
public final void setHeader(String headername,
String headervalue)
setHeader in interface IHeaderheadername - the name of the headerheadervalue - the header value If it contains octet string,
it should be encoded according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
public final void addHeader(String headername,
String headervalue)
addHeader in interface IHeaderheadername - the name of the headerheadervalue - the additional header value. If it contains octet string, it should be encoded
according to RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)public final void removeHeader(String headername)
removeHeader in interface IHeaderheadername - the name of the headerpublic boolean containsHeader(String headername)
containsHeader in interface IHeadertrue if the named header has already been set; false otherwisepublic Set<String> getHeaderNameSet()
getHeaderNameSet in interface IHeaderpublic final Enumeration getHeaderNames()
getHeaderNames in interface IHeaderpublic List<String> getHeaderList(String headername)
List of String objects.
Some headers, such as Accept-Language can be set
by part producer as several headers each with a different value rather than
sending the header as a comma separated list.
getHeaderList in interface IHeaderheadername - a String specifying the header name
List containing the values of the requested header.
If the part does not have any headers of that name return an empty enumeration.public final Enumeration getHeaders(String headername)
Enumeration of String objects.
Some headers, such as Accept-Language can be set
by part producer as several headers each with a different value rather than
sending the header as a comma separated list.
getHeaders in interface IHeaderheadername - a String specifying the header name
Enumeration containing the values of the requested header.
If the part does not have any headers of that name return an empty enumeration.public String getHeader(String headername)
String.
If the part did not include a header of the specified name,
this method returns null.
If there are multiple headers with the same name, this method
returns the first head in the part.
getHeader in interface IHeaderheadername - a String specifying the header name
String containing the value of the
requested header, or null if the part
does not have a header of that name
public String getHeader(String headername,
String dflt)
String.
If the part did not include a header of the specified name,
this method returns null.
If there are multiple headers with the same name, this method
returns the first head in the part.
getHeader in interface IHeaderheadername - a String specifying the header namedflt - the default value if the header is not set
String containing the value of the
requested header, or null if the part
does not have a header of that namepublic final void setContentType(String contentType)
setContentType in interface IHeadercontentType - the MIME type of the body of the partpublic final String getCharacterEncoding()
getCharacterEncoding in interface IHeaderString containing the name of the character encodingpublic final String getContentType()
null if the type is not known.
getContentType in interface IHeaderString containing the name of the MIME type of
the message, or null if the type is not knownpublic final List<ContentType> getAccept()
public final String getDisposition()
null if the type is not known.
getDisposition in interface IHeaderString containing the name of the content disposition of
the part, or null if the type is not knownpublic final String getDispositionType()
null if not set
getDispositionType in interface IHeadernull if not setpublic final String getDispositionParam(String name)
null if not set
getDispositionParam in interface IHeadername - the parameter name
null if not setpublic final String getTransferEncoding()
null if the header is not set
getTransferEncoding in interface IHeadernull if the header is not setpublic final void setTransferEncoding(String transferEncoding)
setTransferEncoding in interface IHeadertransferEncoding - the Transfer-Encoding parameter
protected Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||