Package org.rapidcontext.app
Class ScriptApplication
java.lang.Object
org.rapidcontext.app.ScriptApplication
The main command-line application.
- Version:
- 1.0
-
Field Summary
Modifier and TypeFieldDescriptionThe base application directory.int
The post command execution delay in seconds.The local add-on directory.The command source text, as logged and/or visible for introspection.boolean
The command trace flag.The user name used for authentication. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Runs the commands specified by the prefix and lines read from a file.void
Runs a single command.void
Runs the commands specified by the prefix and lines read from standard input.
-
Field Details
-
appDir
The base application directory. Defaults to the current directory. -
localDir
The local add-on directory. Defaults to the current directory. -
user
The user name used for authentication. Defaults to the current user name. -
source
The command source text, as logged and/or visible for introspection. -
delay
public int delayThe post command execution delay in seconds. Default to zero (0). -
trace
public boolean traceThe command trace flag. Defaults to false.
-
-
Constructor Details
-
ScriptApplication
public ScriptApplication()Creates a new command-line application instance.
-
-
Method Details
-
runSingle
Runs a single command.- Parameters:
params
- the procedure name and arguments- Throws:
SecurityException
- if the user couldn't authenticate
-
runStdin
Runs the commands specified by the prefix and lines read from standard input.- Parameters:
prefix
- the procedure name and argument prefixes- Throws:
SecurityException
- if the user couldn't authenticateIOException
- if the input stream couldn't be read
-
runFile
public void runFile(String[] prefix, File file) throws SecurityException, FileNotFoundException, IOException Runs the commands specified by the prefix and lines read from a file.- Parameters:
prefix
- the procedure name and argument prefixesfile
- the file to read- Throws:
SecurityException
- if the user couldn't authenticateFileNotFoundException
- if the file couldn't be openedIOException
- if the input stream couldn't be read
-