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 booleanprivate TorrentDownloaderImplprivate booleanprivate booleanprivate final Stringprivate booleanprivate booleanprivate Stringprivate final Stringprivate final Mapprivate Stringprivate Stringprivate booleanprivate final StringFields inherited from interface TorrentDownloader
STATE_CANCELLED, STATE_DOWNLOADING, STATE_DUPLICATE, STATE_ERROR, STATE_FINISHED, STATE_INIT, STATE_NON_INIT, STATE_START -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTorrentDownloadRetrier(TorrentDownloaderCallBackInterface _callback, String _url, String _referrer, Map _request_properties, String _fileordir) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the download.booleanintGets the state of the TorrentDownloader.getError()Returns the error string if one occured, "Ok" otherwise.getFile()Returns theFilethe TorrentDownloader downloads to.byte[]intintReturns the amount downloaded in per cent.intReturns the amount downloaded in bytes.getURL()Returns the URL downloaded from.booleanvoidsetDeleteFileOnCancel(boolean deleteFileOnCancel) voidsetDownloadPath(String path, String file) Changes the path and filename to download to.voidsetIgnoreReponseCode(boolean ignoreReponseCode) voidstart()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:TorrentDownloaderStarts the download.- Specified by:
startin interfaceTorrentDownloader
-
cancel
public void cancel()Description copied from interface:TorrentDownloaderCancels the download.- Specified by:
cancelin interfaceTorrentDownloader
-
setDownloadPath
Description copied from interface:TorrentDownloaderChanges the path and filename to download to. You can givenullfor 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:
setDownloadPathin interfaceTorrentDownloader- Parameters:
path- The path for download.file- The file name for download.
-
getDownloadState
public int getDownloadState()Description copied from interface:TorrentDownloaderGets the state of the TorrentDownloader.- Specified by:
getDownloadStatein interfaceTorrentDownloader
-
getFile
Description copied from interface:TorrentDownloaderReturns theFilethe TorrentDownloader downloads to.- Specified by:
getFilein interfaceTorrentDownloader
-
getPercentDone
public int getPercentDone()Description copied from interface:TorrentDownloaderReturns the amount downloaded in per cent. Gives -1 if total size is not available.- Specified by:
getPercentDonein interfaceTorrentDownloader
-
getTotalRead
public int getTotalRead()Description copied from interface:TorrentDownloaderReturns the amount downloaded in bytes.- Specified by:
getTotalReadin interfaceTorrentDownloader
-
getError
Description copied from interface:TorrentDownloaderReturns the error string if one occured, "Ok" otherwise.- Specified by:
getErrorin interfaceTorrentDownloader
-
getStatus
- Specified by:
getStatusin interfaceTorrentDownloader
-
getURL
Description copied from interface:TorrentDownloaderReturns the URL downloaded from.- Specified by:
getURLin interfaceTorrentDownloader
-
getLastReadCount
public int getLastReadCount()- Specified by:
getLastReadCountin interfaceTorrentDownloader- Returns:
-
getLastReadBytes
public byte[] getLastReadBytes()- Specified by:
getLastReadBytesin interfaceTorrentDownloader- Returns:
-
getDeleteFileOnCancel
public boolean getDeleteFileOnCancel()- Specified by:
getDeleteFileOnCancelin interfaceTorrentDownloader- Returns:
-
setDeleteFileOnCancel
public void setDeleteFileOnCancel(boolean deleteFileOnCancel) - Specified by:
setDeleteFileOnCancelin interfaceTorrentDownloader- Parameters:
deleteFileOnCancel-
-
isIgnoreReponseCode
public boolean isIgnoreReponseCode()- Specified by:
isIgnoreReponseCodein interfaceTorrentDownloader- Returns:
-
setIgnoreReponseCode
public void setIgnoreReponseCode(boolean ignoreReponseCode) - Specified by:
setIgnoreReponseCodein interfaceTorrentDownloader- Parameters:
ignoreReponseCode-
-