Interface TorrentDownloader
- All Known Implementing Classes:
TorrentDownloaderFactory.TorrentDownloadRetrier
,TorrentDownloaderImpl
public interface TorrentDownloader
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
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
-
STATE_NON_INIT
static final int STATE_NON_INIT- See Also:
-
STATE_INIT
static final int STATE_INIT- See Also:
-
STATE_START
static final int STATE_START- See Also:
-
STATE_DOWNLOADING
static final int STATE_DOWNLOADING- See Also:
-
STATE_FINISHED
static final int STATE_FINISHED- See Also:
-
STATE_ERROR
static final int STATE_ERROR- See Also:
-
STATE_DUPLICATE
static final int STATE_DUPLICATE- See Also:
-
STATE_CANCELLED
static final int STATE_CANCELLED- See Also:
-
-
Method Details
-
start
void start()Starts the download. -
cancel
void cancel()Cancels the download. -
setDownloadPath
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.- Parameters:
path
- The path for download.file
- The file name for download.
-
getDownloadState
int getDownloadState()Gets the state of the TorrentDownloader. -
getFile
File getFile()Returns theFile
the TorrentDownloader downloads to. -
getPercentDone
int getPercentDone()Returns the amount downloaded in per cent. Gives -1 if total size is not available. -
getTotalRead
int getTotalRead()Returns the amount downloaded in bytes. -
getError
String getError()Returns the error string if one occured, "Ok" otherwise. -
getStatus
String getStatus() -
getURL
String getURL()Returns the URL downloaded from. -
getLastReadCount
int getLastReadCount()- Returns:
-
getLastReadBytes
byte[] getLastReadBytes()- Returns:
-
getDeleteFileOnCancel
boolean getDeleteFileOnCancel()- Returns:
-
setDeleteFileOnCancel
void setDeleteFileOnCancel(boolean deleteFileOnCancel) - Parameters:
deleteFileOnCancel
-
-
isIgnoreReponseCode
boolean isIgnoreReponseCode()- Returns:
- Since:
- 4.0.0.5
-
setIgnoreReponseCode
void setIgnoreReponseCode(boolean ignoreReponseCode) - Parameters:
ignoreReponseCode
-- Since:
- 4.0.0.5
-