Class TorrentDownloaderImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.torrent.TorrentDownloaderImpl
-
- All Implemented Interfaces:
TorrentDownloader
public class TorrentDownloaderImpl extends java.lang.Object implements TorrentDownloader
-
-
Field Summary
Fields Modifier and Type Field Description protected ResourceDownloader
_downloader
protected boolean
encoding_requested
private static LogIDs
LOGID
protected TorrentManagerImpl
manager
protected java.lang.String
requested_encoding
protected boolean
set_encoding
protected java.net.URL
url
-
Constructor Summary
Constructors Modifier Constructor Description protected
TorrentDownloaderImpl(TorrentManagerImpl _manager, java.net.URL _url)
protected
TorrentDownloaderImpl(TorrentManagerImpl _manager, java.net.URL _url, java.lang.String _user_name, java.lang.String _password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Torrent
download()
Downloads and prompts the user/guesses the torrent encodingTorrent
download(java.lang.String encoding)
Downloads and tries to use the supplied encoding.private Torrent
downloadSupport(ResourceDownloader downloader)
java.lang.Object
getRequestProperty(java.lang.String key)
void
setRequestProperty(java.lang.String key, java.lang.Object value)
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
manager
protected TorrentManagerImpl manager
-
url
protected java.net.URL url
-
_downloader
protected ResourceDownloader _downloader
-
encoding_requested
protected boolean encoding_requested
-
requested_encoding
protected java.lang.String requested_encoding
-
set_encoding
protected boolean set_encoding
-
-
Constructor Detail
-
TorrentDownloaderImpl
protected TorrentDownloaderImpl(TorrentManagerImpl _manager, java.net.URL _url)
-
TorrentDownloaderImpl
protected TorrentDownloaderImpl(TorrentManagerImpl _manager, java.net.URL _url, java.lang.String _user_name, java.lang.String _password)
-
-
Method Detail
-
download
public Torrent download() throws TorrentException
Description copied from interface:TorrentDownloader
Downloads and prompts the user/guesses the torrent encoding- Specified by:
download
in interfaceTorrentDownloader
- Returns:
- Throws:
TorrentException
-
downloadSupport
private Torrent downloadSupport(ResourceDownloader downloader) throws TorrentException
- Throws:
TorrentException
-
download
public Torrent download(java.lang.String encoding) throws TorrentException
Description copied from interface:TorrentDownloader
Downloads and tries to use the supplied encoding. If the supplied encoding isn't valed then a TorrentEncodingException is thrown detailing the valid ones- Specified by:
download
in interfaceTorrentDownloader
- Parameters:
encoding
- use "System" for system encoding- Returns:
- Throws:
TorrentException
-
setRequestProperty
public void setRequestProperty(java.lang.String key, java.lang.Object value) throws TorrentException
- Specified by:
setRequestProperty
in interfaceTorrentDownloader
- Parameters:
key
- "URL_Cookie" to set cookies- Throws:
TorrentException
-
getRequestProperty
public java.lang.Object getRequestProperty(java.lang.String key) throws TorrentException
- Specified by:
getRequestProperty
in interfaceTorrentDownloader
- Parameters:
key
- "URL_Cookie" to get cookies- Returns:
- Throws:
TorrentException
-
-