org.apache.webdav.lib.methods
Class HttpRequestBodyMethodBase

java.lang.Object
  extended byorg.apache.commons.httpclient.HttpMethodBase
      extended byorg.apache.webdav.lib.methods.HttpRequestBodyMethodBase
All Implemented Interfaces:
HttpMethod
Direct Known Subclasses:
XMLResponseMethodBase

public abstract class HttpRequestBodyMethodBase
extends HttpMethodBase

PUT Method.

Since:
1.0

Field Summary
 
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
USER_AGENT
 
Constructor Summary
HttpRequestBodyMethodBase()
          Default constructor.
HttpRequestBodyMethodBase(java.lang.String uri)
          URI-setting constructor.
 
Method Summary
protected  int getRequestContentLength()
          Override the method of HttpMethodBase to return the appropriate content length.
protected  boolean isRequestContentAlreadySet()
          return true, if the method setRequestContent has been called (with a null parameter)
 boolean readContinueCode()
          Returns true if 100 Continue status code is found.
 void recycle()
           
 void setRequestBody(byte[] bodydata)
          Set my request body content to the contents of a byte array.
 void setRequestBody(java.io.File file)
          Set my request body content to the contents of a file.
 void setRequestBody(java.io.InputStream is)
          Set my request body content to the contents of an input stream.
 void setRequestBody(java.lang.String bodydata)
          Set my request body content to the contents of a string.
 void setRequestBody(java.net.URL url)
          Set my request body content to the resource at the specified URL.
protected  boolean writeRequestBody(HttpState state, HttpConnection conn)
          Do write the request body.
 
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, fakeResponse, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getFollowRedirects, getHostConfiguration, getMethodRetryHandler, getName, getPath, getProxyAuthenticationRealm, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isConnectionCloseForced, isHttp11, isStrictMode, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseBody, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequestBodyMethodBase

public HttpRequestBodyMethodBase()
Default constructor.


HttpRequestBodyMethodBase

public HttpRequestBodyMethodBase(java.lang.String uri)
URI-setting constructor.

Parameters:
uri - the URI to request. The URI is expected to be already URL encoded. It may be either an absolute or server relative path.
Since:
1.0
Method Detail

setRequestBody

public void setRequestBody(java.io.File file)
                    throws java.io.IOException
Set my request body content to the contents of a file.

Throws:
java.io.IOException
Since:
2.0

setRequestBody

public void setRequestBody(java.net.URL url)
                    throws java.io.IOException
Set my request body content to the resource at the specified URL.

Throws:
java.io.IOException
Since:
2.0

setRequestBody

public void setRequestBody(byte[] bodydata)
Set my request body content to the contents of a byte array.

Since:
2.0

setRequestBody

public void setRequestBody(java.lang.String bodydata)
Set my request body content to the contents of a string.

Since:
2.0

setRequestBody

public void setRequestBody(java.io.InputStream is)
                    throws java.io.IOException
Set my request body content to the contents of an input stream. The contents will be buffered into memory. To upload large entities, it is recommended to first buffer the data into a temporary file, and then send that file.

Throws:
java.io.IOException
Since:
2.0

readContinueCode

public boolean readContinueCode()
Returns true if 100 Continue status code is found.

Since:
2.0

writeRequestBody

protected boolean writeRequestBody(HttpState state,
                                   HttpConnection conn)
                            throws java.io.IOException,
                                   HttpException
Do write the request body. Override the method of HttpMethodBase if the method should wait until a 100 Continue status code is expected (@link readContinueCode)

Throws:
java.io.IOException
HttpException
Since:
2.0

getRequestContentLength

protected int getRequestContentLength()
Override the method of HttpMethodBase to return the appropriate content length.

Since:
2.0

isRequestContentAlreadySet

protected boolean isRequestContentAlreadySet()
return true, if the method setRequestContent has been called (with a null parameter)

Since:
2.0

recycle

public void recycle()
Since:
1.0