com.dropbox.client2
Class DropboxAPI.ChunkedUploadRequest

java.lang.Object
  extended by com.dropbox.client2.DropboxAPI.ChunkedUploadRequest
Enclosing class:
DropboxAPI<SESS_T extends Session>

protected static final class DropboxAPI.ChunkedUploadRequest
extends java.lang.Object

Class representing the uploading of a single chunk of data to Dropbox using the long upload protocol.


Constructor Summary
protected DropboxAPI.ChunkedUploadRequest(org.apache.http.client.methods.HttpUriRequest request, Session session)
           
 
Method Summary
 void abort()
          Aborts the upload.
 DropboxAPI.ChunkedUploadResponse upload()
          Uploads the chunk to Dropbox using /chunked_upload endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropboxAPI.ChunkedUploadRequest

protected DropboxAPI.ChunkedUploadRequest(org.apache.http.client.methods.HttpUriRequest request,
                                          Session session)
Method Detail

abort

public void abort()
Aborts the upload. If the upload is already in progress, it will be interrupted and throw an IOException to the caller.


upload

public DropboxAPI.ChunkedUploadResponse upload()
                                        throws DropboxException
Uploads the chunk to Dropbox using /chunked_upload endpoint.

Returns:
The response of the server to the upload request
Throws:
DropboxServerException - If the given offset does not match the offset the server expects
DropboxIOException - if any network-related error occurs. Could also occur if there was an error reading from the input stream
DropboxUnlinkedException - if the user has revoked access.
DropboxException - for any other unknown errors. This is also a superclass of all other Dropbox exceptions, so you may want to only catch this exception which signals that some kind of error occurred.