Package org.metricshub.jawk.jrt
Class SandboxedJRT
java.lang.Object
org.metricshub.jawk.jrt.JRT
org.metricshub.jawk.jrt.SandboxedJRT
Runtime component that raises
AwkSandboxException when sandboxed code
attempts operations that would escape the sandbox.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanjrtConsumeCommandInput.booleanjrtConsumeFileInput(String filename) jrtConsumeFileInput.jrtGetPrintStream(String filename, boolean append) Retrieve the PrintStream which writes to a particular file, creating the PrintStream if necessary.jrtSpawnForOutput(String cmd) Retrieve the PrintStream which shuttles data to stdin for a process, executing the process if necessary.Executes the command specified by cmd and waits for termination, returning an Integer object containing the return code.Methods inherited from class org.metricshub.jawk.jrt.JRT
applyRS, assignEnvironmentVariables, assignInitialVariables, compare2, consumeInput, dec, getInputLine, getOutputFiles, getPartitioningReader, hasInputFields, inc, isActuallyLong, jrtClose, jrtCloseAll, jrtConsumeCommandInputForGetline, jrtConsumeFileInputForGetline, jrtGetInputField, jrtGetInputField, jrtGetInputString, jrtParseFields, jrtSetInputField, jrtSetNF, newRandom, prepareReplacement, printfNoCatch, printfNoCatch, replaceAll, replaceFirst, setInputLine, setInputLineforEval, setStreams, split, split, sprintfNoCatch, substr, substr, timeSeed, toAwkString, toAwkStringForOutput, toBoolean, toDouble, toLong
-
Constructor Details
-
SandboxedJRT
-
-
Method Details
-
jrtGetPrintStream
Description copied from class:JRTRetrieve the PrintStream which writes to a particular file, creating the PrintStream if necessary.- Overrides:
jrtGetPrintStreamin classJRT- Parameters:
filename- The file which to write the contents of the PrintStream.append- true to append to the file, false to overwrite the file.- Returns:
- a
PrintStreamobject
-
jrtSpawnForOutput
Description copied from class:JRTRetrieve the PrintStream which shuttles data to stdin for a process, executing the process if necessary. Threads are created to shuttle the data to/from the process.- Overrides:
jrtSpawnForOutputin classJRT- Parameters:
cmd- The command to execute.- Returns:
- The PrintStream which to write to provide input data to the process.
-
jrtConsumeFileInput
Description copied from class:JRTjrtConsumeFileInput.
- Overrides:
jrtConsumeFileInputin classJRT- Parameters:
filename- aStringobject- Returns:
- a boolean
- Throws:
IOException- if any.
-
jrtConsumeCommandInput
Description copied from class:JRTjrtConsumeCommandInput.
- Overrides:
jrtConsumeCommandInputin classJRT- Parameters:
cmd- aStringobject- Returns:
- a boolean
- Throws:
IOException- if any.
-
jrtSystem
Description copied from class:JRTExecutes the command specified by cmd and waits for termination, returning an Integer object containing the return code. stdin to this process is closed while threads are created to shuttle stdout and stderr of the command to stdout/stderr of the calling process.
-