FileDocCategorySizeDatePackage
TorrentDownloaderFactory.javaAPI DocAzureus 3.0.3.44904Thu Feb 09 19:42:54 GMT 2006org.gudy.azureus2.core3.torrentdownloader

TorrentDownloaderFactory

public class TorrentDownloaderFactory extends Object
author
Tobias Minich

Fields Summary
Constructors Summary
Methods Summary
public static TorrentDownloadercreate(TorrentDownloaderCallBackInterface callback, java.lang.String url, java.lang.String referrer, java.lang.String fileordir, boolean logged)
creates and initializes a TorrentDownloader object with the specified parameters. NOTE: this does not actually start the TorrentDownloader object

param
callback object to notify about torrent download status
param
url url of torrent file to download
param
referrer url of referrer to set as HTTP_REFERER header when requesting torrent
param
fileordir path to a file or directory that the actual torrent file should be saved to. if a default save directory is not specified, this will be used instead. even if a default save directory is specified, if this parameter path refers to a file, the filename will be used when saving the torrent
param
whether or not logging is enabled for the torrent download. this is performed through the TorrentDownloaderLoggedImpl class which is only available in the uis project
return

    TorrentDownloaderImpl dl = getClass(logged);
    if (dl!=null)
      dl.init(callback, url, referrer, fileordir);
    return dl;
  
public static TorrentDownloadercreate(TorrentDownloaderCallBackInterface callback, java.lang.String url, java.lang.String referrer, java.lang.String fileordir)

    return create(callback, url, referrer, fileordir, false);
  
public static TorrentDownloadercreate(TorrentDownloaderCallBackInterface callback, java.lang.String url, boolean logged)

    return create(callback, url, null, null, logged);
  
public static TorrentDownloadercreate(TorrentDownloaderCallBackInterface callback, java.lang.String url)

      return create(callback, url, null, null, false);
  
public static TorrentDownloadercreate(java.lang.String url, java.lang.String fileordir, boolean logged)

    return create(null, url, null, fileordir, logged);
  
public static TorrentDownloadercreate(java.lang.String url, java.lang.String fileordir)

    return create(null, url, null, fileordir, false);
  
public static TorrentDownloadercreate(java.lang.String url, boolean logged)

    return create(null, url, null, null, logged);
  
public static TorrentDownloadercreate(java.lang.String url)

    return create(null, url, null, null, false);
  
public static TorrentDownloaderdownloadManaged(java.lang.String url, java.lang.String fileordir, boolean logged)

    return TorrentDownloaderManager.getInstance().download(url, fileordir, logged);
  
public static TorrentDownloaderdownloadManaged(java.lang.String url, java.lang.String fileordir)

    return TorrentDownloaderManager.getInstance().download(url, fileordir);
  
public static TorrentDownloaderdownloadManaged(java.lang.String url, boolean logged)

    return TorrentDownloaderManager.getInstance().download(url, logged);
  
public static TorrentDownloaderdownloadManaged(java.lang.String url)

    return TorrentDownloaderManager.getInstance().download(url);
  
private static org.gudy.azureus2.core3.torrentdownloader.impl.TorrentDownloaderImplgetClass(boolean logged)

    try {
      return (TorrentDownloaderImpl) Class.forName("org.gudy.azureus2.core3.torrentdownloader.impl.TorrentDownloader"+(logged?"Logged":"")+"Impl").newInstance();
    } catch (Exception e) {
    	Debug.printStackTrace( e );
      return null;
    }
  
public static voidinitManager(org.gudy.azureus2.core3.global.GlobalManager gm, boolean logged, boolean autostart, java.lang.String downloaddir)

    TorrentDownloaderManager.getInstance().init(gm, logged, autostart, downloaddir);