Package com.biglybt.ui.console
Class ConsoleInput
java.lang.Object
java.lang.Thread
com.biglybt.ui.console.ConsoleInput
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
MultiUserConsoleInput
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private class
private class
private static class
private static class
private static class
private class
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionFile[]
final Properties
private static final String
private final CommandReader
private final Map
private final boolean
final Core
private final List
private int
private final Vector
private static final List
protected boolean
final List
private final UserProfile
private boolean
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionConsoleInput
(Core core, PrintStream _out) Simple constructor to allow other components to use the console commands such as "set"ConsoleInput
(String con, Core _core, InputStream _in, PrintStream _out, Boolean _controlling) ConsoleInput
(String con, Core _core, Reader _in, PrintStream _out, Boolean _controlling) Creates a new instance of ConsoleInputConsoleInput
(String con, Core _core, Reader _in, PrintStream _out, Boolean _controlling, UserProfile profile) -
Method Summary
Modifier and TypeMethodDescriptionvoid
downloads the remote torrent file.void
downloadRemoteTorrent
(String url, String outputDir) downloads the remote torrent file.void
downloadTorrent
(String fileName) downloads a torrent on the local file system to the default save directoryvoid
downloadTorrent
(String filename, String outputDir) begins the download of the torrent in the specified file, downloading it to the specified output directory.private File
getCore()
returns the default directory that torrents should be saved to unless otherwise specifiedprotected void
boolean
invokeCommand
(String command, List cargs) private void
read in the aliases from the alias properties filevoid
private void
void
private void
quit
(boolean finish) protected void
protected void
registerCommand
(IConsoleCommand command) protected void
registers the commands available to be executed from this consolestatic void
registerPluginCommand
(Class clazz) can be used by plugins to register console commands since they may not have access to each ConsoleInput object that is created.private void
instantiates each of the plugin commands and registers tprotected void
void
run()
void
writes the aliases back out to the alias fileprotected void
unregisterCommand
(IConsoleCommand command) protected void
unregisterCommand
(String commandName) static void
unregisterPluginCommand
(Class clazz) Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
ALIASES_CONFIG_FILE
- See Also:
-
core
-
out
-
current_ros
-
torrents
-
adds
-
br
-
controlling
private final boolean controlling -
running
protected boolean running -
oldcommand
-
pluginCommands
-
aliases
-
commands
-
helpItems
-
userProfile
-
errorLogEvents
-
numNewErrorLogEvents
private int numNewErrorLogEvents -
waitingForInput
private boolean waitingForInput
-
-
Constructor Details
-
ConsoleInput
Creates a new instance of ConsoleInput -
ConsoleInput
public ConsoleInput(String con, Core _core, Reader _in, PrintStream _out, Boolean _controlling, UserProfile profile) -
ConsoleInput
Simple constructor to allow other components to use the console commands such as "set"- Parameters:
core
-_out
-
-
ConsoleInput
public ConsoleInput(String con, Core _core, InputStream _in, PrintStream _out, Boolean _controlling)
-
-
Method Details
-
registerPluginCommand
can be used by plugins to register console commands since they may not have access to each ConsoleInput object that is created. -
unregisterPluginCommand
-
initialise
protected void initialise() -
downloadTorrent
begins the download of the torrent in the specified file, downloading it to the specified output directory. We also annotate the download with the current username- Parameters:
filename
-outputDir
-
-
downloadRemoteTorrent
downloads the remote torrent file. once we have downloaded the .torrent file, we pass the data to the downloadTorrent() method for further processing- Parameters:
url
-outputDir
-
-
downloadTorrent
downloads a torrent on the local file system to the default save directory- Parameters:
fileName
-
-
downloadRemoteTorrent
downloads the remote torrent file. once we have downloaded the .torrent file, we pass the data to the downloadTorrent() method for further processing -
registerPluginCommands
private void registerPluginCommands()instantiates each of the plugin commands and registers t -
registerAlertHandler
protected void registerAlertHandler() -
registerCommands
protected void registerCommands()registers the commands available to be executed from this console -
registerCommand
- Parameters:
set
-
-
unregisterCommand
-
unregisterCommand
-
quit
private void quit(boolean finish) -
printwelcome
public void printwelcome() -
printconsolehelp
public void printconsolehelp() -
printconsolehelp
-
invokeCommand
-
run
public void run() -
getAliasesFile
-
loadAliases
read in the aliases from the alias properties file- Throws:
IOException
-
saveAliases
public void saveAliases()writes the aliases back out to the alias file -
getUserProfile
- Returns:
- Returns the userProfile.
-
getDefaultSaveDirectory
returns the default directory that torrents should be saved to unless otherwise specified- Returns:
-
registerUpdateChecker
protected void registerUpdateChecker() -
getCore
-
getGlobalManager
-
getErrorLogEvents
-