Package io.milton.httpclient
Class TransferService
java.lang.Object
io.milton.httpclient.TransferService
- Author:
- bradm
-
Constructor Summary
ConstructorsConstructorDescriptionTransferService(org.apache.http.client.HttpClient client, List<ConnectionListener> connectionListeners) -
Method Summary
Modifier and TypeMethodDescriptionvoidget(String url, StreamReceiver receiver, List<Range> rangeList, ProgressListener listener, org.apache.http.protocol.HttpContext context) intput(String encodedUrl, InputStream content, Long contentLength, String contentType, IfMatchCheck etagMatch, ProgressListener listener, org.apache.http.protocol.HttpContext context) Attempt to PUT a file to the server.voidsetTimeout(int timeout)
-
Constructor Details
-
TransferService
public TransferService(org.apache.http.client.HttpClient client, List<ConnectionListener> connectionListeners)
-
-
Method Details
-
get
public void get(String url, StreamReceiver receiver, List<Range> rangeList, ProgressListener listener, org.apache.http.protocol.HttpContext context) throws HttpException, Utils.CancelledException, NotAuthorizedException, BadRequestException, ConflictException, NotFoundException -
put
public HttpResult put(String encodedUrl, InputStream content, Long contentLength, String contentType, IfMatchCheck etagMatch, ProgressListener listener, org.apache.http.protocol.HttpContext context) Attempt to PUT a file to the server. Now includes an etag check. If you intend to overwrite a file then include a non-null etag. This will do an if-match check on the server to ensure you're not overwriting someone else's changes. If the file in new, the etag given should be null, this will result in an if-none-match: * check, which will fail if a file already exists- Parameters:
encodedUrl-content-contentLength-contentType-etag- - expected etag on the server if overwriting, or null if a new filelistener-context-- Returns:
-
getTimeout
public int getTimeout() -
setTimeout
public void setTimeout(int timeout)
-