|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.dalsemi.slush.CommandInterpreter
The CommandInterpreter class is responsible for dispatching any commands received by the SLUSH shell to their appropriate handlers.
| Constructor Summary | |
CommandInterpreter()
|
|
| Method Summary | |
static boolean |
addCommand(java.lang.String name,
SlushCommand executer)
Adds a command to the list of those recognized by the SLUSH shell. |
static java.io.File |
deriveFileName(java.lang.String file,
java.util.Hashtable environment)
Creates an instance of a File object from a file name and the current directory that is stored in the environment hash table. |
static void |
execute(java.lang.String[] commandLine,
com.dalsemi.slush.SlushInputStream in,
com.dalsemi.slush.SlushPrintStream out,
com.dalsemi.slush.SlushPrintStream err,
java.util.Hashtable env)
Executes a SLUSH command. |
static java.util.Enumeration |
getAvailableCommands()
Enumerates all of the commands that have been added to the list. |
static java.util.Hashtable |
getEnvironment()
Creates and returns a copy of the current environment. |
static SlushCommand |
getSlushCommand(java.lang.String str)
Returns an instance of the specified command. |
static byte |
getUserID(java.lang.String userName,
java.lang.String password)
Returns the user ID associated with a name and password pair. |
static boolean |
isAdmin(byte b)
Determines if the given user ID has administrative rights. |
static boolean |
removeCommand(java.lang.String name)
Removes the named command from the list of those recognized by the SLUSH shell. |
static java.lang.String |
resolveFileName(java.lang.String file)
Resolves a absolute path name into its canonical representation. |
| Methods inherited from class java.lang.Object |
equals,
hashCode,
toString |
| Constructor Detail |
public CommandInterpreter()
| Method Detail |
public static final boolean addCommand(java.lang.String name,
SlushCommand executer)
name - The string that will be typed from the shell command line to execute the command.executer - An instance of the command to be added.public static final boolean removeCommand(java.lang.String name)
name - The name of the command to remove.
public static void execute(java.lang.String[] commandLine,
com.dalsemi.slush.SlushInputStream in,
com.dalsemi.slush.SlushPrintStream out,
com.dalsemi.slush.SlushPrintStream err,
java.util.Hashtable env)
throws java.lang.Exception
commandLine - A String array containing the command followed by any parameters need for that command.in - The stream the command will use to get input.out - The stream used to report non-critical messages.err - The stream used to report critical messages.env - A table of environment variables.
public static final byte getUserID(java.lang.String userName,
java.lang.String password)
userName - The user name.password - The password for that user.
public static java.io.File deriveFileName(java.lang.String file,
java.util.Hashtable environment)
throws java.io.FileNotFoundException
file - The name of the file to create. This String can contain a relative or absolute path (including any references to "..", "...", etc.).environment - A table of environment variables that must include a "current directory" key.
public static java.lang.String resolveFileName(java.lang.String file)
throws java.io.FileNotFoundException
file - The absolute path to resolve.public static java.util.Hashtable getEnvironment()
public static SlushCommand getSlushCommand(java.lang.String str)
str - The name of the command to find.addCommand(String, SlushCommand)public static java.util.Enumeration getAvailableCommands()
addCommand(String, SlushCommand)public static boolean isAdmin(byte b)
b - the user ID.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||