FileDocCategorySizeDatePackage
TorrentPublish.javaAPI DocAzureus 3.0.3.42455Tue Oct 31 15:10:32 GMT 2006org.gudy.azureus2.ui.console.commands

TorrentPublish

public class TorrentPublish extends TorrentCommand
console command to host a torrent. extracted from the Torrent class written by tobias

Fields Summary
Constructors Summary
public TorrentPublish()

		super(new String[] { "publish"}, "Publishing");
	
Methods Summary
public java.lang.StringgetCommandDescriptions()

		return("publish (<torrentoptions>)\t\tPublish or stop publishing torrent(s).");
	
protected booleanperformCommand(org.gudy.azureus2.ui.console.ConsoleInput ci, org.gudy.azureus2.core3.download.DownloadManager dm, java.util.List args)

		TOTorrent torrent = dm.getTorrent();
        if (torrent != null) {
          try {
        	TRHost	host = ci.azureus_core.getTrackerHost();
        	
        	TRHostTorrent	existing = host.getHostTorrent( torrent );
        	
        	if ( existing == null ){
        		
        		host.publishTorrent(torrent);
        	}else{
        		try{
        			existing.remove();
        			
        		}catch( Throwable e ){
        			
        			e.printStackTrace();
        		}
        	}
          } catch (TRHostException e) {
            e.printStackTrace(ci.out);
            return false;
          }
          return true;
        }
        return false;