Methods Summary |
---|
public void | TorrentDownloaderEvent(int state, org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader inf)
switch(state) {
case TorrentDownloader.STATE_START:
if (this.queued.contains(inf))
this.queued.remove(inf);
if (!this.running.contains(inf))
this.running.add(inf);
break;
case TorrentDownloader.STATE_FINISHED:
remove(inf);
if ((gm != null) && (downloaddir != null)) {
gm.addDownloadManager(inf.getFile().getAbsolutePath(), downloaddir);
}
break;
case TorrentDownloader.STATE_ERROR:
remove(inf);
this.errors.add(inf);
break;
}
|
public org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader | add(org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader dl)
if (dl.getDownloadState()==TorrentDownloader.STATE_ERROR)
this.errors.add(dl);
else if (this.running.contains(dl) || this.queued.contains(dl)) {
((TorrentDownloaderImpl) dl).setDownloadState(TorrentDownloader.STATE_DUPLICATE);
((TorrentDownloaderImpl) dl).notifyListener();
this.errors.add(dl);
} else if (this.autostart) {
dl.start();
} else
this.queued.add(dl);
return dl;
|
public org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader | download(java.lang.String url, java.lang.String fileordir, boolean logged)
return add(TorrentDownloaderFactory.create(this, url, null, fileordir, logged));
|
public org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader | download(java.lang.String url, boolean logged)
return add(TorrentDownloaderFactory.create(this, url, null, null, logged));
|
public org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader | download(java.lang.String url, java.lang.String fileordir)
return add(TorrentDownloaderFactory.create(this, url, null, fileordir, this.logged));
|
public org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader | download(java.lang.String url)
return add(TorrentDownloaderFactory.create(this, url, this.logged));
|
public static org.gudy.azureus2.core3.torrentdownloader.impl.TorrentDownloaderManager | getInstance()
if (man==null)
man = new TorrentDownloaderManager();
return man;
|
public void | init(org.gudy.azureus2.core3.global.GlobalManager _gm, boolean _logged, boolean _autostart, java.lang.String _downloaddir)
this.gm = _gm;
this.logged = _logged;
this.autostart = _autostart;
if (_downloaddir != null)
this.downloaddir = _downloaddir;
|
public void | remove(org.gudy.azureus2.core3.torrentdownloader.TorrentDownloader inf)
if (this.running.contains(inf))
this.running.remove(inf);
if (this.queued.contains(inf))
this.queued.remove(inf);
|