org.apache.webdav.lib.methods
Class GetMethod

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

public class GetMethod
extends WebdavMethodBase

GET Method.

Author:
Remy Maucherat, Sung-Gu Park

Field Summary
protected  java.io.File fileData
          File which contains the buffered data.
protected  byte[] memoryData
          If we're not using the HD, we're using a memory byte buffer.
static java.lang.String TEMP_DIR
          Temporary directory.
protected  java.lang.String tempDir
          Temporary directory to use.
protected  java.lang.String tempFile
          Temporary file to use.
protected  boolean useDisk
          By default, the get method will buffer read data to the disk.
 
Fields inherited from class org.apache.webdav.lib.methods.WebdavMethodBase
debug, headers, name, path, query, state, statusCode, statusText
 
Fields inherited from interface org.apache.webdav.lib.methods.WebdavMethod
PROTOCOL
 
Constructor Summary
GetMethod()
          Method constructor.
GetMethod(java.lang.String path)
          Method constructor.
GetMethod(java.lang.String path, boolean useDisk, java.lang.String tempDir)
          Method constructor.
GetMethod(java.lang.String path, boolean useDisk, java.lang.String tempDir, java.lang.String tempFile)
          Method constructor.
GetMethod(java.lang.String path, java.lang.String tempDir)
          Method constructor.
GetMethod(java.lang.String path, java.lang.String tempDir, java.lang.String tempFile)
          Method constructor.
 
Method Summary
 boolean followRedirects()
          True if this methods should automatically follow redirects.
 java.lang.String generateQuery()
          Generate the query body.
 java.io.InputStream getData()
          Get read data.
 java.lang.String getDataAsString()
          Get read data as a String.
 java.lang.String getTempDir()
          Temporary directory getter.
 java.lang.String getTempFile()
          Temporary file getter.
 boolean getUseDisk()
          Use disk getter.
 void parseResponse(java.io.InputStream is)
          Parse response.
 void setTempDir(java.lang.String tempDir)
          Temporary directory setter.
 void setTempFile(java.lang.String tempFile)
          Temporary file setter.
 void setUseDisk(boolean useDisk)
          Use disk setter.
 
Methods inherited from class org.apache.webdav.lib.methods.WebdavMethodBase
checkNotUsed, checkUsed, generateHeaders, generateHeaders, generateRequestLine, getHeader, getHeaders, getName, getPath, getStatusCode, getStatusText, hasBeenUsed, isStreamedQuery, processResponseHeaders, recycle, removeHeader, setDebug, setHeader, setPath, setQuery, setStatusCode, setStatusText, setUsed, streamQuery, validate
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMP_DIR

public static final java.lang.String TEMP_DIR
Temporary directory.

useDisk

protected boolean useDisk
By default, the get method will buffer read data to the disk.

memoryData

protected byte[] memoryData
If we're not using the HD, we're using a memory byte buffer.

fileData

protected java.io.File fileData
File which contains the buffered data.

tempDir

protected java.lang.String tempDir
Temporary directory to use.

tempFile

protected java.lang.String tempFile
Temporary file to use.
Constructor Detail

GetMethod

public GetMethod()
Method constructor.

GetMethod

public GetMethod(java.lang.String path)
Method constructor.

GetMethod

public GetMethod(java.lang.String path,
                 java.lang.String tempDir)
Method constructor.

GetMethod

public GetMethod(java.lang.String path,
                 boolean useDisk,
                 java.lang.String tempDir)
Method constructor.

GetMethod

public GetMethod(java.lang.String path,
                 java.lang.String tempDir,
                 java.lang.String tempFile)
Method constructor.

GetMethod

public GetMethod(java.lang.String path,
                 boolean useDisk,
                 java.lang.String tempDir,
                 java.lang.String tempFile)
Method constructor.
Method Detail

setUseDisk

public void setUseDisk(boolean useDisk)
Use disk setter.
Parameters:
useDisk - New value of useDisk

getUseDisk

public boolean getUseDisk()
Use disk getter.
Parameters:
boolean - useDisk value

followRedirects

public boolean followRedirects()
True if this methods should automatically follow redirects.
Overrides:
followRedirects in class WebdavMethodBase
Returns:
boolean True if auto redirect should be used for this method

setTempDir

public void setTempDir(java.lang.String tempDir)
Temporary directory setter.
Parameters:
tempDir - New value of tempDir

getTempDir

public java.lang.String getTempDir()
Temporary directory getter.

setTempFile

public void setTempFile(java.lang.String tempFile)
Temporary file setter.
Parameters:
tempFile - New value of tempFile

getTempFile

public java.lang.String getTempFile()
Temporary file getter.

getData

public java.io.InputStream getData()
                            throws java.io.IOException
Get read data.

getDataAsString

public java.lang.String getDataAsString()
                                 throws java.io.IOException
Get read data as a String.

generateQuery

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

parseResponse

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