com.dropbox.client2
Class DropboxAPI.BasicUploadRequest

java.lang.Object
  extended by com.dropbox.client2.DropboxAPI.BasicUploadRequest
All Implemented Interfaces:
DropboxAPI.UploadRequest
Enclosing class:
DropboxAPI<SESS_T extends Session>

protected static final class DropboxAPI.BasicUploadRequest
extends java.lang.Object
implements DropboxAPI.UploadRequest


Constructor Summary
DropboxAPI.BasicUploadRequest(org.apache.http.client.methods.HttpUriRequest request, Session session)
           
 
Method Summary
 void abort()
          Aborts the request.
 DropboxAPI.Entry upload()
          Executes the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropboxAPI.BasicUploadRequest

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

abort

public void abort()
Aborts the request. The original call to upload() will throw a DropboxPartialFileException.

Specified by:
abort in interface DropboxAPI.UploadRequest

upload

public DropboxAPI.Entry upload()
                        throws DropboxException
Executes the request.

Specified by:
upload in interface DropboxAPI.UploadRequest
Returns:
an DropboxAPI.Entry representing the uploaded file.
Throws:
DropboxPartialFileException - if the request was canceled before completion.
DropboxServerException - if the server responds with an error code. See the constants in DropboxServerException for the meaning of each error code. The most common error codes you can expect from this call are 404 (path to upload not found), 507 (user over quota), and 400 (unexpected parent rev).
DropboxIOException - if any network-related error occurs.
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.