public static class DropboxAPI.DropboxInputStream
extends java.io.FilterInputStream
InputStream for a file download that includes the associated
DropboxAPI.DropboxFileInfo. Closing this stream will cancel the associated
download request.| Constructor and Description |
|---|
DropboxAPI.DropboxInputStream(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.HttpResponse response) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream and aborts the request to Dropbox, releasing
any associated resources.
|
void |
copyStreamToOutput(java.io.OutputStream os,
ProgressListener listener)
Copies from a
DropboxAPI.DropboxInputStream to an
OutputStream, optionally providing updates via a
ProgressListener. |
DropboxAPI.DropboxFileInfo |
getFileInfo()
Returns the
DropboxAPI.DropboxFileInfo for the associated file. |
public DropboxAPI.DropboxInputStream(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.HttpResponse response)
throws DropboxException
DropboxExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterInputStreamjava.io.IOException - if an error occurs while closing this stream.public DropboxAPI.DropboxFileInfo getFileInfo()
DropboxAPI.DropboxFileInfo for the associated file.public void copyStreamToOutput(java.io.OutputStream os,
ProgressListener listener)
throws DropboxIOException,
DropboxPartialFileException,
DropboxLocalStorageFullException
DropboxAPI.DropboxInputStream to an
OutputStream, optionally providing updates via a
ProgressListener. You probably won't have a use for this
function because most API functions that return a
DropboxAPI.DropboxInputStream have an alternate that will copy to an
OutputStream for you.os - the stream to copy to.listener - an optional ProgressListener to receive progress
updates as the stream is copied, or null.DropboxPartialFileException - if only part of the input stream was
copied.DropboxIOException - for network-related errors.DropboxLocalStorageFullException - if there is no more room to
write to the output stream.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.