public static final class DbxClient.Uploader extends Object
body
stream.
Don't call close()
directly on the body
. 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.
DbxClient.Uploader uploader = ... try { uploader.body.write("Hello, world!".getBytes("UTF-8")); uploader.finish(); } finally { uploader.close(); }
Modifier and Type | Field and Description |
---|---|
OutputStream |
body |
Constructor and Description |
---|
DbxClient.Uploader(HttpRequestor.Uploader httpUploader,
long claimedBytes) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Cancel the upload.
|
void |
close()
Release the resources related to this
Uploader instance. |
DbxEntry.File |
finish()
When you're done writing the file contents to
body , call this
to indicate that you're done. |
public final OutputStream body
public DbxClient.Uploader(HttpRequestor.Uploader httpUploader, long claimedBytes)
public void abort()
public void close()
public DbxEntry.File finish() throws DbxException
body
, call this
to indicate that you're done. This will actually finish the underlying HTTP
request and return the uploaded file's DbxEntry
.DbxException
Copyright © 2013. All rights reserved.