public final class FileDownloadStatus extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FileDownloadStatus.Status
Return value of the getStatus method.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
NOT_AVAILABLE
Constant signaling "not available".
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultFailObserver()
Adds a default observer that is notified when the transfer fails.
|
void |
addTransferFailedObserver(Observer o)
Adds an observer which is notified if the transfer fails due to an
exception.
|
void |
addTransferFinishedObserver(Observer o)
Adds an observer that is notified once the transfer is finished.
|
Exception |
getException()
Returns the exception that caused the download to fail, if the status ==
FAILED.
|
FileIdentifier |
getFileIdentifier()
Returns the identifier of the file to be downloaded.
|
FileTransferStatistics |
getStatistics()
Gets the statistics object for this file transfer, which provides useful
information, especially while the transfer is active.
|
FileDownloadStatus.Status |
getStatus()
This is the ultimate method for checking in which "stage" a file transfer
currently is.
|
File |
getTransferredFile()
Returns the transferred file.
|
File |
getTransferredFile(boolean block)
Similar to
getTransferredFile(), but this method blocks the
client thread. |
com.google.common.base.Optional<ProjectSpace> |
getTransferringProjectSpace()
Returns the project space which started this file transfer.
|
boolean |
isNotOnServer()
Whether the file to be downloaded is on server.
|
boolean |
isTransferFinished()
Returns true if the transfer is finished.
|
public static final int NOT_AVAILABLE
public FileIdentifier getFileIdentifier()
public FileDownloadStatus.Status getStatus()
public void addTransferFinishedObserver(Observer o)
o - an observer to be notified when the transfer is finishedpublic void addTransferFailedObserver(Observer o)
o - an observer that is notified if the transfer failspublic void addDefaultFailObserver()
public boolean isTransferFinished()
public boolean isNotOnServer()
true if the file is not on the server, false otherwisepublic FileTransferStatistics getStatistics()
public File getTransferredFile() throws FileTransferException
FileTransferException - if the file is not yet fully transferredpublic File getTransferredFile(boolean block) throws FileTransferException
getTransferredFile(), but this method blocks the
client thread.block - whether to block or notFileTransferException - in case of an error during transferpublic com.google.common.base.Optional<ProjectSpace> getTransferringProjectSpace()
public Exception getException()
Copyright © 2017. All rights reserved.