org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader
Class ResourceDownloaderFileImpl
java.lang.Object
  
org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
      
org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderFileImpl
- All Implemented Interfaces: 
 - ResourceDownloader
 
public class ResourceDownloaderFileImpl
- extends ResourceDownloaderBaseImpl
 
- Author:
 
  - parg
 
 
 
 
 
 
| Methods inherited from class org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl | 
addChild, addListener, addReportListener, getBooleanProperty, getChildren, getClone, getLCKeyProperties, getLogIndent, getLongProperty, getParent, getProperty, getPropertySupport, getStringProperty, getStringPropertySupport, informActivity, informAmountComplete, informComplete, informFailed, informPercentDone, isCancelled, removeChild, removeListener, reportActivity, reportActivity, reportAmountComplete, reportPercentComplete, setCancelled, setParent, setProperties, setPropertiesSet, setPropertySupport | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
cancelled
protected boolean cancelled
file
protected File file
result
protected Object result
done_sem
protected AESemaphore done_sem
size
protected long size
ResourceDownloaderFileImpl
public ResourceDownloaderFileImpl(ResourceDownloaderBaseImpl _parent,
                                  File _file)
getName
public String getName()
- Description copied from interface: 
ResourceDownloader 
- Get a sensible name for the download based on its details (e.g. URL)
- Returns:
 
 
 
setSize
protected void setSize(long size)
- Specified by:
 setSize in class ResourceDownloaderBaseImpl
 
 
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
 
 
setProperty
public void setProperty(String name,
                        Object value)
 
getClone
public ResourceDownloaderBaseImpl getClone(ResourceDownloaderBaseImpl parent)
- Specified by:
 getClone in class ResourceDownloaderBaseImpl
 
 
download
public 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.
 
 
cancel
public void cancel()
- Description copied from interface: 
ResourceDownloader 
- Cancel the download.
 
 
cancel
protected void cancel(ResourceDownloaderException reason)
 
completed
public boolean completed(ResourceDownloader downloader,
                         InputStream data)
 
failed
public void failed(ResourceDownloader downloader,
                   ResourceDownloaderException e)