|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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 |
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase |
USER_AGENT |
Constructor Summary | |
GetMethod()
No-arg constructor. |
|
GetMethod(java.lang.String uri)
Constructor specifying a URI. |
|
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 |
getTempDir()
Temporary directory getter. |
java.lang.String |
getTempFile()
Temporary file getter. |
boolean |
getUseDisk()
Tells if the response will be buffered in a file. |
protected void |
readResponseBody(HttpState state,
HttpConnection conn)
Overrides method in HttpMethodBase to write data to the
appropriate buffer. |
void |
recycle()
Override recycle to reset redirects default. |
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)
Buffer the response in a file or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GetMethod()
public GetMethod(java.lang.String uri)
uri
- either an absolute or relative URIpublic 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 requestfileData
- the file to buffer contents toMethod Detail |
public void setFileData(java.io.File fileData)
fileData
- the file to buffer data topublic java.io.File getFileData()
public java.lang.String getName()
getName
in interface HttpMethod
getName
in class HttpMethodBase
public byte[] getResponseBody()
getResponseBody
in interface HttpMethod
getResponseBody
in class HttpMethodBase
public java.io.InputStream getResponseBodyAsStream() throws java.io.IOException
InputStream
. Otherwise
return null.
getResponseBodyAsStream
in interface HttpMethod
getResponseBodyAsStream
in class HttpMethodBase
java.io.IOException
- when there is an error reading the responsepublic 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 void setUseDisk(boolean useDisk)
useDisk
- If true the entire response will be buffered in a
temporary file.public boolean getUseDisk()
public void recycle()
recycle
in interface HttpMethod
recycle
in class HttpMethodBase
protected void readResponseBody(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
HttpMethodBase
to write data to the
appropriate buffer.
readResponseBody
in class HttpMethodBase
state
- the shared http stateconn
- the connection to read data from
java.io.IOException
- when there are problems reading from the connection
HttpException
- when a protocol error occurs or state is invalidHttpMethodBase.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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |