Class ResourceDownloaderMetaRefreshImpl
java.lang.Object
com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
com.biglybt.pifimpl.local.utils.resourcedownloader.ResourceDownloaderMetaRefreshImpl
- All Implemented Interfaces:
ResourceDownloader, ResourceDownloaderListener
public class ResourceDownloaderMetaRefreshImpl
extends ResourceDownloaderBaseImpl
implements ResourceDownloaderListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected ResourceDownloaderBaseImplprotected ResourceDownloaderprotected ResourceDownloaderBaseImplprotected intprotected AESemaphorestatic final intprotected Objectprotected longFields inherited from class ResourceDownloaderBaseImpl
this_monFields inherited from interface ResourceDownloader
PR_BOOLEAN_ANONYMOUS, PR_STRING_CONTENT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionResourceDownloaderMetaRefreshImpl(ResourceDownloaderBaseImpl _parent, ResourceDownloader _delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidAsynchronously download.voidcancel()Cancel the download.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.protected longvoidsetProperty(String name, Object value) protected voidsetSize(long l) 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, setPropertySupportMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceDownloaderListener
reportActivity, reportAmountComplete, reportPercentComplete
-
Field Details
-
MAX_FOLLOWS
public static final int MAX_FOLLOWS- See Also:
-
delegate
-
current_delegate
-
size
protected long size -
cancelled
protected boolean cancelled -
current_downloader
-
result
-
done_count
protected int done_count -
done_sem
-
-
Constructor Details
-
ResourceDownloaderMetaRefreshImpl
public ResourceDownloaderMetaRefreshImpl(ResourceDownloaderBaseImpl _parent, ResourceDownloader _delegate)
-
-
Method Details
-
getName
Description copied from interface:ResourceDownloaderGet a sensible name for the download based on its details (e.g. URL)- Specified by:
getNamein interfaceResourceDownloader- Returns:
-
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.
- Specified by:
getSizein interfaceResourceDownloader- Throws:
ResourceDownloaderException
-
setSize
protected void setSize(long l) - Specified by:
setSizein classResourceDownloaderBaseImpl
-
setProperty
- Specified by:
setPropertyin interfaceResourceDownloader- Throws:
ResourceDownloaderException
-
getSizeSupport
- Throws:
ResourceDownloaderException
-
getClone
- Specified by:
getClonein classResourceDownloaderBaseImpl
-
download
Description copied from interface:ResourceDownloaderSynchronously download. Events are still reported to listeners- Specified by:
downloadin interfaceResourceDownloader- Returns:
- Throws:
ResourceDownloaderException
-
asyncDownload
public void asyncDownload()Description copied from interface:ResourceDownloaderAsynchronously download.- Specified by:
asyncDownloadin interfaceResourceDownloader
-
cancel
public void cancel()Description copied from interface:ResourceDownloaderCancel the download.- Specified by:
cancelin interfaceResourceDownloader
-
completed
- Specified by:
completedin interfaceResourceDownloaderListener- Parameters:
downloader-data-- Returns:
- return true if the completed download is OK. If false is returned then if there are alternative download sources they will be tried. If there are no other sources then the download will be "failed"
-
failed
- Specified by:
failedin interfaceResourceDownloaderListener
-