Package gnu.kawa.functions
Class RunProcess
- java.lang.Object
-
- gnu.mapping.PropertySet
-
- gnu.mapping.Procedure
-
- gnu.mapping.ProcedureN
-
- gnu.kawa.functions.RunProcess
-
- All Implemented Interfaces:
Named
public class RunProcess extends ProcedureN
The Kawa run-process command builds and runs a Process.
-
-
Field Summary
Fields Modifier and Type Field Description static MethodHandleapplyToConsumerRPstatic SimpleSymbolcurrentSymbolstatic SimpleSymbolinheritSymbolstatic RunProcessinstancestatic SimpleSymboloutSymbolstatic SimpleSymbolpipeSymbol-
Fields inherited from class gnu.mapping.ProcedureN
applyToObject, noArgs
-
Fields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
-
Fields inherited from class gnu.mapping.PropertySet
nameKey
-
-
Constructor Summary
Constructors Constructor Description RunProcess(String name)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectapplyToConsumerRP(Procedure proc, CallContext ctx)static voidcopyStream(InputStream in, OutputStream out, boolean closeOut)Copy bytes from InputStream to OutputStream using current Thread.static voiddoit(ArgListVector args, Consumer consumer)protected static voiderror(String message)static InputStreamgetInputStreamFrom(Object val)static voidtokenize(String str, boolean useShell, List<String> arr)Parse strings into token, handling substitution marks.-
Methods inherited from class gnu.mapping.ProcedureN
applyToObject
-
Methods inherited from class gnu.mapping.Procedure
apply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, numArgs, set0, set1, setN, setSetter, setSourceLocation, toString
-
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
-
-
-
Field Detail
-
applyToConsumerRP
public static final MethodHandle applyToConsumerRP
-
instance
public static final RunProcess instance
-
inheritSymbol
public static final SimpleSymbol inheritSymbol
-
pipeSymbol
public static final SimpleSymbol pipeSymbol
-
currentSymbol
public static final SimpleSymbol currentSymbol
-
outSymbol
public static final SimpleSymbol outSymbol
-
-
Constructor Detail
-
RunProcess
public RunProcess(String name)
-
-
Method Detail
-
applyToConsumerRP
public static Object applyToConsumerRP(Procedure proc, CallContext ctx) throws Throwable
- Throws:
Throwable
-
error
protected static void error(String message)
-
doit
public static void doit(ArgListVector args, Consumer consumer) throws Throwable
- Throws:
Throwable
-
tokenize
public static void tokenize(String str, boolean useShell, List<String> arr)
Parse strings into token, handling substitution marks.- Parameters:
useShell- true if result will be further tokenized by a shell. (In this case we're basically just handling substiution marks.)
-
getInputStreamFrom
public static InputStream getInputStreamFrom(Object val)
-
copyStream
public static void copyStream(InputStream in, OutputStream out, boolean closeOut) throws IOException
Copy bytes from InputStream to OutputStream using current Thread. Continue copying until EOF or exception. At end, the input stream is closed, but the output stream is not.- Throws:
IOException
-
-