Class ResourceDownloaderDelayedImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
-
- com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderDelayedImpl
-
- All Implemented Interfaces:
ResourceDownloader
public class ResourceDownloaderDelayedImpl extends ResourceDownloaderBaseImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected ResourceDownloaderBaseImpl
delegate
protected ResourceDownloaderDelayedFactory
factory
protected long
size
-
Fields inherited from class com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
this_mon
-
Fields inherited from interface com.biglybt.pif.utils.resourcedownloader.ResourceDownloader
PR_BOOLEAN_ANONYMOUS, PR_STRING_CONTENT_TYPE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResourceDownloaderDelayedImpl(ResourceDownloaderBaseImpl _parent, ResourceDownloaderDelayedFactory _factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(ResourceDownloaderListener l)
void
asyncDownload()
Asynchronously download.void
cancel()
Cancel the download.java.io.InputStream
download()
Synchronously download.ResourceDownloaderBaseImpl
getClone(ResourceDownloaderBaseImpl parent)
protected void
getDelegate()
java.lang.String
getName()
Get a sensible name for the download based on its details (e.g.long
getSize()
Attempts to get the size of the download.void
removeListener(ResourceDownloaderListener l)
void
reportActivity(java.lang.String activity)
void
setProperty(java.lang.String name, java.lang.Object value)
protected void
setSize(long _size)
-
Methods inherited from class com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
addChild, addReportListener, getBooleanProperty, getBooleanProperty, getChildren, getClone, getLCKeyProperties, getLogIndent, getLongProperty, getParent, getProperty, getProperty, getPropertySupport, getStringProperty, getStringPropertySupport, informActivity, informAmountComplete, informComplete, informFailed, informPercentDone, isAnonymous, isCancelled, removeChild, reportActivity, reportAmountComplete, reportPercentComplete, setCancelled, setParent, setProperties, setPropertiesSet, setPropertyRecursive, setPropertySupport
-
-
-
-
Field Detail
-
factory
protected ResourceDownloaderDelayedFactory factory
-
delegate
protected ResourceDownloaderBaseImpl delegate
-
size
protected long size
-
-
Constructor Detail
-
ResourceDownloaderDelayedImpl
protected ResourceDownloaderDelayedImpl(ResourceDownloaderBaseImpl _parent, ResourceDownloaderDelayedFactory _factory)
-
-
Method Detail
-
getDelegate
protected void getDelegate()
-
getName
public java.lang.String getName()
Description copied from interface:ResourceDownloader
Get a sensible name for the download based on its details (e.g. URL)- Returns:
-
getClone
public ResourceDownloaderBaseImpl getClone(ResourceDownloaderBaseImpl parent)
- Specified by:
getClone
in classResourceDownloaderBaseImpl
-
download
public java.io.InputStream download() throws ResourceDownloaderException
Description copied from interface:ResourceDownloader
Synchronously download. Events are still reported to listeners- Returns:
- Throws:
ResourceDownloaderException
-
asyncDownload
public void asyncDownload()
Description copied from interface:ResourceDownloader
Asynchronously download.
-
setSize
protected void setSize(long _size)
- Specified by:
setSize
in classResourceDownloaderBaseImpl
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value) throws ResourceDownloaderException
- Throws:
ResourceDownloaderException
-
getSize
public long getSize() throws ResourceDownloaderException
Description copied from interface:ResourceDownloader
Attempts 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
-
cancel
public void cancel()
Description copied from interface:ResourceDownloader
Cancel the download.
-
reportActivity
public void reportActivity(java.lang.String activity)
- Specified by:
reportActivity
in interfaceResourceDownloader
- Overrides:
reportActivity
in classResourceDownloaderBaseImpl
-
addListener
public void addListener(ResourceDownloaderListener l)
- Specified by:
addListener
in interfaceResourceDownloader
- Overrides:
addListener
in classResourceDownloaderBaseImpl
-
removeListener
public void removeListener(ResourceDownloaderListener l)
- Specified by:
removeListener
in interfaceResourceDownloader
- Overrides:
removeListener
in classResourceDownloaderBaseImpl
-
-