Class TorrentCommand
java.lang.Object
com.biglybt.ui.console.commands.IConsoleCommand
com.biglybt.ui.console.commands.TorrentCommand
- Direct Known Subclasses:
Hack, TorrentArchive, TorrentCheck, TorrentForceStart, TorrentHost, TorrentLog, TorrentPublish, TorrentQueue, TorrentRemove, TorrentStart, TorrentStop, TorrentSubCommand
base class for objects which need to operate on specific torrents.
this class allows the torrent to be identified by hash, number or
'all' and will pass the appropriate torrent(s) to the subclasses 'performCommand' method
-
Nested Class Summary
Nested classes/interfaces inherited from class IConsoleCommand
IConsoleCommand.TorrentComparator -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTorrentCommand(String main_name, String short_name, String action) initializes the torrent command -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(String commandName, ConsoleInput ci, List<String> args) execute the command with the specified name using the specified argumentsprotected Stringprotected abstract booleanperformCommand(ConsoleInput ci, DownloadManager dm, List<String> args) protected booleanperformCommand(ConsoleInput ci, TRHostTorrent torrent, List<String> args) Stub for commands that operate on a hosted torrent rather than downloadmanagerprivate voidperformCommandIfAllowed(ConsoleInput ci, List args, DownloadManager dm, String desc, String name) checks the role of the user.private voidperformCommandIfAllowed(ConsoleInput ci, List args, TRHostTorrent torrent, String desc, String name) voidprintHelpExtra(PrintStream out, List args) prints out the syntax of this commandMethods inherited from class IConsoleCommand
expandVariable, getCommandDescriptions, getCommandName, getCommandNames, getDefaultSummaryFormat, getShortCommandName, getTorrentSummary, printHelp, printHelp
-
Field Details
-
action
-
-
Constructor Details
-
TorrentCommand
-
-
Method Details
-
getAction
-
performCommand
-
performCommand
Stub for commands that operate on a hosted torrent rather than downloadmanager- Parameters:
ci-args-- Returns:
-
execute
Description copied from class:IConsoleCommandexecute the command with the specified name using the specified arguments- Specified by:
executein classIConsoleCommand- Parameters:
commandName-ci-args-
-
performCommandIfAllowed
private void performCommandIfAllowed(ConsoleInput ci, List args, DownloadManager dm, String desc, String name) checks the role of the user. if the user is a 'guest', they are not able to perform any actions on the torrents. they are a 'read only' role. if they are a 'user' role, they are only able to modify their own torrents. users with the 'admin' role can modify anybody's torrents- Parameters:
ci-args-dm-name-subcommand-
-
performCommandIfAllowed
private void performCommandIfAllowed(ConsoleInput ci, List args, TRHostTorrent torrent, String desc, String name) -
printHelpExtra
prints out the syntax of this command- Overrides:
printHelpExtrain classIConsoleCommand
-