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 classprivate classprivate classprivate static classprivate static classprivate static classprivate classNested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionFile[]private ILogAlertListenerfinal Propertiesprivate static final Stringprivate final CommandReaderprivate final Mapprivate final booleanfinal Coreprivate final LinkedList<LogEvent> private final Listprivate ILogEventListenerprivate intprivate final Vectorprivate static final Listprotected booleanfinal List<DownloadManager> private final UserProfileprivate booleanFields inherited from class 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 TypeMethodDescriptionprivate voidvoiddownloads the remote torrent file.voiddownloadRemoteTorrent(String url, String outputDir) downloads the remote torrent file.voiddownloadTorrent(String fileName) downloads a torrent on the local file system to the default save directoryvoiddownloadTorrent(String filename, String outputDir) begins the download of the torrent in the specified file, downloading it to the specified output directory.private FilegetCore()returns the default directory that torrents should be saved to unless otherwise specifiedprotected voidbooleaninvokeCommand(String command, List cargs) private voidread in the aliases from the alias properties filevoidprivate voidvoidprivate voidquit(boolean finish) private voidprotected voidregisterCommand(IConsoleCommand command) protected voidregisters the commands available to be executed from this consoleprivate voidstatic voidregisterPluginCommand(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 voidinstantiates each of the plugin commands and registers tprotected voidvoidrun()voidwrites the aliases back out to the alias fileprivate voidprotected voidunregisterCommand(IConsoleCommand command) protected voidunregisterCommand(String commandName) private voidstatic voidunregisterPluginCommand(Class clazz) Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, threadId, 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
-
logHandler
-
alertHandler
-
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() -
destroyalise
private void destroyalise() -
downloadTorrent
-
downloadRemoteTorrent
-
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 -
registerLogHandler
private void registerLogHandler() -
unregisterLogHandler
private void unregisterLogHandler() -
registerAlertHandler
private void registerAlertHandler() -
unregisterAlertHandler
private void unregisterAlertHandler() -
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
-
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
-