Class ResourceDownloaderFileImpl
java.lang.Object
com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderFileImpl
- All Implemented Interfaces:
ResourceDownloader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected AESemaphoreprotected Fileprotected Objectprotected longFields inherited from class ResourceDownloaderBaseImpl
this_monFields inherited from interface ResourceDownloader
PR_BOOLEAN_ANONYMOUS, PR_STRING_CONTENT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAsynchronously download.voidcancel()Cancel the download.protected voidcancel(ResourceDownloaderException reason) booleancompleted(ResourceDownloader downloader, InputStream data) download()Synchronously download.voidfailed(ResourceDownloader downloader, ResourceDownloaderException e) getClone(ResourceDownloaderBaseImpl parent) getName()Get a sensible name for the download based on its details (e.g.longgetSize()Attempts to get the size of the download.voidsetProperty(String name, Object value) protected voidsetSize(long size) Methods inherited from class ResourceDownloaderBaseImpl
addChild, addListener, addReportListener, getBooleanProperty, getBooleanProperty, getChildren, getClone, getLCKeyProperties, getLogIndent, getLongProperty, getParent, getProperty, getProperty, getPropertySupport, getStringProperty, getStringPropertySupport, informActivity, informAmountComplete, informComplete, informFailed, informPercentDone, isAnonymous, isCancelled, removeChild, removeListener, reportActivity, reportActivity, reportAmountComplete, reportPercentComplete, setCancelled, setParent, setProperties, setPropertiesSet, setPropertyRecursive, setPropertySupport
-
Field Details
-
cancelled
protected boolean cancelled -
file
-
result
-
done_sem
-
size
protected long size
-
-
Constructor Details
-
ResourceDownloaderFileImpl
-
-
Method Details
-
getName
Description copied from interface:ResourceDownloaderGet a sensible name for the download based on its details (e.g. URL)- Returns:
-
setSize
protected void setSize(long size) - Specified by:
setSizein classResourceDownloaderBaseImpl
-
getSize
Description copied from interface:ResourceDownloaderAttempts to get the size of the download. Returns -1 if the size can't be determined.Note: You must not call this method from the reportActivity callback method.
- Throws:
ResourceDownloaderException
-
setProperty
-
getClone
- Specified by:
getClonein classResourceDownloaderBaseImpl
-
download
Description copied from interface:ResourceDownloaderSynchronously download. Events are still reported to listeners- Returns:
- Throws:
ResourceDownloaderException
-
asyncDownload
public void asyncDownload()Description copied from interface:ResourceDownloaderAsynchronously download. -
cancel
-
cancel
-
completed
-
failed
-