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,
URL _url)
|
ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
URL _url,
boolean _auth_supplied,
String _user_name,
String _password)
|
ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
URL _url,
byte[] _data,
boolean _auth_supplied,
String _user_name,
String _password)
|
ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
URL _url,
String _user_name,
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,
URL _url)
ResourceDownloaderURLImpl
public ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
URL _url,
String _user_name,
String _password)
ResourceDownloaderURLImpl
public ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
URL _url,
boolean _auth_supplied,
String _user_name,
String _password)
ResourceDownloaderURLImpl
public ResourceDownloaderURLImpl(ResourceDownloaderBaseImpl _parent,
URL _url,
byte[] _data,
boolean _auth_supplied,
String _user_name,
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(Proxy proxy)
setAutoPluginProxy
protected void setAutoPluginProxy()
getURL
protected URL getURL()
getName
public 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(String name,
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 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(URLConnection con,
boolean use_compression)
getRequestProperties
protected void getRequestProperties(URLConnection con)
getAuthentication
public PasswordAuthentication getAuthentication(String realm,
URL tracker)
- Specified by:
getAuthentication
in interface SEPasswordListener
setAuthenticationOutcome
public void setAuthenticationOutcome(String realm,
URL tracker,
boolean success)
- Specified by:
setAuthenticationOutcome
in interface SEPasswordListener
clearPasswords
public void clearPasswords()
- Specified by:
clearPasswords
in interface SEPasswordListener
trimForDisplay
protected String trimForDisplay(URL url)