org.gudy.azureus2.ui.console
Class ConsoleInput

java.lang.Object
  extended by java.lang.Thread
      extended by org.gudy.azureus2.ui.console.ConsoleInput
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
MultiUserConsoleInput

public class ConsoleInput
extends Thread

Author:
Tobias Minich

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 File[] adds
           
 Properties aliases
           
 AzureusCore azureus_core
           
 PrintStream out
           
 List torrents
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ConsoleInput(AzureusCore _azureus_core, PrintStream _out)
          Simple constructor to allow other components to use the console commands such as "set"
ConsoleInput(String con, AzureusCore _azureus_core, InputStream _in, PrintStream _out, Boolean _controlling)
           
ConsoleInput(String con, AzureusCore _azureus_core, Reader _in, PrintStream _out, Boolean _controlling)
          Creates a new instance of ConsoleInput
ConsoleInput(String con, AzureusCore _azureus_core, Reader _in, PrintStream _out, Boolean _controlling, UserProfile profile)
           
 
Method Summary
 void downloadRemoteTorrent(String url)
          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 directory
 void downloadTorrent(String filename, String outputDir)
          begins the download of the torrent in the specified file, downloading it to the specified output directory.
 AzureusCore getCore()
           
 String getDefaultSaveDirectory()
          returns the default directory that torrents should be saved to unless otherwise specified
 GlobalManager getGlobalManager()
           
 UserProfile getUserProfile()
           
protected  void initialise()
           
 boolean invokeCommand(String command, List cargs)
           
 void printconsolehelp()
           
 void printwelcome()
           
protected  void registerAlertHandler()
           
protected  void registerCommand(IConsoleCommand command)
           
protected  void registerCommands()
          registers the commands available to be executed from this console
static 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.
protected  void registerUpdateChecker()
           
 void run()
           
 void saveAliases()
          writes the aliases back out to the alias file
protected  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, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

azureus_core

public final AzureusCore azureus_core

out

public volatile PrintStream out

torrents

public final List torrents

adds

public File[] adds

aliases

public final Properties aliases
Constructor Detail

ConsoleInput

public ConsoleInput(String con,
                    AzureusCore _azureus_core,
                    Reader _in,
                    PrintStream _out,
                    Boolean _controlling)
Creates a new instance of ConsoleInput


ConsoleInput

public ConsoleInput(String con,
                    AzureusCore _azureus_core,
                    Reader _in,
                    PrintStream _out,
                    Boolean _controlling,
                    UserProfile profile)

ConsoleInput

public ConsoleInput(AzureusCore _azureus_core,
                    PrintStream _out)
Simple constructor to allow other components to use the console commands such as "set"

Parameters:
con -
_azureus_core -
_out -

ConsoleInput

public ConsoleInput(String con,
                    AzureusCore _azureus_core,
                    InputStream _in,
                    PrintStream _out,
                    Boolean _controlling)
Method Detail

registerPluginCommand

public static 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.


unregisterPluginCommand

public static void unregisterPluginCommand(Class clazz)

initialise

protected void initialise()

downloadTorrent

public void downloadTorrent(String filename,
                            String outputDir)
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

public void downloadRemoteTorrent(String url,
                                  String outputDir)
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

public void downloadTorrent(String fileName)
downloads a torrent on the local file system to the default save directory

Parameters:
fileName -

downloadRemoteTorrent

public void downloadRemoteTorrent(String url)
downloads the remote torrent file. once we have downloaded the .torrent file, we pass the data to the downloadTorrent() method for further processing


registerAlertHandler

protected void registerAlertHandler()

registerCommands

protected void registerCommands()
registers the commands available to be executed from this console


registerCommand

protected void registerCommand(IConsoleCommand command)
Parameters:
set -

unregisterCommand

protected void unregisterCommand(IConsoleCommand command)

unregisterCommand

protected void unregisterCommand(String commandName)

printwelcome

public void printwelcome()

printconsolehelp

public void printconsolehelp()

invokeCommand

public boolean invokeCommand(String command,
                             List cargs)

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

saveAliases

public void saveAliases()
writes the aliases back out to the alias file


getUserProfile

public UserProfile getUserProfile()
Returns:
Returns the userProfile.

getDefaultSaveDirectory

public String getDefaultSaveDirectory()
returns the default directory that torrents should be saved to unless otherwise specified

Returns:

registerUpdateChecker

protected void registerUpdateChecker()

getCore

public AzureusCore getCore()

getGlobalManager

public GlobalManager getGlobalManager()