|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.skunk.dav.client.AbstractDAVMethod
base class for DAV methods.
Constructor Summary | |
AbstractDAVMethod(java.lang.String path)
|
Method Summary | |
protected static java.lang.Integer |
extractStatus(java.lang.String statusLine)
convenience function for parsing the status header. |
DAVFile |
getDAVFile()
|
java.lang.String |
getHost()
gets the hostname of the server. |
int |
getPort()
gets the port where the file in question is served. |
java.lang.String |
getProtocol()
returns the protocol |
byte[] |
getRequestBody()
returns the body of the request |
java.util.Map |
getRequestHeaders()
gets the headers of the request |
java.lang.String |
getRequestURL()
returns the path requested |
byte[] |
getResponseBody()
returns the body of the response |
java.util.Map |
getResponseHeaders()
|
int |
getStatus()
|
protected void |
processPropElement(DAVFile file,
XMLElement elem)
by default, passes the properties off to PropertyHandler |
void |
processRequestBody()
a hook for processing the request body. |
void |
processRequestHeaders()
a hook for processing the request headers. |
void |
processResponseBody()
a hook into processing the body of the response. |
void |
processResponseHeaders()
a hook for processing the response headers. |
void |
setHost(java.lang.String host)
sets the hostname |
void |
setPort(int port)
sets the port |
void |
setProtocol(java.lang.String protocol)
sets the protocol |
void |
setRequestBody(byte[] b)
sets the body of the request. |
void |
setRequestHeaders(java.util.Map m)
sets the headers of the request |
void |
setResponseBody(byte[] body)
used to populate the body of the response |
void |
setResponseHeaders(java.util.Map headers)
used to populate the headers of the response |
void |
setStatus(int status)
used to the populate the status of the response |
protected static java.lang.String |
stripLastSlash(java.lang.String path)
chomps the last slash off a path, which may not be null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.skunk.dav.client.DAVMethod |
getRequestMethodName |
Constructor Detail |
public AbstractDAVMethod(java.lang.String path)
path
- the resource on which the method is performedMethod Detail |
public void setProtocol(java.lang.String protocol)
setProtocol
in interface DAVMethod
protocol
- the protocolpublic java.lang.String getProtocol()
public void setHost(java.lang.String host)
setHost
in interface DAVMethod
host
- the hostnamepublic void setPort(int port)
setPort
in interface DAVMethod
port
- the portpublic java.lang.String getHost()
public int getPort()
public java.util.Map getRequestHeaders()
getRequestHeaders
in interface DAVMethod
public void setRequestHeaders(java.util.Map m)
setRequestHeaders
in interface DAVMethod
m
- a map of header names and valuespublic void setRequestBody(byte[] b)
setRequestBody
in interface DAVMethod
b
- the new request bodypublic java.lang.String getRequestURL()
getRequestURL
in interface DAVMethod
public byte[] getRequestBody()
getRequestBody
in interface DAVMethod
public void setResponseHeaders(java.util.Map headers)
setResponseHeaders
in interface DAVMethod
headers
- a mapping of headers names to valuespublic void setResponseBody(byte[] body)
setResponseBody
in interface DAVMethod
org.skunk.dav.client.DAVMethod
b
- the new request bodypublic java.util.Map getResponseHeaders()
getResponseHeaders
in interface DAVMethod
public byte[] getResponseBody()
DAVMethod
getResponseBody
in interface DAVMethod
public int getStatus()
getStatus
in interface DAVMethod
public void setStatus(int status)
setStatus
in interface DAVMethod
status
- the statuspublic DAVFile getDAVFile()
getDAVFile
in interface DAVMethod
public void processResponseBody() throws MalformedXMLException
processResponseBody
in interface DAVMethod
org.skunk.dav.client.DAVMethod
MalformedXMLException
- if an XML response is expected
and it is not well-formed.public void processResponseHeaders()
processResponseHeaders
in interface DAVMethod
public void processRequestHeaders()
processRequestHeaders
in interface DAVMethod
public void processRequestBody()
processRequestBody
in interface DAVMethod
protected static final java.lang.String stripLastSlash(java.lang.String path)
path
- the path to chompprotected void processPropElement(DAVFile file, XMLElement elem)
file
- the DAVFile in which the results are storedelem
- the prop XMLElement being processedprotected static final java.lang.Integer extractStatus(java.lang.String statusLine)
statusLine
- the HTTP status line
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |