Class HttpFileRequest
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.internal.http.HttpRequest
-
- org.codehaus.cargo.container.internal.http.HttpFileRequest
-
- All Implemented Interfaces:
Loggable
public class HttpFileRequest extends HttpRequest
HTTP request which puts the content of a file as output.
-
-
Field Summary
-
Fields inherited from class org.codehaus.cargo.container.internal.http.HttpRequest
BUFFER_CHUNK_SIZE
-
-
Constructor Summary
Constructors Constructor Description HttpFileRequest(URL url, File file)
HttpFileRequest(URL url, File file, long timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
writeOutputStream(HttpURLConnection connection)
If necessary, writes to the output stream of the HTTP URL connection.-
Methods inherited from class org.codehaus.cargo.container.internal.http.HttpRequest
addRequestProperty, delete, extractCharset, extractHeaderComponent, get, post, put, setAuthentication, setRequestBody
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
-
-
-
-
Constructor Detail
-
HttpFileRequest
public HttpFileRequest(URL url, File file)
- Parameters:
url
- URL to be called.file
- File to be put as output.- See Also:
HttpRequest(java.net.URL)
-
HttpFileRequest
public HttpFileRequest(URL url, File file, long timeout)
- Parameters:
url
- URL to be called.file
- File to be put as output.timeout
- Request timeout.- See Also:
HttpRequest(java.net.URL, long)
-
-
Method Detail
-
writeOutputStream
protected void writeOutputStream(HttpURLConnection connection) throws IOException
If necessary, writes to the output stream of the HTTP URL connection. By default, theHttpRequest.requestBody
is written as output.- Overrides:
writeOutputStream
in classHttpRequest
- Parameters:
connection
- the HTTP URL connection to read from- Throws:
IOException
- if an error happens during the connection establishment or write
-
-