public class DBCommandThread
extends java.lang.Object
implements java.awt.event.ActionListener, java.lang.Runnable
Constructor and Description |
---|
DBCommandThread(java.lang.String command,
boolean turtle)
Creates a new instance of CommandThread.
|
DBCommandThread(java.lang.String command,
java.util.Map<java.lang.String,java.lang.String> fields,
boolean turtle)
Creates a new instance of CommandThread.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Runs the command.
|
static java.lang.String |
quote(java.lang.String str)
Quotes a string, so it will not be modified by replaceArguments
|
void |
run()
Used for running the command.
|
static void |
shellCommand(java.lang.String cmd,
java.lang.String data)
Runs simple shell commands.
|
static java.lang.String |
unquote(java.lang.String str)
Removes quotations added to a string by the 'quote' method
|
public DBCommandThread(java.lang.String command, boolean turtle)
command
- the command for the thread to runturtle
- whether to use the Turtle Shell or the system's native shell for running the command.public DBCommandThread(java.lang.String command, java.util.Map<java.lang.String,java.lang.String> fields, boolean turtle)
command
- the command for the thread to runfields
- a result set used for mapping command line variables (see above).turtle
- whether to use the Turtle Shell or the system's native shell for running the command.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- ignored by this functionpublic void run()
run
in interface java.lang.Runnable
public static java.lang.String quote(java.lang.String str)
str
- the string to add quotation topublic static java.lang.String unquote(java.lang.String str)
str
- the string to remove quotation frompublic static void shellCommand(java.lang.String cmd, java.lang.String data)
cmd
- the command string to rundata
- the data to use as standard input (System.in)Copyright © 2008-2014 University of Manitoba.