public class DownloadImpl extends AbstractTransfer implements Download
Transfer.TransferStatelistenerChain, monitor, state, stateChangeListeners| Constructor and Description |
|---|
DownloadImpl(String description,
TransferProgress transferProgress,
ProgressListenerChain progressListenerChain,
COSObject cosObject,
TransferStateChangeListener listener,
GetObjectRequest getObjectRequest,
File file) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Cancels this download.
|
void |
abortWithoutNotifyingStateChangeListener()
Cancels this download, but skip notifying the state change listeners.
|
String |
getBucketName()
The name of the bucket where the object is being downloaded from.
|
COSObject |
getCosObject() |
String |
getKey()
The key under which this object was stored in Qcloud COS.
|
ObjectMetadata |
getObjectMetadata()
Returns the ObjectMetadata for the object being downloaded.
|
PersistableDownload |
pause()
Pause the current download operation and returns the information that can
be used to resume the download at a later time.
|
void |
setCosObject(COSObject cosObject) |
void |
setState(Transfer.TransferState state)
This method is also responsible for firing COMPLETED signal to the
listeners.
|
addProgressListener, addStateChangeListener, fireProgressEvent, getDescription, getMonitor, getProgress, getState, isDone, notifyStateChangeListeners, removeProgressListener, removeStateChangeListener, rethrowExecutionException, setMonitor, unwrapExecutionException, waitForCompletion, waitForExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddProgressListener, getDescription, getProgress, getState, isDone, removeProgressListener, waitForCompletion, waitForExceptionpublic DownloadImpl(String description, TransferProgress transferProgress, ProgressListenerChain progressListenerChain, COSObject cosObject, TransferStateChangeListener listener, GetObjectRequest getObjectRequest, File file)
public ObjectMetadata getObjectMetadata()
getObjectMetadata in interface Downloadpublic String getBucketName()
getBucketName in interface Downloadpublic String getKey()
public void abort()
throws IOException
abort in interface DownloadIOExceptionpublic void abortWithoutNotifyingStateChangeListener()
throws IOException
IOExceptionpublic COSObject getCosObject()
public void setCosObject(COSObject cosObject)
public void setState(Transfer.TransferState state)
setState in class AbstractTransferpublic PersistableDownload pause() throws PauseException
DownloadCryptoMode#StrictAuthenticatedEncryption would result in
CosClientException as authenticity cannot be guaranteed for a range
get operation.pause in interface DownloadPauseException - If any errors were encountered while trying to pause the
download.Copyright © 2023. All rights reserved.