Package com.biglybt.ui.console.commands
Class AddFind
- java.lang.Object
-
- com.biglybt.ui.console.commands.IConsoleCommand
-
- com.biglybt.ui.console.commands.OptionsConsoleCommand
-
- com.biglybt.ui.console.commands.AddFind
-
public class AddFind extends OptionsConsoleCommand
this class allows the user to add and find torrents. when adding, you may specify an output directory when finding, it will cache the files it finds into the ConsoleInput object so that they can then be added by id
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biglybt.ui.console.commands.IConsoleCommand
IConsoleCommand.TorrentComparator
-
-
Constructor Summary
Constructors Constructor Description AddFind()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addFiles(ConsoleInput ci, java.io.File[] toadd, boolean finding, java.lang.String outputDir)
if finding is set, just print the available files and add them to the 'add' list inside the consoleinput object, otherwise actually add the torrents, saving to the specified output directoryprotected void
addLocal(ConsoleInput ci, java.lang.String arg, java.lang.String outputDir, boolean scansubdir, boolean finding)
attempt a local add (arg may be a directory, a file or a pattern eg: d:/*.torrent)protected void
addRemote(ConsoleInput ci, java.lang.String arg, java.lang.String outputDir)
attempt to download the torrent specified by 'arg' and save the files in the torrent to the specified output directoryvoid
execute(java.lang.String commandName, ConsoleInput ci, org.apache.commons.cli.CommandLine commands)
execute using the specified command line.java.lang.String
getCommandDescriptions()
return high-level help about the commands supported by this object.private void
showAdds(ConsoleInput ci)
prints out the files in the 'add' list that is stored in the console input object.protected java.lang.String
transformLocalArgument(java.lang.String arg)
perform any transformations on the argument - in this case we are replacing '~' with the user's home directory.-
Methods inherited from class com.biglybt.ui.console.commands.OptionsConsoleCommand
execute, getOptions, getParser, printHelpExtra
-
Methods inherited from class com.biglybt.ui.console.commands.IConsoleCommand
expandVariable, getCommandName, getCommandNames, getDefaultSummaryFormat, getShortCommandName, getTorrentSummary, printHelp, printHelp
-
-
-
-
Method Detail
-
getCommandDescriptions
public java.lang.String getCommandDescriptions()
Description copied from class:IConsoleCommand
return high-level help about the commands supported by this object.- Specified by:
getCommandDescriptions
in classIConsoleCommand
- Returns:
-
execute
public void execute(java.lang.String commandName, ConsoleInput ci, org.apache.commons.cli.CommandLine commands)
Description copied from class:OptionsConsoleCommand
execute using the specified command line.- Specified by:
execute
in classOptionsConsoleCommand
-
addRemote
protected void addRemote(ConsoleInput ci, java.lang.String arg, java.lang.String outputDir)
attempt to download the torrent specified by 'arg' and save the files in the torrent to the specified output directory- Parameters:
ci
-arg
- URL of torrent to downloadoutputDir
- directory to save files from torrent to
-
addLocal
protected void addLocal(ConsoleInput ci, java.lang.String arg, java.lang.String outputDir, boolean scansubdir, boolean finding)
attempt a local add (arg may be a directory, a file or a pattern eg: d:/*.torrent)- Parameters:
ci
-arg
- argument - could be directory, file or pattern eg: d:\*.torrentoutputDir
- directory to save files from torrent toscansubdir
- if true, will recurse subdirectories looking for files to addfinding
- if true, don't start downloading the files; simply add them to the 'found' list
-
transformLocalArgument
protected java.lang.String transformLocalArgument(java.lang.String arg)
perform any transformations on the argument - in this case we are replacing '~' with the user's home directory.- Parameters:
arg
-- Returns:
-
addFiles
protected void addFiles(ConsoleInput ci, java.io.File[] toadd, boolean finding, java.lang.String outputDir)
if finding is set, just print the available files and add them to the 'add' list inside the consoleinput object, otherwise actually add the torrents, saving to the specified output directory- Parameters:
toadd
-finding
-outputDir
-
-
showAdds
private void showAdds(ConsoleInput ci)
prints out the files in the 'add' list that is stored in the console input object.- Parameters:
ci
-
-
-