Class LWSDownload
java.lang.Object
com.biglybt.core.logging.LogRelation
com.biglybt.core.lws.LWSDownload
- All Implemented Interfaces:
Download, DownloadEventNotifier, DownloadStub, Taggable
-
Nested Class Summary
Nested classes/interfaces inherited from interface Download
Download.SeedingRankNested classes/interfaces inherited from interface DownloadStub
DownloadStub.DownloadStubEx, DownloadStub.DownloadStubFile -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final DownloadAnnounceResultImplprivate final TRTrackerAnnouncerprivate final LightWeightSeedprivate final DownloadScrapeResultprivate final Mapprivate final MapFields inherited from interface Download
FLAG_ALLOW_PERMITTED_PEER_SOURCE_CHANGES, FLAG_DISABLE_AUTO_FILE_MOVE, FLAG_DISABLE_IP_FILTER, FLAG_DISABLE_STOP_AFTER_ALLOC, FLAG_DO_NOT_DELETE_DATA_ON_REMOVE, FLAG_ERROR_REPORTED, FLAG_FORCE_DIRECT_DELETE, FLAG_INITIAL_NETWORKS_SET, FLAG_LIGHT_WEIGHT, FLAG_LOW_NOISE, FLAG_METADATA_DOWNLOAD, FLAG_MOVE_ON_COMPLETION_DONE, FLAG_ONLY_EVER_SEEDED, FLAG_SCAN_INCOMPLETE_PIECES, FLAG_SEQUENTIAL_DOWNLOAD, ST_DOWNLOADING, ST_ERROR, ST_NAMES, ST_PREPARING, ST_QUEUED, ST_READY, ST_SEEDING, ST_STOPPED, ST_STOPPING, ST_WAITING, UD_KEY_QUEUE_REASON, UD_KEY_START_REASON, UD_KEY_STOP_REASON -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLWSDownload(LightWeightSeed _lws, TRTrackerAnnouncer _announcer) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener that will be invoked when a request is made to activate a torrent.voidaddAttributeListener(DownloadAttributeListener l, TorrentAttribute attr, int event_type) Adds a listener that will be informed of when attributes on a download have been read / modified.voidAdds a listener that will be informed when a download moves into a completed state.voidAdds a listener that will be informed when a download is about to be removed.voidAdds a listener that will be informed of changes to a download's state.voidAdds a listener that will be informed of when peer managers have been added / removed for a download.voidaddRateLimiter(RateLimiter limiter, boolean is_upload) voidAdds a listener that will be informed when the latest announce/scrape results change.voidaddTrackerListener(DownloadTrackerListener l, boolean immediateTrigger) Adds a listener that will be informed when the latest announce/scrape results change.Returns aSaveLocationChangeobject describing the appropriate location for the download (and torrent file) to exist in, based on the download's completion state, the for-completion rules in place, and theSaveLocationManagerobject in use.booleanTests whether or not a download can be removed.booleanReturns true if the client will allow the data files for the torrent to be moved.booleanvoidApply the changes in the givenSaveLocationChangeobject - this includes moving torrent and data file data.Gives access to the current activation state.getAggregatedScrapeResult(boolean cache) getAttribute(TorrentAttribute attribute) Gets an attribute of this download.booleanGets the value of the given attribute from the download.Returns the name of the Categorylongreturns the time this download was created in millisecondsReturn the disk manager, null if its not runningintReturn the number of DiskManagerFile objectsReturns info about the torrent's files.getDiskManagerFileInfo(int i) Returns file info for the given index.byte[]Get the local peerID advertised to the download swarm.intGet the max download rate allowed for this download.When the download state is ERROR this method returns the error detailsbooleangetFlag(long flag) Get the flag valuelonggetFlags()get all the flags as a bitmapintGets the value of the given attribute from the download.Gives access to the last announce result received from the tracker for the downloadGives access to the last scrape result received from the tracker for the downloadString[]getListAttribute(TorrentAttribute attribute) longGets the value of the given attribute from the download.getLWS()getMapAttribute(TorrentAttribute attribute) intGet the max download rate allowed for this downloadgetName()Returns the name of the torrent.return the current peer manager for the download.intReturns the current position in the queue Completed and Incompleted downloads have seperate position sets.Returns the "Primary" file in the download.Object[]Query this class for a reference to another class that it may holdA short description of what your class holds that can be printed by the loggerThis returns the full save path for the download.The torrents with the highest rankings will be seeded first.intgetState()get state from above ST_ setgetStats()Gives access to the download's statisticsintFor the STOPPING state this method gives the state that is being transited too (STOPPED, QUEUED or ERROR)getTags()Each download has a corresponding torrentReturns the full file path and name of the .torrent filebyte[]longintGet the max upload rate allowed for this download.getUserData(Object key) get user-defined key/valuebooleanhasAttribute(TorrentAttribute name) Returnstrueif the download has an explicit value stored for the given attribute.voidSee lifecycle description abovebooleanWhen a download is completed it is rechecked (if the option is enabled).booleanIndicates if the download has completed or not, exluding any files marked as Do No DownloadbooleanisComplete(boolean bIncludeDND) Indicates if the download has completed or notbooleanRetrieves whether the download is force startedbooleanIs advanced AZ messaging enabled for this download.booleanisMoving()Returns true if the download is currently in the process of having its datafiles movedbooleanisPaused()booleanDownloads can be persistent (be remembered across client sessions), or non-persistent.booleanbooleanWhen a download is "start-stop locked" it means that seeding rules shouldn't start or stop the download as it is under manual controlbooleanisStub()voidmoveDataFiles(File new_parent_dir) Move a download's data files to a new location.voidmoveDataFiles(File new_parent_dir, String new_name) Move a download's data files to a new location, and rename the download at the same time.voidmoveDown()Moves the download down one positionvoidmoveTo(int position) Moves a download and re-orders the others appropriately.voidmoveTorrentFile(File new_parent_dir) Move a download's torrent file to a new location.voidmoveUp()Moves the download position up oneprotected voidvoidpause()Pause the downloadvoidPerforms a complete recheck of the downloaded data Download must be in stopped, queued or error state Action is performed asynchronously and will progress the download through states PREPARING back to the relevant statevoidremove()Removes a download.voidremove(boolean delete_torrent, boolean delete_data) Same as "remove" but, if successful, deletes the torrent and/or datavoidRemoves a listener object added via theDownloadEventNotifier.addActivationListener(DownloadActivationListener)method.voidremoveAttributeListener(DownloadAttributeListener l, TorrentAttribute attr, int event_type) voidRemoves a listener object removed via theDownloadEventNotifier.addCompletionListener(DownloadCompletionListener)method.voidRemoves a listener object added via theDownloadEventNotifier.addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener)method.voidRemoves a listener object added via theDownloadEventNotifier.addListener(DownloadListener)method.voidRemoves a listener object added via theDownloadEventNotifier.addPeerListener(DownloadPeerListener)method.voidremoveRateLimiter(RateLimiter limiter, boolean is_upload) voidRemoves a listener object added via theDownloadEventNotifier.addTrackerListener(DownloadTrackerListener)orDownloadEventNotifier.addTrackerListener(DownloadTrackerListener, boolean)method.voidrenameDownload(String name) Renames the file (for a single file torrent) or directory (for a multi file torrent) where the download is being saved to.voidrequest a tracker announcevoidrequestTrackerAnnounce(boolean immediate) request a tracker announcevoidrequestTrackerScrape(boolean immediate) request a tracker announcevoidrestart()See lifecycle description abovevoidresume()Resume the download if pausedvoidvoidsetAttribute(TorrentAttribute attribute, String value) Sets an attribute of this download.voidsetBooleanAttribute(TorrentAttribute name, boolean value) Sets a boolean attribute on this download.voidsetCategory(String sName) Sets the category for the downloadvoidsetDownloadRateLimitBytesPerSecond(int max_rate_bps) Set the max download rate allowed for this download.voidsetFlag(long flag, boolean value) Set the flag value.voidsetForceStart(boolean forceStart) Set the forcestart state of the downloadvoidsetIntAttribute(TorrentAttribute name, int value) Sets an integer attribute on this download.voidsetListAttribute(TorrentAttribute attribute, String[] value) voidsetLongAttribute(TorrentAttribute name, long value) Sets a long attribute on this download.voidsetMapAttribute(TorrentAttribute attribute, Map value) voidsetMaximumDownloadKBPerSecond(int kb) Sets the maximum download speed in bytes per second.voidsetMessagingEnabled(boolean enabled) Enable or disable advanced AZ messaging for this download.voidsetPosition(int newPosition) Sets the position in the queue Completed and Incompleted downloads have seperate position setsvoidsetQueueReason(String reason) voidsetScrapeResult(DownloadScrapeResult result) voidThe torrents with the highest rankings will be seeded first.voidsetStartReason(String reason) voidsetStopReason(String reason) voidsetUploadRateLimitBytesPerSecond(int max_rate_bps) Set the max upload rate allowed for this download.voidsetUserData(Object key, Object data) set user defined value.voidstart()See lifecycle description abovevoidstartDownload(boolean force) Simple method to start the download.voidstop()See lifecycle description abovevoidSee lifecycle description abovevoidstopAndRemove(boolean delete_torrent, boolean delete_data) voidSimple method to stop the download.stubbify()Methods inherited from class LogRelation
propogatedRelationText, queryForClassMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Download
getAggregatedScrapeResultMethods inherited from interface DownloadStub
getMainTracker
-
Field Details
-
lws
-
announcer
-
announce_result
-
user_data
-
torrent_attributes
-
scrape_result
-
-
Constructor Details
-
LWSDownload
-
-
Method Details
-
getLWS
-
getState
-
getSubState
public int getSubState()Description copied from interface:DownloadFor the STOPPING state this method gives the state that is being transited too (STOPPED, QUEUED or ERROR)- Specified by:
getSubStatein interfaceDownload- Returns:
-
getErrorStateDetails
Description copied from interface:DownloadWhen the download state is ERROR this method returns the error details- Specified by:
getErrorStateDetailsin interfaceDownload- Returns:
-
setFlag
-
getFlag
-
getFlags
-
calculateDefaultDownloadLocation
Description copied from interface:DownloadReturns aSaveLocationChangeobject describing the appropriate location for the download (and torrent file) to exist in, based on the download's completion state, the for-completion rules in place, and theSaveLocationManagerobject in use.- Specified by:
calculateDefaultDownloadLocationin interfaceDownload
-
getTorrent
Description copied from interface:DownloadEach download has a corresponding torrent- Specified by:
getTorrentin interfaceDownload- Specified by:
getTorrentin interfaceDownloadStub- Returns:
- the download's torrent
-
initialize
Description copied from interface:DownloadSee lifecycle description above- Specified by:
initializein interfaceDownload- Throws:
DownloadException
-
start
Description copied from interface:DownloadSee lifecycle description above- Specified by:
startin interfaceDownload- Throws:
DownloadException
-
startDownload
public void startDownload(boolean force) Description copied from interface:DownloadSimple method to start the download. Will not raise an error if it didn't work, or if the download is already running.- Specified by:
startDownloadin interfaceDownload- Parameters:
force- true to force the download to be started.
-
stopDownload
public void stopDownload()Description copied from interface:DownloadSimple method to stop the download. Will not raise an error if it didn't work, or if the download is already stopped.- Specified by:
stopDownloadin interfaceDownload
-
stop
Description copied from interface:DownloadSee lifecycle description above- Specified by:
stopin interfaceDownload- Throws:
DownloadException
-
setStartReason
- Specified by:
setStartReasonin interfaceDownload
-
getStartReason
- Specified by:
getStartReasonin interfaceDownload
-
setStopReason
- Specified by:
setStopReasonin interfaceDownload
-
getStopReason
- Specified by:
getStopReasonin interfaceDownload
-
setQueueReason
- Specified by:
setQueueReasonin interfaceDownload
-
getQueueReason
- Specified by:
getQueueReasonin interfaceDownload
-
stopAndQueue
Description copied from interface:DownloadSee lifecycle description above- Specified by:
stopAndQueuein interfaceDownload- Throws:
DownloadException
-
restart
Description copied from interface:DownloadSee lifecycle description above- Specified by:
restartin interfaceDownload- Throws:
DownloadException
-
pause
-
resume
-
recheckData
Description copied from interface:DownloadPerforms a complete recheck of the downloaded data Download must be in stopped, queued or error state Action is performed asynchronously and will progress the download through states PREPARING back to the relevant state- Specified by:
recheckDatain interfaceDownload- Throws:
DownloadException
-
isStartStopLocked
public boolean isStartStopLocked()Description copied from interface:DownloadWhen a download is "start-stop locked" it means that seeding rules shouldn't start or stop the download as it is under manual control- Specified by:
isStartStopLockedin interfaceDownload- Returns:
- True if download is locked and should not be started or stopped
-
isForceStart
public boolean isForceStart()Description copied from interface:DownloadRetrieves whether the download is force started- Specified by:
isForceStartin interfaceDownload- Returns:
- True if download is force started. False if not.
-
setForceStart
public void setForceStart(boolean forceStart) Description copied from interface:DownloadSet the forcestart state of the download- Specified by:
setForceStartin interfaceDownload- Parameters:
forceStart- True - Download will start, despite any Start/Stop rules/limits
False - Turn forcestart state off. Download may or may not stop, depending on Start/Stop rules/limits
-
isPaused
-
getName
Description copied from interface:DownloadReturns the name of the torrent. Similar to Torrent.getName() and is useful if getTorrent() returns null and you still need the name.- Specified by:
getNamein interfaceDownload- Specified by:
getNamein interfaceDownloadStub- Returns:
- name of the torrent
-
getTorrentFileName
Description copied from interface:DownloadReturns the full file path and name of the .torrent file- Specified by:
getTorrentFileNamein interfaceDownload- Returns:
- File name of the torrent.
-
getAttribute
Description copied from interface:DownloadGets an attribute of this download. For category use the Category torrent attribute- Specified by:
getAttributein interfaceDownload- Parameters:
attribute-- Returns:
-
setAttribute
Description copied from interface:DownloadSets an attribute of this download. For category use the Category torrent attribute- Specified by:
setAttributein interfaceDownload- Parameters:
attribute- Previously created attributevalue- Value to store. null to remove attribute
-
getListAttribute
- Specified by:
getListAttributein interfaceDownload
-
setListAttribute
- Specified by:
setListAttributein interfaceDownload- Parameters:
attribute-value-
-
setMapAttribute
- Specified by:
setMapAttributein interfaceDownload- Parameters:
attribute-value- must be bencodable - key is string, value is Map, List, Long or byte[]
-
getMapAttribute
- Specified by:
getMapAttributein interfaceDownload
-
setIntAttribute
Description copied from interface:DownloadSets an integer attribute on this download.- Specified by:
setIntAttributein interfaceDownload
-
getIntAttribute
Description copied from interface:DownloadGets the value of the given attribute from the download. If no value is set, then0will be returned.- Specified by:
getIntAttributein interfaceDownload
-
setLongAttribute
Description copied from interface:DownloadSets a long attribute on this download.- Specified by:
setLongAttributein interfaceDownload- Specified by:
setLongAttributein interfaceDownloadStub
-
getLongAttribute
Description copied from interface:DownloadGets the value of the given attribute from the download. If no value is set, then0will be returned.- Specified by:
getLongAttributein interfaceDownload- Specified by:
getLongAttributein interfaceDownloadStub- Parameters:
name-- Returns:
-
setBooleanAttribute
Description copied from interface:DownloadSets a boolean attribute on this download.- Specified by:
setBooleanAttributein interfaceDownload
-
getBooleanAttribute
Description copied from interface:DownloadGets the value of the given attribute from the download. If no value is set, thenfalsewill be returned.- Specified by:
getBooleanAttributein interfaceDownload
-
hasAttribute
Description copied from interface:DownloadReturnstrueif the download has an explicit value stored for the given attribute.- Specified by:
hasAttributein interfaceDownload
-
addAttributeListener
public void addAttributeListener(DownloadAttributeListener l, TorrentAttribute attr, int event_type) Description copied from interface:DownloadEventNotifierAdds a listener that will be informed of when attributes on a download have been read / modified.- Specified by:
addAttributeListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.attr- The torrent attribute to be notified about.event_type- The type of event to be notified of, as defined onDownloadAttributeListener.
-
removeAttributeListener
public void removeAttributeListener(DownloadAttributeListener l, TorrentAttribute attr, int event_type) Description copied from interface:DownloadEventNotifierRemoves a listener object added via theinvalid input: 'method. @param l The listener to remove. @param attr The torrent attribute which it registered with. @param event_type The type of event which it registered with. @since 3.0.3.5'- Specified by:
removeAttributeListenerin interfaceDownloadEventNotifier
-
getCategoryName
Description copied from interface:DownloadReturns the name of the Category- Specified by:
getCategoryNamein interfaceDownload- Returns:
- name of the category
-
setCategory
Description copied from interface:DownloadSets the category for the download- Specified by:
setCategoryin interfaceDownload- Parameters:
sName- Category name
-
getTags
-
remove
Description copied from interface:DownloadRemoves a download. The download must be stopped or in error. Removal may fail if another component does not want the removal to occur - in this case a "veto" exception is thrown- Specified by:
removein interfaceDownload- Specified by:
removein interfaceDownloadStub- Throws:
DownloadExceptionDownloadRemovalVetoException
-
remove
public void remove(boolean delete_torrent, boolean delete_data) throws DownloadException, DownloadRemovalVetoException Description copied from interface:DownloadSame as "remove" but, if successful, deletes the torrent and/or data- Specified by:
removein interfaceDownload- Parameters:
delete_torrent-delete_data-- Throws:
DownloadExceptionDownloadRemovalVetoException
-
stopAndRemove
public void stopAndRemove(boolean delete_torrent, boolean delete_data) throws DownloadException, DownloadRemovalVetoException - Specified by:
stopAndRemovein interfaceDownload- Throws:
DownloadExceptionDownloadRemovalVetoException
-
isRemoved
-
getPosition
public int getPosition()Description copied from interface:DownloadReturns the current position in the queue Completed and Incompleted downloads have seperate position sets. This means we can have a position x for Completed, and position x for Incompleted.- Specified by:
getPositionin interfaceDownload
-
getCreationTime
public long getCreationTime()Description copied from interface:Downloadreturns the time this download was created in milliseconds- Specified by:
getCreationTimein interfaceDownload- Returns:
-
setPosition
public void setPosition(int newPosition) Description copied from interface:DownloadSets the position in the queue Completed and Incompleted downloads have seperate position sets- Specified by:
setPositionin interfaceDownload
-
moveUp
-
moveDown
-
moveTo
public void moveTo(int position) Description copied from interface:DownloadMoves a download and re-orders the others appropriately. Note that setPosition does not do this, it merely sets the position thus making it possible, for example, for two downloads to have the same position -
canBeRemoved
Description copied from interface:DownloadTests whether or not a download can be removed. Due to synchronization issues it is possible for a download to report OK here but still fail removal.- Specified by:
canBeRemovedin interfaceDownload- Returns:
- Throws:
DownloadRemovalVetoException
-
setAnnounceResult
- Specified by:
setAnnounceResultin interfaceDownload
-
setScrapeResult
- Specified by:
setScrapeResultin interfaceDownload
-
getLastAnnounceResult
Description copied from interface:DownloadGives access to the last announce result received from the tracker for the download- Specified by:
getLastAnnounceResultin interfaceDownload- Returns:
-
getLastScrapeResult
Description copied from interface:DownloadGives access to the last scrape result received from the tracker for the download- Specified by:
getLastScrapeResultin interfaceDownload- Returns:
- a non-null DownloadScrapeResult
-
getAggregatedScrapeResult
- Specified by:
getAggregatedScrapeResultin interfaceDownload
-
getActivationState
Description copied from interface:DownloadGives access to the current activation state. Note that we currently only fire the activation listener on an increase in activation requirements. This method however gives the current view of the state and takes into account decreases too- Specified by:
getActivationStatein interfaceDownload- Returns:
-
getStats
Description copied from interface:DownloadGives access to the download's statistics -
isPersistent
public boolean isPersistent()Description copied from interface:DownloadDownloads can be persistent (be remembered across client sessions), or non-persistent.- Specified by:
isPersistentin interfaceDownload- Returns:
- true - persistent
false - non-persistent
-
setMaximumDownloadKBPerSecond
public void setMaximumDownloadKBPerSecond(int kb) Description copied from interface:DownloadSets the maximum download speed in bytes per second. 0 -> unlimited- Specified by:
setMaximumDownloadKBPerSecondin interfaceDownload- Parameters:
kb-
-
getMaximumDownloadKBPerSecond
public int getMaximumDownloadKBPerSecond()Description copied from interface:DownloadGet the max download rate allowed for this download- Specified by:
getMaximumDownloadKBPerSecondin interfaceDownload- Returns:
- upload rate in KB/s, 0 for unlimited
Since 4.8.1.3: -1 for download disabled
-
addRateLimiter
- Specified by:
addRateLimiterin interfaceDownload- Parameters:
limiter- create via ConnectionManageris_upload- false -> download limit
-
removeRateLimiter
- Specified by:
removeRateLimiterin interfaceDownload
-
getUploadRateLimitBytesPerSecond
public int getUploadRateLimitBytesPerSecond()Description copied from interface:DownloadGet the max upload rate allowed for this download.- Specified by:
getUploadRateLimitBytesPerSecondin interfaceDownload- Returns:
- upload rate in bytes per second, 0 for unlimited, -1 for upload disabled
-
setUploadRateLimitBytesPerSecond
public void setUploadRateLimitBytesPerSecond(int max_rate_bps) Description copied from interface:DownloadSet the max upload rate allowed for this download.- Specified by:
setUploadRateLimitBytesPerSecondin interfaceDownload- Parameters:
max_rate_bps- limit in bytes per second, 0 for unlimited, -1 for upload disabled
-
getDownloadRateLimitBytesPerSecond
public int getDownloadRateLimitBytesPerSecond()Description copied from interface:DownloadGet the max download rate allowed for this download.- Specified by:
getDownloadRateLimitBytesPerSecondin interfaceDownload- Returns:
- upload rate in bytes per second, 0 for unlimited, -1 for download disabled
-
setDownloadRateLimitBytesPerSecond
public void setDownloadRateLimitBytesPerSecond(int max_rate_bps) Description copied from interface:DownloadSet the max download rate allowed for this download.- Specified by:
setDownloadRateLimitBytesPerSecondin interfaceDownload- Parameters:
max_rate_bps- limit in bytes per second, 0 for unlimited, -1 for dowmload disabled
-
isComplete
public boolean isComplete()Description copied from interface:DownloadIndicates if the download has completed or not, exluding any files marked as Do No Download- Specified by:
isCompletein interfaceDownload- Returns:
- Download Complete status
-
isComplete
public boolean isComplete(boolean bIncludeDND) Description copied from interface:DownloadIndicates if the download has completed or not- Specified by:
isCompletein interfaceDownload- Parameters:
bIncludeDND- Whether to include DND files when determining completion state- Returns:
- Download Complete status
-
isChecking
public boolean isChecking()Description copied from interface:DownloadWhen a download is completed it is rechecked (if the option is enabled). This method returns true during this phase (at which time the status will be seeding)- Specified by:
isCheckingin interfaceDownload- Returns:
-
isMoving
-
getSavePath
Description copied from interface:DownloadThis returns the full save path for the download. If the download is a simple torrent, this will be the full path of the file being downloaded. If the download is a multiple file torrent, this will be the path to the directory containing all the files in the torrent.- Specified by:
getSavePathin interfaceDownload- Specified by:
getSavePathin interfaceDownloadStub- Returns:
- Full save path for this download.
-
moveDataFiles
Description copied from interface:DownloadMove a download's data files to a new location. If a download is running, it will be automatically paused and resumed afterwards - be aware that this behaviour may generate stateChanged events being fired.- Specified by:
moveDataFilesin interfaceDownload- Parameters:
new_parent_dir- New location. Note that non-simple torrents' data will be placed in a subdirectory of the torrent's name (Download.getName()) under this new_parent_dir- Throws:
DownloadException
-
canMoveDataFiles
public boolean canMoveDataFiles()Description copied from interface:DownloadReturns true if the client will allow the data files for the torrent to be moved.- Specified by:
canMoveDataFilesin interfaceDownload
-
moveTorrentFile
Description copied from interface:DownloadMove a download's torrent file to a new location. Download must be stopped and persistent- Specified by:
moveTorrentFilein interfaceDownload- Parameters:
new_parent_dir-- Throws:
DownloadException
-
renameDownload
Description copied from interface:DownloadRenames the file (for a single file torrent) or directory (for a multi file torrent) where the download is being saved to. The download must be in a state to move the data files to a new location (seeDownload.moveDataFiles(File)).This will not rename the displayed name for the torrent - if you wish to do that, you must do it via the
TorrentAttributeclass.If a download is running, it will be automatically paused and resumed afterwards - be aware that this behaviour may generate stateChanged events being fired.
- Specified by:
renameDownloadin interfaceDownload- Parameters:
name- New name for the download.- Throws:
DownloadException- See Also:
-
getPeerManager
Description copied from interface:Downloadreturn the current peer manager for the download.- Specified by:
getPeerManagerin interfaceDownload- Returns:
- null returned if torrent currently doesn't have one (e.g. it is stopped)
-
getDiskManager
Description copied from interface:DownloadReturn the disk manager, null if its not running- Specified by:
getDiskManagerin interfaceDownload- Returns:
-
getDiskManagerFileInfo
Description copied from interface:DownloadReturns info about the torrent's files. Note that this will return "stub" values if the download isn't running (not including info such as completion status)- Specified by:
getDiskManagerFileInfoin interfaceDownload- Returns:
-
getDiskManagerFileInfo
Description copied from interface:DownloadReturns file info for the given index. Note that this will return "stub" values if the download isn't running (not including info such as completion status)- Specified by:
getDiskManagerFileInfoin interfaceDownload- Returns:
- null if index is invalid
-
getDiskManagerFileCount
public int getDiskManagerFileCount()Description copied from interface:DownloadReturn the number of DiskManagerFile objects- Specified by:
getDiskManagerFileCountin interfaceDownload- Returns:
-
requestTrackerAnnounce
public void requestTrackerAnnounce()Description copied from interface:Downloadrequest a tracker announce- Specified by:
requestTrackerAnnouncein interfaceDownload
-
requestTrackerAnnounce
public void requestTrackerAnnounce(boolean immediate) Description copied from interface:Downloadrequest a tracker announce- Specified by:
requestTrackerAnnouncein interfaceDownload
-
requestTrackerScrape
public void requestTrackerScrape(boolean immediate) Description copied from interface:Downloadrequest a tracker announce- Specified by:
requestTrackerScrapein interfaceDownload
-
addListener
Description copied from interface:DownloadEventNotifierAdds a listener that will be informed of changes to a download's state.- Specified by:
addListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.
-
removeListener
Description copied from interface:DownloadEventNotifierRemoves a listener object added via theDownloadEventNotifier.addListener(DownloadListener)method.- Specified by:
removeListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to remove.
-
addCompletionListener
Description copied from interface:DownloadEventNotifierAdds a listener that will be informed when a download moves into a completed state.- Specified by:
addCompletionListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.
-
removeCompletionListener
Description copied from interface:DownloadEventNotifierRemoves a listener object removed via theDownloadEventNotifier.addCompletionListener(DownloadCompletionListener)method.- Specified by:
removeCompletionListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to remove.
-
addTrackerListener
Description copied from interface:DownloadEventNotifierAdds a listener that will be informed when the latest announce/scrape results change.Listener events will be immediately triggered after the listener has been added.
- Specified by:
addTrackerListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.
-
addTrackerListener
Description copied from interface:DownloadEventNotifierAdds a listener that will be informed when the latest announce/scrape results change.- Specified by:
addTrackerListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.immediateTrigger- Whether to immediately trigger listener's events.
-
removeTrackerListener
Description copied from interface:DownloadEventNotifierRemoves a listener object added via theDownloadEventNotifier.addTrackerListener(DownloadTrackerListener)orDownloadEventNotifier.addTrackerListener(DownloadTrackerListener, boolean)method.- Specified by:
removeTrackerListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to remove.
-
addDownloadWillBeRemovedListener
Description copied from interface:DownloadEventNotifierAdds a listener that will be informed when a download is about to be removed. This gives the implementor the opportunity to veto the removal.- Specified by:
addDownloadWillBeRemovedListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.
-
removeDownloadWillBeRemovedListener
Description copied from interface:DownloadEventNotifierRemoves a listener object added via theDownloadEventNotifier.addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener)method.- Specified by:
removeDownloadWillBeRemovedListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to remove.
-
addActivationListener
Description copied from interface:DownloadEventNotifierAdds a listener that will be invoked when a request is made to activate a torrent.- Specified by:
addActivationListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.
-
removeActivationListener
Description copied from interface:DownloadEventNotifierRemoves a listener object added via theDownloadEventNotifier.addActivationListener(DownloadActivationListener)method.- Specified by:
removeActivationListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to remove.
-
addPeerListener
Description copied from interface:DownloadEventNotifierAdds a listener that will be informed of when peer managers have been added / removed for a download.- Specified by:
addPeerListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to add.
-
removePeerListener
Description copied from interface:DownloadEventNotifierRemoves a listener object added via theDownloadEventNotifier.addPeerListener(DownloadPeerListener)method.- Specified by:
removePeerListenerin interfaceDownloadEventNotifier- Parameters:
l- The listener to remove.
-
getSeedingRank
Description copied from interface:DownloadThe torrents with the highest rankings will be seeded first.- Specified by:
getSeedingRankin interfaceDownload- Returns:
- Seeding Rank
-
setSeedingRank
Description copied from interface:DownloadThe torrents with the highest rankings will be seeded first.- Specified by:
setSeedingRankin interfaceDownload- Parameters:
rank- New Ranking
-
getDownloadPeerId
public byte[] getDownloadPeerId()Description copied from interface:DownloadGet the local peerID advertised to the download swarm.- Specified by:
getDownloadPeerIdin interfaceDownload- Returns:
- self peer id
-
isMessagingEnabled
public boolean isMessagingEnabled()Description copied from interface:DownloadIs advanced AZ messaging enabled for this download.- Specified by:
isMessagingEnabledin interfaceDownload- Returns:
- true if enabled, false if disabled
-
setMessagingEnabled
public void setMessagingEnabled(boolean enabled) Description copied from interface:DownloadEnable or disable advanced AZ messaging for this download.- Specified by:
setMessagingEnabledin interfaceDownload- Parameters:
enabled- true to enabled, false to disabled
-
moveDataFiles
Description copied from interface:DownloadMove a download's data files to a new location, and rename the download at the same time. Download must be stopped and persistent. This is equivalent to calling moveDataFiles[File] and then renameDownload[String]. For convenience, either argument can be null, but not both.If a download is running, it will be automatically paused and resumed afterwards - be aware that this behaviour may generate stateChanged events being fired.
- Specified by:
moveDataFilesin interfaceDownload- Parameters:
new_parent_dir- new location to move torrent data files to. If null, and simple torrent, torrent data file will be renamed new_name. If null, and not simple torrent, torrent end path will be changed to new_name.new_name- For simple torrent, changes the filename of the downloaded file. For non-simple torrent, changes the end path for the downloaded files. If null, torrent data files will be moved to new_parent_dir, with a subfolder ofDownload.getName().- Throws:
DownloadException
-
getUserData
Description copied from interface:Downloadget user-defined key/value- Specified by:
getUserDatain interfaceDownload- Parameters:
key-- Returns:
-
setUserData
Description copied from interface:Downloadset user defined value. this is TRANSIENT and not persisted over the client stop/start- Specified by:
setUserDatain interfaceDownload- Parameters:
key-data-
-
changeLocation
Description copied from interface:DownloadApply the changes in the givenSaveLocationChangeobject - this includes moving torrent and data file data.- Specified by:
changeLocationin interfaceDownload- Parameters:
slc- The change to apply.- Throws:
DownloadException- If there is a problem moving the data.
-
isStub
public boolean isStub()- Specified by:
isStubin interfaceDownloadStub
-
canStubbify
public boolean canStubbify()- Specified by:
canStubbifyin interfaceDownload
-
stubbify
- Specified by:
stubbifyin interfaceDownload- Throws:
DownloadExceptionDownloadRemovalVetoException
-
destubbify
- Specified by:
destubbifyin interfaceDownloadStub- Throws:
DownloadException
-
getDistributedDatabases
- Specified by:
getDistributedDatabasesin interfaceDownload- Returns:
-
getTorrentHash
public byte[] getTorrentHash()- Specified by:
getTorrentHashin interfaceDownloadStub
-
getTorrentSize
public long getTorrentSize()- Specified by:
getTorrentSizein interfaceDownloadStub
-
getStubFiles
- Specified by:
getStubFilesin interfaceDownloadStub
-
notSupported
protected void notSupported() -
getPrimaryFile
Description copied from interface:DownloadReturns the "Primary" file in the download. Usually the largest one- Specified by:
getPrimaryFilein interfaceDownload
-
getRelationText
Description copied from class:LogRelationA short description of what your class holds that can be printed by the logger- Overrides:
getRelationTextin classLogRelation- Returns:
-
getQueryableInterfaces
Description copied from class:LogRelationQuery this class for a reference to another class that it may hold- Overrides:
getQueryableInterfacesin classLogRelation- Returns:
- If found, the class desired. Otherwise, null.
-