org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader
Class ResourceDownloaderURLImpl
java.lang.Object
  
org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderBaseImpl
      
org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.ResourceDownloaderURLImpl
- All Implemented Interfaces: 
 - SEPasswordListener, ResourceDownloader
 
public class ResourceDownloaderURLImpl
- extends ResourceDownloaderBaseImpl
- implements SEPasswordListener
  
 
 
 
| 
Constructor Summary | 
ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                          java.net.URL _url)
 
            | 
ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                          java.net.URL _url,
                          boolean _auth_supplied,
                          java.lang.String _user_name,
                          java.lang.String _password)
 
            | 
ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                          java.net.URL _url,
                          byte[] _data,
                          boolean _auth_supplied,
                          java.lang.String _user_name,
                          java.lang.String _password)
 
            | 
ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                          java.net.URL _url,
                          java.lang.String _user_name,
                          java.lang.String _password)
 
            | 
 
 
| Methods inherited from class org.gudy.azureus2.pluginsimpl.local.utils.resourcedownloader.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 | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
ResourceDownloaderURLImpl
public ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                                 java.net.URL _url)
ResourceDownloaderURLImpl
public ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                                 java.net.URL _url,
                                 java.lang.String _user_name,
                                 java.lang.String _password)
ResourceDownloaderURLImpl
public ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                                 java.net.URL _url,
                                 boolean _auth_supplied,
                                 java.lang.String _user_name,
                                 java.lang.String _password)
ResourceDownloaderURLImpl
public ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
                                 java.net.URL _url,
                                 byte[] _data,
                                 boolean _auth_supplied,
                                 java.lang.String _user_name,
                                 java.lang.String _password)
- Parameters:
 _parent - _url - _data - if null, GET will be used, otherwise POST will be used with
              the data supplied_auth_supplied - _user_name - _password - 
setForceNoProxy
protected void setForceNoProxy(boolean force_no_proxy)
 
 
setForceProxy
protected void setForceProxy(java.net.Proxy proxy)
 
 
setAutoPluginProxy
protected void setAutoPluginProxy()
 
 
getURL
protected java.net.URL getURL()
 
 
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)
- Specified by:
 getName in interface ResourceDownloader
 
- Returns:
 
 
 
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.
- Specified by:
 getSize in interface ResourceDownloader
 
- Throws:
 ResourceDownloaderException
 
 
setSize
protected void setSize(long l)
- Specified by:
 setSize in class ResourceDownloaderBaseImpl
 
 
setProperty
public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws ResourceDownloaderException
- Specified by:
 setProperty in interface ResourceDownloader
 
- Throws:
 ResourceDownloaderException
 
getSizeSupport
protected long getSizeSupport()
                       throws ResourceDownloaderException
 
- Throws:
 ResourceDownloaderException
 
getClone
public ResourceDownloaderBaseImpl getClone(ResourceDownloaderBaseImpl parent)
- Specified by:
 getClone in class ResourceDownloaderBaseImpl
 
 
asyncDownload
public void asyncDownload()
- Description copied from interface: 
ResourceDownloader 
- Asynchronously download.
- Specified by:
 asyncDownload in interface ResourceDownloader
 
 
 
download
public java.io.InputStream download()
                             throws ResourceDownloaderException
- Description copied from interface: 
ResourceDownloader 
- Synchronously download. Events are still reported to listeners
- Specified by:
 download in interface ResourceDownloader
 
- Returns:
 - 
 - Throws:
 ResourceDownloaderException
 
 
cancel
public void cancel()
- Description copied from interface: 
ResourceDownloader 
- Cancel the download.
- Specified by:
 cancel in interface ResourceDownloader
 
 
 
setRequestProperties
protected void setRequestProperties(java.net.URLConnection con,
                                    boolean use_compression)
 
 
getRequestProperties
protected void getRequestProperties(java.net.URLConnection con)
 
 
getAuthentication
public java.net.PasswordAuthentication getAuthentication(java.lang.String realm,
                                                         java.net.URL tracker)
- Specified by:
 getAuthentication in interface SEPasswordListener
 
 
setAuthenticationOutcome
public void setAuthenticationOutcome(java.lang.String realm,
                                     java.net.URL tracker,
                                     boolean success)
- Specified by:
 setAuthenticationOutcome in interface SEPasswordListener
 
 
clearPasswords
public void clearPasswords()
- Specified by:
 clearPasswords in interface SEPasswordListener
 
 
trimForDisplay
protected java.lang.String trimForDisplay(java.net.URL url)