org.apache.webdav.lib.methods
Class HttpRequestBodyMethodBase
HttpMethodBase
org.apache.webdav.lib.methods.HttpRequestBodyMethodBase
public abstract class HttpRequestBodyMethodBase
extends HttpMethodBase
PUT Method.
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(File file) - Set my request body content to the contents of a file.
|
void | setRequestBody(InputStream is) - Set my request body content to the contents of an input stream.
|
void | setRequestBody(String bodydata) - Set my request body content to the contents of a string.
|
void | setRequestBody(URL url) - Set my request body content to the resource at the specified URL.
|
void | setRequestBody(byte[] bodydata) - Set my request body content to the contents of a byte array.
|
protected boolean | writeRequestBody(HttpState state, HttpConnection conn) - Do write the request body.
|
HttpRequestBodyMethodBase
public HttpRequestBodyMethodBase()
Default constructor.
HttpRequestBodyMethodBase
public HttpRequestBodyMethodBase(String uri)
URI-setting constructor.
uri
- the URI to request. The URI is expected
to be already URL encoded. It may be either an absolute or
server relative path.
getRequestContentLength
protected int getRequestContentLength()
Override the method of HttpMethodBase
to return the appropriate content length.
isRequestContentAlreadySet
protected boolean isRequestContentAlreadySet()
return true, if the method setRequestContent has been called (with a null parameter)
readContinueCode
public boolean readContinueCode()
Returns true if 100 Continue status code
is found.
recycle
public void recycle()
setRequestBody
public void setRequestBody(File file)
throws IOException
Set my request body content to the contents of a file.
setRequestBody
public void setRequestBody(InputStream is)
throws 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.
setRequestBody
public void setRequestBody(String bodydata)
Set my request body content to the contents of a string.
setRequestBody
public void setRequestBody(URL url)
throws IOException
Set my request body content to the resource at the specified URL.
setRequestBody
public void setRequestBody(byte[] bodydata)
Set my request body content to the contents of a byte array.
writeRequestBody
protected boolean writeRequestBody(HttpState state,
HttpConnection conn)
throws 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)