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.ObjectFor 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 atryblock and put a call toclose()in thefinallyblock.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 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 java.io.OutputStreamgetBody()
-
-
-
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
-
-