Class TorrentDownloaderFactory.TorrentDownloadRetrier
java.lang.Object
com.biglybt.core.torrentdownloader.TorrentDownloaderFactory.TorrentDownloadRetrier
- All Implemented Interfaces:
TorrentDownloader
- Enclosing class:
TorrentDownloaderFactory
private static class TorrentDownloaderFactory.TorrentDownloadRetrier
extends Object
implements TorrentDownloader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private TorrentDownloaderImpl
private boolean
private boolean
private final String
private boolean
private boolean
private String
private final String
private final Map
private String
private String
private boolean
private final String
Fields inherited from interface com.biglybt.core.torrentdownloader.TorrentDownloader
STATE_CANCELLED, STATE_DOWNLOADING, STATE_DUPLICATE, STATE_ERROR, STATE_FINISHED, STATE_INIT, STATE_NON_INIT, STATE_START
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TorrentDownloadRetrier
(TorrentDownloaderCallBackInterface _callback, String _url, String _referrer, Map _request_properties, String _fileordir) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels the download.boolean
int
Gets the state of the TorrentDownloader.getError()
Returns the error string if one occured, "Ok" otherwise.getFile()
Returns theFile
the TorrentDownloader downloads to.byte[]
int
int
Returns the amount downloaded in per cent.int
Returns the amount downloaded in bytes.getURL()
Returns the URL downloaded from.boolean
void
setDeleteFileOnCancel
(boolean deleteFileOnCancel) void
setDownloadPath
(String path, String file) Changes the path and filename to download to.void
setIgnoreReponseCode
(boolean ignoreReponseCode) void
start()
Starts the download.
-
Field Details
-
url
-
referrer
-
request_properties
-
fileordir
-
delegate
-
cancelled
private volatile boolean cancelled -
sdp_set
private volatile boolean sdp_set -
sdp_path
-
sdp_file
-
dfoc_set
private volatile boolean dfoc_set -
dfoc
private volatile boolean dfoc -
irc_set
private volatile boolean irc_set -
irc
private volatile boolean irc -
original_error
-
-
Constructor Details
-
TorrentDownloadRetrier
private TorrentDownloadRetrier(TorrentDownloaderCallBackInterface _callback, String _url, String _referrer, Map _request_properties, String _fileordir)
-
-
Method Details
-
start
public void start()Description copied from interface:TorrentDownloader
Starts the download.- Specified by:
start
in interfaceTorrentDownloader
-
cancel
public void cancel()Description copied from interface:TorrentDownloader
Cancels the download.- Specified by:
cancel
in interfaceTorrentDownloader
-
setDownloadPath
Description copied from interface:TorrentDownloader
Changes the path and filename to download to. You can givenull
for either to leave it as is. (These are initialized to either the path/filename given viaTorrentDownloaderFactory.download(Managed)
or to the default torrent save directory (path) and the filename the server proposes (file). This function does nothing after the download has been started.- Specified by:
setDownloadPath
in interfaceTorrentDownloader
- Parameters:
path
- The path for download.file
- The file name for download.
-
getDownloadState
public int getDownloadState()Description copied from interface:TorrentDownloader
Gets the state of the TorrentDownloader.- Specified by:
getDownloadState
in interfaceTorrentDownloader
-
getFile
Description copied from interface:TorrentDownloader
Returns theFile
the TorrentDownloader downloads to.- Specified by:
getFile
in interfaceTorrentDownloader
-
getPercentDone
public int getPercentDone()Description copied from interface:TorrentDownloader
Returns the amount downloaded in per cent. Gives -1 if total size is not available.- Specified by:
getPercentDone
in interfaceTorrentDownloader
-
getTotalRead
public int getTotalRead()Description copied from interface:TorrentDownloader
Returns the amount downloaded in bytes.- Specified by:
getTotalRead
in interfaceTorrentDownloader
-
getError
Description copied from interface:TorrentDownloader
Returns the error string if one occured, "Ok" otherwise.- Specified by:
getError
in interfaceTorrentDownloader
-
getStatus
- Specified by:
getStatus
in interfaceTorrentDownloader
-
getURL
Description copied from interface:TorrentDownloader
Returns the URL downloaded from.- Specified by:
getURL
in interfaceTorrentDownloader
-
getLastReadCount
public int getLastReadCount()- Specified by:
getLastReadCount
in interfaceTorrentDownloader
- Returns:
-
getLastReadBytes
public byte[] getLastReadBytes()- Specified by:
getLastReadBytes
in interfaceTorrentDownloader
- Returns:
-
getDeleteFileOnCancel
public boolean getDeleteFileOnCancel()- Specified by:
getDeleteFileOnCancel
in interfaceTorrentDownloader
- Returns:
-
setDeleteFileOnCancel
public void setDeleteFileOnCancel(boolean deleteFileOnCancel) - Specified by:
setDeleteFileOnCancel
in interfaceTorrentDownloader
- Parameters:
deleteFileOnCancel
-
-
isIgnoreReponseCode
public boolean isIgnoreReponseCode()- Specified by:
isIgnoreReponseCode
in interfaceTorrentDownloader
- Returns:
-
setIgnoreReponseCode
public void setIgnoreReponseCode(boolean ignoreReponseCode) - Specified by:
setIgnoreReponseCode
in interfaceTorrentDownloader
- Parameters:
ignoreReponseCode
-
-