FileDocCategorySizeDatePackage
DownloadManager.javaAPI DocAzureus 3.0.3.48776Thu May 31 16:28:44 BST 2007org.gudy.azureus2.plugins.download

DownloadManager

public interface DownloadManager
The DownloadManager gives access to functions used to monitor and manage Azureus's downloads
author
parg

Fields Summary
Constructors Summary
Methods Summary
public voidaddDownload(java.io.File torrent_file)
Add a torrent from a file. This may prompt the user for a download location etc. if required. This is an async operation, so no Download is returned. If you want to force a download to be added without prompting the user, you should create a Torrent object first, and then use an alternative addDownload method.

see
#addDownload(Torrent)
see
#addDownload(Torrent, File, File)
see
org.gudy.azureus2.plugins.torrent.TorrentManager#createFromBEncodedFile(File) TorrentManager.createFromBEncodedFile
param
torrent_file
throws
DownloadException
since
2.0.7.0

public voidaddDownload(java.net.URL url)
add a torrent from a URL. This will prompt the user for download location etc. if required This is an async operation so no Download returned

param
url
throws
DownloadException
since
2.0.7.0

public voidaddDownload(java.net.URL url, boolean auto_download)
Add a torrent from a URL with explicit auto-download option

param
url
param
auto_download
throws
DownloadException
since
2403

public voidaddDownload(java.net.URL url, java.net.URL referer)
add a torrent from a URL. This will prompt the user for download location etc. if required This is an async operation so no Download returned

param
url
param
referer
throws
DownloadException
since
2.1.0.6

public DownloadaddDownload(org.gudy.azureus2.plugins.torrent.Torrent torrent)
Add a torrent from a "Torrent" object. The default torrent file and data locations will be used if defined - a DownloadException will be thrown if they're not. You can explicitly set these values by using the {@link #addDownload(Torrent, File, File) addDownload(Torrent, File, File)} method.

param
torrent
see
#addDownload(Torrent, File, File)
return
since
2.0.8.0

public DownloadaddDownload(org.gudy.azureus2.plugins.torrent.Torrent torrent, java.io.File torrent_location, java.io.File data_location)
Add a torrent from a "Torrent" object and point it at the data location. The torrent_location should be the location of where the torrent file is on disk. This will be the torrent file that Azureus will use internally. If null is passed, then a file to store the torrent data in will be automatically created by Azureus.

param
torrent The torrent object to create a download with.
param
torrent_location The location of the file on disk - if null, a file to store the torrent data into will be created automatically.
param
data_location null -> user default data save location if defined
return
support for null params for torrent_location/data_location since 2.1.0.4
since
2.0.7.0

public DownloadaddDownloadStopped(org.gudy.azureus2.plugins.torrent.Torrent torrent, java.io.File torrent_location, java.io.File data_location)
Explicit way of adding a download in a stopped state

since
3013
param
torrent
param
torrent_location
param
data_location
return
throws
DownloadException

public voidaddDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)

public voidaddListener(DownloadManagerListener l)
Add a listener that will be informed when a download is added to and removed from Azureus.

Invoking this method is equivalent to addListener(l, true).

param
l The listener to add.
since
2.0.7.0
see
#addListener(DownloadManagerListener, boolean)

public voidaddListener(DownloadManagerListener l, boolean notify_of_current_downloads)
Add a listener that will be informed when a download is added to and removed from Azureus.

param
l The listener to add.
param
notify_of_current_downloads true - if you want the listener to have its {@link DownloadManagerListener#downloadAdded(Download) downloadAdded} method invoked immediately with all downloads currently managed by Azureus. false - if you only want to be notified about new downloads added after this method is called.
since
3.0.0.7

public DownloadaddNonPersistentDownload(org.gudy.azureus2.plugins.torrent.Torrent torrent, java.io.File torrent_location, java.io.File data_location)
Add a non-persistent download. Such downloads are not persisted by Azureus and as such will not be remembered across an Azureus close and restart.

param
torrent
param
torrent_location
param
data_location
return
throws
DownloadException
since
2.0.7.0

public booleancanPauseDownloads()

public booleancanResumeDownloads()

public DownloadgetDownload(byte[] hash)
Gets a download given its hash

param
hash
return
throws
DownloadException
since
2.3.0.7

public DownloadgetDownload(org.gudy.azureus2.plugins.torrent.Torrent torrent)
Gets the download for a particular torrent, returns null if not found

param
torrent
return
since
2.0.7.0

public Download[]getDownloads()
Gets all the downloads. Returned in Download "index" order

return
since
2.0.7.0

public Download[]getDownloads(boolean bSorted)
Gets all the downloads.

param
bSorted true - Returned in Download "index" order.
false - Order not guaranteed. Faster retrieval.
return
array of Download object
since
2.0.8.0

public DownloadEventNotifiergetGlobalDownloadEventNotifier()
Return a {@link DownloadEventNotifier} object which can be used as an easy way to register listeners against all downloads handled by Azureus.

since
3.0.1.5

public DownloadManagerStatsgetStats()
Get the download manager statistics

return

public booleanisSeedingOnly()
indicates whether or not all active downloads are in a seeding (or effective) seeding state

since
2.3.0.5
return

public voidpauseDownloads()
pause all running downloads

since
2.1.0.5

public voidremoveDownloadWillBeAddedListener(DownloadWillBeAddedListener listener)

public voidremoveListener(DownloadManagerListener l, boolean notify_of_current_downloads)
Removes a previously added listener.

param
l The listener to remove.
param
notify_of_current_downloads true - if you want the listener to have its {@link DownloadManagerListener#downloadRemoved(Download) downloadRemoved} method invoked immediately with all downloads currently managed by Azureus, false otherwise.
since
3.0.0.7

public voidremoveListener(DownloadManagerListener l)
Removes a previously added listener.

Invoking this method is equivalent to removeListener(l, false).

see
#removeListener(DownloadManagerListener, boolean)
param
l The listener to remove.
since
2.0.7.0

public voidresumeDownloads()
resume previously paused downloads

since
2.1.0.5

public voidstartAllDownloads()
starts all non-running downloads

since
2.1.0.5

public voidstopAllDownloads()
stops all running downloads

since
2.1.0.5