FileDocCategorySizeDatePackage
Hack.javaAPI DocAzureus 3.0.3.412288Tue Jul 11 02:29:40 BST 2006org.gudy.azureus2.ui.console.commands

Hack

public class Hack extends TorrentCommand
author
Tobias Minich

Fields Summary
private final CommandCollection
subCommands
Constructors Summary
public Hack()

	
	  
	
		super(new String[] { "hack", "#" }, "Hacking");
		subCommands.add(new HackFile());
		subCommands.add(new HackTracker());
		subCommands.add(new HackDownloadSpeed());
		subCommands.add(new HackUploadSpeed());
		subCommands.add(new HackUploads());
	
Methods Summary
public java.lang.StringgetCommandDescriptions()

		return "hack [<various options>]\t#\tModify torrent settings. Use without parameters for further help.";
	
protected booleanperformCommand(org.gudy.azureus2.ui.console.ConsoleInput ci, org.gudy.azureus2.core3.download.DownloadManager dm, java.util.List args)
finds the appropriate subcommand and executes it. the execute() method will have taken care of finding/iterating over the appropriate torrents

		if (args.isEmpty()) {
			ci.out.println("> Not enough parameters for command '" + getCommandName() + "'.");
			return false;
		}
		String subCommandName = (String)args.remove(0);
		TorrentSubCommand cmd = (TorrentSubCommand) subCommands.get(subCommandName);
		if( cmd != null )
			return cmd.performCommand(ci, dm, args);
		else
		{
			ci.out.println("> Command 'hack': Command parameter '" + subCommandName + "' unknown.");
			return false;
		}
	
public voidprintHelp(java.io.PrintStream out, java.util.List args)

		out.println("> -----");
		out.println("'hack' syntax:");
		if( args.size() > 0 ) {
			String command = (String) args.remove(0);
			IConsoleCommand cmd = subCommands.get(command);
			if( cmd != null )
				cmd.printHelp(out, args);
			return;
		}
		out.println("hack <torrent id> <command> <command options>");
		out.println();
		out.println("<torrent id> can be one of the following:");
		out.println("<#>\t\tNumber of a torrent. You have to use 'show torrents' first as the number is taken from there.");
		out.println("hash <hash>\tApplied to torrent with the hash <hash> as given in the xml output or extended torrent info ('show <#>').");
		out.println("help\t\tDetailed help for <command>");
		out.println();
		out.println("Available <command>s:");
		for (Iterator iter = subCommands.iterator(); iter.hasNext();) {
			TorrentSubCommand cmd = (TorrentSubCommand) iter.next();
			out.println(cmd.getCommandDescriptions());
		}
		out.println("> -----");