Package com.dropbox.core.v1
Class DbxClientV1.Uploader
java.lang.Object
com.dropbox.core.v1.DbxClientV1.Uploader
- Enclosing class:
DbxClientV1
For uploading file content to Dropbox. Write stuff to the
getBody() stream.
Don't call close() directly on the getBody(). Instead call either
call either finish() or close() to make sure the stream and other
resources are released. A safe idiom is to use the object within a try
block and put a call to close() in the finally block.
DbxClientV1.Uploader uploader = ...
try {
uploader.body.write("Hello, world!".getBytes("UTF-8"));
uploader.finish();
}
finally {
uploader.close();
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabort()Cancel the upload.abstract voidclose()Release the resources related to thisUploaderinstance.abstract DbxEntry.Filefinish()When you're done writing the file contents togetBody(), call this to indicate that you're done.abstract OutputStreamgetBody()
-
Constructor Details
-
Uploader
public Uploader()
-
-
Method Details
-
getBody
-
abort
public abstract void abort()Cancel the upload. -
close
public abstract void close() -
finish
When you're done writing the file contents togetBody(), call this to indicate that you're done. This will actually finish the underlying HTTP request and return the uploaded file'sDbxEntry.- Throws:
DbxException
-