com.dtolabs.rundeck.core.execution
Class ExecArgList

java.lang.Object
  extended by com.dtolabs.rundeck.core.execution.ExecArgList

public class ExecArgList
extends java.lang.Object

A list of commandline arguments, with flags to indicate quoting.


Nested Class Summary
static class ExecArgList.Builder
          Builder class
 
Method Summary
 java.lang.String[] asFlatStringArray()
          Flatten the list of arguments into an array
 java.util.ArrayList<java.lang.String> asFlatStringList()
          Flatten the list of arguments into a list
 java.util.ArrayList<java.lang.String> buildCommandForNode(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> dataContext, java.lang.String osFamily)
          Generate the quoted and expanded argument list, by expanding property values given the data context, and quoting for the given OS
static ExecArgList.Builder builder()
          Create a Builder
static ExecArgList fromStrings(boolean quoted, java.lang.String... args)
           
static ExecArgList fromStrings(java.util.List<java.lang.String> strings, boolean quoted)
          Create an ExecArgList from a list of strings
static ExecArgList fromStrings(org.apache.commons.collections.Predicate quoteDetect, java.lang.String... args)
          Create an ExecArgList from a list of strings, and a predicate to determine whether the argument needs to be quoted
 java.util.List<ExecArg> getList()
          Return the list of ExecArg objects
static java.lang.String joinAndQuote(java.util.List<java.lang.String> commandList1, Converter<java.lang.String,java.lang.String> quote)
          Join a list of strings and then quote the entire string, if specified
 void visitWith(ExecArg.Visitor visitor)
          Visit with a visitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromStrings

public static ExecArgList fromStrings(boolean quoted,
                                      java.lang.String... args)

fromStrings

public static ExecArgList fromStrings(org.apache.commons.collections.Predicate quoteDetect,
                                      java.lang.String... args)
Create an ExecArgList from a list of strings, and a predicate to determine whether the argument needs to be quoted

Parameters:
quoteDetect -
args -
Returns:

fromStrings

public static ExecArgList fromStrings(java.util.List<java.lang.String> strings,
                                      boolean quoted)
Create an ExecArgList from a list of strings

Parameters:
strings - the strings
quoted - whether they are each quoted
Returns:

getList

public java.util.List<ExecArg> getList()
Return the list of ExecArg objects

Returns:

asFlatStringArray

public java.lang.String[] asFlatStringArray()
Flatten the list of arguments into an array

Returns:

asFlatStringList

public java.util.ArrayList<java.lang.String> asFlatStringList()
Flatten the list of arguments into a list

Returns:

joinAndQuote

public static java.lang.String joinAndQuote(java.util.List<java.lang.String> commandList1,
                                            Converter<java.lang.String,java.lang.String> quote)
Join a list of strings and then quote the entire string, if specified

Parameters:
commandList1 -
quote -
Returns:

buildCommandForNode

public java.util.ArrayList<java.lang.String> buildCommandForNode(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> dataContext,
                                                                 java.lang.String osFamily)
Generate the quoted and expanded argument list, by expanding property values given the data context, and quoting for the given OS

Parameters:
dataContext - property value data context
osFamily - OS family to determine quoting
Returns:
list of strings

builder

public static ExecArgList.Builder builder()
Create a Builder

Returns:

visitWith

public void visitWith(ExecArg.Visitor visitor)
Visit with a visitor

Parameters:
visitor -