|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.webdav.lib.WebdavClient
WebDAV client.
Field Summary | |
protected Credentials |
credentials
Credentials to use. |
static java.lang.String |
DATE_FORMAT
HTTP Date format pattern (RFC 2068, 822, 1123). |
protected int |
debug
Debug level. |
protected static java.text.DateFormat |
formatter
Date formatter. |
protected boolean |
http11
HTTP/1.1 flag. |
protected java.io.InputStream |
input
Socket input stream. |
protected java.io.OutputStream |
output
Socket output stream. |
protected java.lang.String |
sessionHost
The host name specified when the startSession(host, port) method was called. |
protected int |
sessionPort
Port number. |
protected java.net.Socket |
socket
Client Socket in use. |
protected State |
state
Session state. |
static Header |
USER_AGENT
User Agent. |
Constructor Summary | |
WebdavClient()
|
|
WebdavClient(java.net.URL url)
|
|
WebdavClient(java.net.URL url,
java.lang.String user,
java.lang.String password)
|
Method Summary | |
protected void |
closeConnection()
|
void |
endSession()
End a session. |
void |
executeMethod(WebdavMethod method)
Execute a DAV method. |
int |
getDebug()
Get debug level. |
java.lang.String |
getHost()
Get the session host. |
int |
getPort()
Get the session port. |
State |
getState()
Get the state for lock information. |
protected boolean |
needToCloseConnection(WebdavMethod method,
java.util.Hashtable responseHeaders)
Return true if the connection should be closed after processing. |
protected boolean |
needToCloseOutput()
Return true if the connection should be closed after sending the request. |
protected void |
openConnection()
|
protected java.util.Hashtable |
parseHeaders(java.io.InputStream input)
Parse headers. |
protected void |
parseStatusLine(java.lang.String statusLine,
WebdavMethod method)
Parse status line. |
protected java.lang.String |
readLine(java.io.InputStream input)
Reads the input stream, one line at a time. |
protected void |
sendRequest(WebdavMethod method)
Send a WebDAV request. |
void |
setCredentials(Credentials credentials)
Set the credentials to use. |
void |
setDebug(int debug)
Set debug level. |
void |
setSocket(java.net.Socket socket)
Set the socket to use. |
void |
setState(State state)
Set the client state. |
void |
startSession()
Start a session. |
void |
startSession(java.lang.String host,
int port)
Start a session. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final java.lang.String DATE_FORMAT
public static final Header USER_AGENT
protected static final java.text.DateFormat formatter
protected java.net.Socket socket
protected State state
protected Credentials credentials
protected java.io.InputStream input
protected java.io.OutputStream output
protected java.lang.String sessionHost
protected int sessionPort
protected boolean http11
protected int debug
Constructor Detail |
public WebdavClient()
public WebdavClient(java.net.URL url)
public WebdavClient(java.net.URL url, java.lang.String user, java.lang.String password)
Method Detail |
public void setSocket(java.net.Socket socket)
public void setCredentials(Credentials credentials)
public void setDebug(int debug)
public int getDebug()
public java.lang.String getHost()
public int getPort()
public State getState()
public void setState(State state)
public void executeMethod(WebdavMethod method) throws java.io.IOException, WebdavException
method
- WebDAV method to executepublic void startSession()
public void startSession(java.lang.String host, int port)
public void endSession() throws java.io.IOException
protected void openConnection() throws java.io.IOException, java.net.UnknownHostException
protected void closeConnection() throws java.io.IOException
protected void sendRequest(WebdavMethod method) throws java.io.IOException, WebdavException
method
- WebDAV method to executeprotected java.lang.String readLine(java.io.InputStream input) throws java.io.IOException
input
- Input stream on which the bytes are readnull
if end-of-file
was encounteredjava.io.IOException
- if an input or output exception has occurredprotected void parseStatusLine(java.lang.String statusLine, WebdavMethod method) throws java.io.IOException, WebdavException
statusLine
- String representing the HTTP status linemethod
- Webdav methodprotected java.util.Hashtable parseHeaders(java.io.InputStream input) throws java.io.IOException, WebdavException
input
- Input stream on which the bytes are readprotected boolean needToCloseConnection(WebdavMethod method, java.util.Hashtable responseHeaders)
protected boolean needToCloseOutput()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |