|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpMethodBase | +--org.apache.commons.httpclient.methods.GetMethod
GET Method. Implements an HTTP GET request.
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. |
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 memory. |
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase |
USER_AGENT |
Constructor Summary | |
GetMethod()
No-arg constructor. |
|
GetMethod(java.lang.String path)
Path-setting constructor. |
|
GetMethod(java.lang.String path,
java.io.File fileData)
Constructor. |
|
GetMethod(java.lang.String path,
java.lang.String tempDir)
Constructor. |
|
GetMethod(java.lang.String path,
java.lang.String tempDir,
java.lang.String tempFile)
Constructor. |
Method Summary | |
java.io.File |
getFileData()
File data getter. |
java.lang.String |
getName()
Returns "GET". |
byte[] |
getResponseBody()
Return my response body, if any, as a byte array. |
java.io.InputStream |
getResponseBodyAsStream()
Return my response body, if any, as an InputStream . |
java.lang.String |
getResponseBodyAsString()
Return my response body, if any, as a String . |
java.lang.String |
getTempDir()
Temporary directory getter. |
java.lang.String |
getTempFile()
Temporary file getter. |
boolean |
getUseDisk()
Use disk getter. |
protected void |
readResponseBody(HttpState state,
HttpConnection conn)
Overrides method in HttpMethodBase to
write data to the appropriate buffer. |
void |
recycle()
Recycle this method so that it can be used again. |
void |
setFileData(java.io.File fileData)
File data setter. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean useDisk
protected byte[] memoryData
protected java.io.File fileData
protected java.lang.String tempDir
protected java.lang.String tempFile
Constructor Detail |
public GetMethod()
public GetMethod(java.lang.String path)
path
- the path to requestpublic GetMethod(java.lang.String path, java.lang.String tempDir)
path
- the path to requesttempDir
- the directory in which to store temporary filespublic GetMethod(java.lang.String path, java.lang.String tempDir, java.lang.String tempFile)
path
- the path to requesttempDir
- the directory in which to store temporary filestempFile
- the file (under tempDir) to buffer contents topublic GetMethod(java.lang.String path, java.io.File fileData)
path
- the path to requesttempFile
- the file to buffer contents toMethod Detail |
public void setUseDisk(boolean useDisk)
useDisk
- New value of useDiskpublic boolean getUseDisk()
boolean
- useDisk valuepublic void setTempDir(java.lang.String tempDir)
tempDir
- New value of tempDirpublic java.lang.String getTempDir()
public void setTempFile(java.lang.String tempFile)
tempFile
- New value of tempFilepublic java.lang.String getTempFile()
public java.io.File getFileData()
public void setFileData(java.io.File fileData)
public java.lang.String getName()
getName
in class HttpMethodBase
public void recycle()
HttpMethodBase
recycle
in class HttpMethodBase
public byte[] getResponseBody()
getResponseBody
in class HttpMethodBase
public java.lang.String getResponseBodyAsString()
String
.
Otherwise return null.getResponseBodyAsString
in class HttpMethodBase
public java.io.InputStream getResponseBodyAsStream() throws java.io.IOException
InputStream
.
Otherwise return null.getResponseBodyAsStream
in class HttpMethodBase
protected void readResponseBody(HttpState state, HttpConnection conn) throws java.io.IOException
HttpMethodBase
to
write data to the appropriate buffer.readResponseBody
in class HttpMethodBase
org.apache.commons.httpclient.HttpMethodBase
state
- the client stateconn
- the HttpConnection
to read the response fromHttpMethodBase.readResponse(org.apache.commons.httpclient.HttpState, org.apache.commons.httpclient.HttpConnection)
,
HttpMethodBase.processResponseBody(org.apache.commons.httpclient.HttpState, org.apache.commons.httpclient.HttpConnection)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |