Package org.apache.webdav.lib.methods
Class HttpRequestBodyMethodBase
java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
org.apache.webdav.lib.methods.HttpRequestBodyMethodBase
- All Implemented Interfaces:
org.apache.commons.httpclient.HttpMethod
- Direct Known Subclasses:
XMLResponseMethodBase
public abstract class HttpRequestBodyMethodBase
extends org.apache.commons.httpclient.HttpMethodBase
PUT Method.
- Since:
- 1.0
-
Field Summary
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
effectiveVersion, statusLine -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.URI-setting constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected intOverride the method ofHttpMethodBaseto return the appropriate content length.protected booleanreturn true, if the method setRequestContent has been called (with a null parameter)booleanReturns true if 100 Continue status code is found.voidrecycle()voidsetRequestBody(byte[] bodydata) Set my request body content to the contents of a byte array.voidsetRequestBody(File file) Set my request body content to the contents of a file.voidSet my request body content to the contents of an input stream.voidsetRequestBody(String bodydata) Set my request body content to the contents of a string.voidsetRequestBody(URL url) Set my request body content to the resource at the specified URL.protected booleanwriteRequestBody(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) Do write the request body.Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
abort, addCookieRequestHeader, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getName, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isAborted, isConnectionCloseForced, isHttp11, isRequestSent, isStrictMode, processCookieHeaders, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseBody, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, setURI, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
-
Constructor Details
-
HttpRequestBodyMethodBase
public HttpRequestBodyMethodBase()Default constructor. -
HttpRequestBodyMethodBase
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 Details
-
setRequestBody
Set my request body content to the contents of a file.- Throws:
IOException- Since:
- 2.0
-
setRequestBody
Set my request body content to the resource at the specified URL.- Throws:
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
Set my request body content to the contents of a string.- Since:
- 2.0
-
setRequestBody
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:
IOException- Since:
- 2.0
-
readContinueCode
public boolean readContinueCode()Returns true if 100 Continue status code is found.- Since:
- 2.0
-
writeRequestBody
protected boolean writeRequestBody(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws IOException, org.apache.commons.httpclient.HttpException Do write the request body. Override the method ofHttpMethodBaseif the method should wait until a 100 Continue status code is expected (@link readContinueCode)- Overrides:
writeRequestBodyin classorg.apache.commons.httpclient.HttpMethodBase- Throws:
IOExceptionorg.apache.commons.httpclient.HttpException- Since:
- 2.0
-
getRequestContentLength
protected int getRequestContentLength()Override the method ofHttpMethodBaseto 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()- Specified by:
recyclein interfaceorg.apache.commons.httpclient.HttpMethod- Overrides:
recyclein classorg.apache.commons.httpclient.HttpMethodBase- Since:
- 1.0
-