|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.netseeker.ejoe.http.HttpRequest
public class HttpRequest
A simple container encapsulating a HTTP header. Additional methods are provided to convert such a header into ByteBuffer and/or String representations
Field Summary | |
---|---|
protected ConnectionHeader |
_header
|
protected ByteBufferOutputStream |
_out
|
protected static java.lang.String |
CHARSET
|
static java.lang.String |
HTTP_GET
|
static java.lang.String |
HTTP_HEAD
|
static java.lang.String |
HTTP_POST
|
protected static java.lang.String |
LINE_SEP
|
Constructor Summary | |
---|---|
HttpRequest(ConnectionHeader header,
java.lang.String method)
Creates a new HTTP request using the given connection header and the given HTTP method (HEAD, POST). |
|
HttpRequest(ConnectionHeader header,
java.lang.String contentType,
java.lang.String method)
Creates a new HTTP request using the given connection header, the given HTTP method (HEAD, POST) and the given content (mime) type. |
|
HttpRequest(ConnectionHeader header,
java.lang.String host,
java.lang.String contentType,
java.lang.String method)
Creates a new HTTP request using the given connection header, the given host name, the given content (mime) type and the given HTTP method (HEAD, POST). |
Method Summary | |
---|---|
void |
addData(byte data)
|
void |
addData(byte[] data)
|
void |
addData(java.nio.ByteBuffer data)
|
void |
addData(int data)
|
void |
addData(java.lang.String data)
|
java.lang.String |
getContentType()
|
java.lang.String |
getHost()
|
java.lang.String |
getMethod()
|
ByteBufferOutputStream |
getOutputStream()
|
void |
reset()
Resets all data appended to this request |
java.nio.ByteBuffer |
toByteBuffer()
Transforms this HTTP request into a ByteBuffer |
protected java.lang.String |
toHeaderString()
Transforms only the contained HTTP header into a string representation |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HTTP_GET
public static final java.lang.String HTTP_POST
public static final java.lang.String HTTP_HEAD
protected static final java.lang.String CHARSET
protected static final java.lang.String LINE_SEP
protected ByteBufferOutputStream _out
protected ConnectionHeader _header
Constructor Detail |
---|
public HttpRequest(ConnectionHeader header, java.lang.String method)
header
- a valid connection headermethod
- a valid HTTP method stringpublic HttpRequest(ConnectionHeader header, java.lang.String contentType, java.lang.String method)
header
- a valid connection headercontentType
- a valid mime type stringmethod
- a valid HTTP method stringpublic HttpRequest(ConnectionHeader header, java.lang.String host, java.lang.String contentType, java.lang.String method)
header
- a valid connection headerhost
- name of the target HOSTcontentType
- a valid mime type stringmethod
- a valid HTTP method stringMethod Detail |
---|
public java.lang.String getContentType()
public java.lang.String getHost()
public java.lang.String getMethod()
public void addData(byte data)
data
- public void addData(int data)
data
- public void addData(byte[] data)
data
- public void addData(java.lang.String data)
data
- public void addData(java.nio.ByteBuffer data)
data
- public java.nio.ByteBuffer toByteBuffer()
protected java.lang.String toHeaderString()
public java.lang.String toString()
toString
in class java.lang.Object
public void reset()
public final ByteBufferOutputStream getOutputStream()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |