TorrentStartpublic class TorrentStart extends TorrentCommand console command to start a torrent.
extracted from the Torrent class written by tobias |
Fields Summary |
---|
private boolean | startNow |
Constructors Summary |
---|
public TorrentStart()
super( new String[] { "start" , "s" }, "Starting" );
|
Methods Summary |
---|
public void | execute(java.lang.String commandName, org.gudy.azureus2.ui.console.ConsoleInput console, java.util.List args)
startNow = false;
Vector newargs = new Vector(args);
if (!newargs.isEmpty() && newargs.contains("now") ) {
newargs.removeElement("now");
startNow = true;
}
super.execute(commandName, console, args);
| public java.lang.String | getCommandDescriptions()
return "start (<torrentoptions>) \ts\tStart torrent(s).";
| public java.lang.String | getHelpExtra()
return ("<torrentoptions> can be one of:\n"+
"<#>\t\tNumber of a torrent. You have to use 'show torrents' first. as the number is taken from there.\n"+
"all\t\tCommand is applied to all torrents\n"+
"hash <hash>\tApplied to torrent with the hash <hash> as given in the xml output or extended torrent info ('show <#>').");
| protected boolean | performCommand(org.gudy.azureus2.ui.console.ConsoleInput ci, org.gudy.azureus2.core3.download.DownloadManager dm, java.util.List args)
try {
int state = dm.getState();
if ( state != DownloadManager.STATE_STOPPED ){
ci.out.println( "Torrent isn't stopped" );
return( false );
}
if ( startNow ){
ci.out.println( "'now' option has been deprecated, use forcestart" );
}
dm.stopIt( DownloadManager.STATE_QUEUED, false, false );
} catch (Exception e) {
e.printStackTrace(ci.out);
return false;
}
return true;
|
|