Package com.dropbox.core.v1
Class DbxClientV1.Uploader
- java.lang.Object
-
- com.dropbox.core.v1.DbxClientV1.Uploader
-
- Enclosing class:
- DbxClientV1
public abstract static class DbxClientV1.Uploader extends java.lang.Object
For uploading file content to Dropbox. Write stuff to thegetBody()
stream.Don't call
close()
directly on thegetBody()
. Instead call either call eitherfinish()
orclose()
to make sure the stream and other resources are released. A safe idiom is to use the object within atry
block and put a call toclose()
in thefinally
block.DbxClientV1.Uploader uploader = ... try { uploader.body.write("Hello, world!".getBytes("UTF-8")); uploader.finish(); } finally { uploader.close(); }
-
-
Constructor Summary
Constructors Constructor Description Uploader()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
abort()
Cancel the upload.abstract void
close()
Release the resources related to thisUploader
instance.abstract DbxEntry.File
finish()
When you're done writing the file contents togetBody()
, call this to indicate that you're done.abstract java.io.OutputStream
getBody()
-
-
-
Method Detail
-
getBody
public abstract java.io.OutputStream getBody()
-
abort
public abstract void abort()
Cancel the upload.
-
close
public abstract void close()
-
finish
public abstract DbxEntry.File finish() throws DbxException
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
-
-