org.apache.commons.httpclient.methods
Class PutMethod

java.lang.Object
  |
  +--org.apache.commons.httpclient.HttpMethodBase
        |
        +--org.apache.commons.httpclient.methods.PutMethod
All Implemented Interfaces:
HttpMethod
Direct Known Subclasses:
UrlPutMethod

public class PutMethod
extends HttpMethodBase

PUT Method.

Since:
1.0
Author:
Remy Maucherat

Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
USER_AGENT
 
Constructor Summary
PutMethod()
          No-arg constructor.
PutMethod(java.lang.String path)
          Path-setting constructor.
 
Method Summary
protected  void addRequestHeaders(HttpState state, HttpConnection conn)
          Override the method of HttpMethodBase to set the Expect header if it has not already been set, in addition to the "standard" set of headers.
 java.lang.String getName()
          Return "PUT".
protected  int getRequestContentLength()
          Override the method of HttpMethodBase to return the appropriate content length.
 void recycle()
          Recycle this method so that it can be used again.
 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)
          Override the method of HttpMethodBase to not send any data until the 100 Continue status has not be read.
 
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getFollowRedirects, getPath, getQueryString, getRequestHeader, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaders, getStatusCode, getStatusText, hasBeenUsed, isHttp11, isStrictMode, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseBody, readResponseHeaders, readStatusLine, removeRequestHeader, setFollowRedirects, setHttp11, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, validate, writeRequest, writeRequestHeaders, writeRequestLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PutMethod

public PutMethod()
No-arg constructor.
Since:
1.0

PutMethod

public PutMethod(java.lang.String path)
Path-setting constructor.
Parameters:
path - the path to request
Since:
1.0
Method Detail

getName

public java.lang.String getName()
Return "PUT".
Overrides:
getName in class HttpMethodBase
Returns:
"PUT"
Since:
2.0

setRequestBody

public void setRequestBody(java.io.File file)
                    throws java.io.IOException
Set my request body content to the contents of a file.
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.
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.
Since:
2.0

addRequestHeaders

protected void addRequestHeaders(HttpState state,
                                 HttpConnection conn)
                          throws java.io.IOException,
                                 HttpException
Override the method of HttpMethodBase to set the Expect header if it has not already been set, in addition to the "standard" set of headers.
Overrides:
addRequestHeaders in class HttpMethodBase
Since:
2.0

writeRequestBody

protected boolean writeRequestBody(HttpState state,
                                   HttpConnection conn)
                            throws java.io.IOException,
                                   HttpException
Override the method of HttpMethodBase to not send any data until the 100 Continue status has not be read.
Overrides:
writeRequestBody in class HttpMethodBase
Since:
2.0

getRequestContentLength

protected int getRequestContentLength()
Override the method of HttpMethodBase to return the appropriate content length.
Overrides:
getRequestContentLength in class HttpMethodBase
Since:
2.0

recycle

public void recycle()
Description copied from class: HttpMethodBase
Recycle this method so that it can be used again. All of my instances variables will be reset once this method has been called.
Overrides:
recycle in class HttpMethodBase
Since:
1.0


Copyright (c) 2001 - Apache Software Foundation