org.apache.webdav.lib.methods
Class PutMethod

java.lang.Object
  |
  +--org.apache.webdav.lib.methods.WebdavMethodBase
        |
        +--org.apache.webdav.lib.methods.PutMethod
All Implemented Interfaces:
WebdavMethod

public class PutMethod
extends WebdavMethodBase

PUT Method.

Author:
Remy Maucherat

Fields inherited from class org.apache.webdav.lib.methods.WebdavMethodBase
debug, headers, name, parameters, path, query, queryString, state, statusCode, statusText
 
Fields inherited from interface org.apache.webdav.lib.methods.WebdavMethod
PROTOCOL
 
Constructor Summary
PutMethod()
          Method constructor.
PutMethod(java.lang.String path)
          Method constructor.
 
Method Summary
 java.lang.String generateQuery()
          Generate the query body.
 boolean isStreamedQuery()
          Is the query body submitted through an InputStream of with a String.
 void parseResponse(java.io.InputStream is)
          Parse response.
 void recycle()
          Recycle the method object, so that it can be reused again.
 void sendData(byte[] data)
          Send the contents of a byte array.
 void sendData(java.io.File file)
          Send the contents of a file.
 void sendData(java.io.InputStream is)
          Send the contents of an input stream.
 void sendData(java.lang.String data)
          Send the contents of a string.
 void sendData(java.net.URL url)
          Send the contents of the resource at the specified URL.
 void streamQuery(java.io.OutputStream out)
          Stream the body of the query.
 
Methods inherited from class org.apache.webdav.lib.methods.WebdavMethodBase
checkNotUsed, checkUsed, followRedirects, generateHeaders, generateHeaders, generateRequestLine, getHeader, getHeaders, getName, getPath, getStatusCode, getStatusText, hasBeenUsed, needContentLength, processResponseHeaders, removeHeader, setDebug, setHeader, setParameter, setPath, setQuery, setQueryString, setState, setStatusCode, setStatusText, setUsed, validate
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PutMethod

public PutMethod()
Method constructor.

PutMethod

public PutMethod(java.lang.String path)
Method constructor.
Method Detail

sendData

public void sendData(java.io.File file)
              throws java.io.IOException
Send the contents of a file.

sendData

public void sendData(java.net.URL url)
              throws java.io.IOException
Send the contents of the resource at the specified URL.

sendData

public void sendData(byte[] data)
Send the contents of a byte array.

sendData

public void sendData(java.lang.String data)
Send the contents of a string.

sendData

public void sendData(java.io.InputStream is)
              throws java.io.IOException
Send 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.

isStreamedQuery

public boolean isStreamedQuery()
Is the query body submitted through an InputStream of with a String. If an InputStream is available, it's used.
Overrides:
isStreamedQuery in class WebdavMethodBase
Returns:
boolean True if the content is avalable in an InputStream

recycle

public void recycle()
Recycle the method object, so that it can be reused again. Any attempt to reuse an object without recycling it will throw a WebdavException.
Overrides:
recycle in class WebdavMethodBase

generateQuery

public java.lang.String generateQuery()
Generate the query body.
Overrides:
generateQuery in class WebdavMethodBase
Returns:
String query

streamQuery

public void streamQuery(java.io.OutputStream out)
                 throws java.io.IOException
Stream the body of the query. This function should be used to send large request bodies.
Overrides:
streamQuery in class WebdavMethodBase

parseResponse

public void parseResponse(java.io.InputStream is)
                   throws java.io.IOException
Parse response.
Overrides:
parseResponse in class WebdavMethodBase
Parameters:
is - Input stream