Package com.dtolabs.rundeck.plugins.step
Class GeneratedScriptBuilder
- java.lang.Object
-
- com.dtolabs.rundeck.plugins.step.GeneratedScriptBuilder
-
- All Implemented Interfaces:
FileExtensionGeneratedScript
,GeneratedScript
public class GeneratedScriptBuilder extends java.lang.Object implements FileExtensionGeneratedScript
A simple implementation ofGeneratedScript
, which can be created via static factory methodsscript(String, String[])
orcommand(String...)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GeneratedScript
command(java.lang.String... command)
Create a commandjava.lang.String[]
getArgs()
Return arguments to the scriptjava.lang.String[]
getCommand()
Return the command to executejava.lang.String
getFileExtension()
java.lang.String
getScript()
Return the script to executestatic GeneratedScript
script(java.lang.String script, java.lang.String[] args)
Create a scriptstatic GeneratedScript
script(java.lang.String script, java.lang.String[] args, java.lang.String fileExtension)
Create a script
-
-
-
Method Detail
-
getScript
public java.lang.String getScript()
Description copied from interface:GeneratedScript
Return the script to execute- Specified by:
getScript
in interfaceGeneratedScript
- Returns:
- the script
-
getArgs
public java.lang.String[] getArgs()
Description copied from interface:GeneratedScript
Return arguments to the script- Specified by:
getArgs
in interfaceGeneratedScript
- Returns:
- the args
-
getCommand
public java.lang.String[] getCommand()
Description copied from interface:GeneratedScript
Return the command to execute- Specified by:
getCommand
in interfaceGeneratedScript
- Returns:
- the command
-
getFileExtension
public java.lang.String getFileExtension()
- Specified by:
getFileExtension
in interfaceFileExtensionGeneratedScript
-
script
public static GeneratedScript script(java.lang.String script, java.lang.String[] args)
Create a script- Parameters:
script
- the script textargs
- the arguments for the script- Returns:
- the generated script
-
script
public static GeneratedScript script(java.lang.String script, java.lang.String[] args, java.lang.String fileExtension)
Create a script- Parameters:
script
- the script textargs
- the arguments for the scriptfileExtension
- file extension- Returns:
- the generated script
-
command
public static GeneratedScript command(java.lang.String... command)
Create a command- Parameters:
command
- the command and arguments- Returns:
- the generated script
-
-