|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.utils.webdav.HTTPMessage
public abstract class HTTPMessage
The HTTPMessage abstract class is the super class for creating implementations of HTTP methods. It provides all the necessary methods to send a request message, receive the response message and extract the entity body for manipulation as the developer sees fit. It contains various public static Strings which are useful in other classes. It uses the WebDAVSocket interface to communicate with the server, the actual implementation of the Socket does not matter to this class i.e. it does not care whether the line of communication is secure or not, that is for the developer to decide.
Field Summary | |
---|---|
static java.lang.String |
CRLF
|
static java.lang.String |
EMPTY
|
static java.lang.String |
FS
|
protected java.lang.String |
host
|
static java.lang.String |
HTTPVersion
|
static java.lang.String |
LF
|
protected java.lang.String |
method
|
static java.lang.String |
padSP
|
protected int |
port
|
protected WebDAVSocket |
socket
|
static java.lang.String |
SP
|
protected java.lang.String |
URI
|
Constructor Summary | |
---|---|
HTTPMessage(WebDAVSocket socket,
java.lang.String host,
int port,
java.lang.String method,
java.lang.String URI)
The constructor for the HTTPMessage common to all HTTP methods. |
Method Summary | |
---|---|
protected java.lang.String |
getRequestMessage()
|
protected byte[] |
getRequestMessageByte()
|
java.lang.String |
getResponseCode()
This method returns the status code in the response message. |
int |
getResponseContentLength()
This method returns the value in the Content Length HTTP header in the response message. |
java.lang.String |
getResponseEntity()
|
byte[] |
getResponseEntityByte()
|
protected java.lang.String |
getResponseMessage()
|
protected byte[] |
getResponseMessageByte()
|
java.lang.String |
getResponseParagraph()
This message returns the String in between the HTML p tag in a server response. |
java.lang.String |
getResponseTitle()
This message returns the String in between the HTML title tag in a server response. |
boolean |
isResponseSuccessful()
This method tells you whether the response message has a status code within the 2xx successful range. |
void |
transceive()
Once you have created an instance of a class which extends this class, use this method to send the client request and receive the response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FS
public static final java.lang.String SP
public static final java.lang.String padSP
public static final java.lang.String EMPTY
public static final java.lang.String HTTPVersion
public static final java.lang.String LF
public static final java.lang.String CRLF
protected final java.lang.String host
protected final int port
protected final WebDAVSocket socket
protected final java.lang.String method
protected final java.lang.String URI
Constructor Detail |
---|
public HTTPMessage(WebDAVSocket socket, java.lang.String host, int port, java.lang.String method, java.lang.String URI)
socket
- any class that implements the WebDAVSocket interfacehost
- e.g. the IP address (127.0.0.1) or FQDN (mysite.org)port
- e.g. 80 for HTTP and 443 for HTTPSmethod
- e.g. GET or MKCOLURI
- e.g. the root of the server will be /Method Detail |
---|
public void transceive() throws HTTPMessageException
HTTPMessageException
- on I/O or Unknown Host error.public java.lang.String getResponseParagraph()
public java.lang.String getResponseTitle()
public int getResponseContentLength()
public java.lang.String getResponseCode()
public boolean isResponseSuccessful()
public java.lang.String getResponseEntity()
public byte[] getResponseEntityByte()
protected java.lang.String getResponseMessage()
protected byte[] getResponseMessageByte()
protected java.lang.String getRequestMessage()
protected byte[] getRequestMessageByte()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |