org.apache.maven.shared.utils.cli.shell
Class Shell

java.lang.Object
  extended by org.apache.maven.shared.utils.cli.shell.Shell
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
BourneShell, CmdShell, CommandShell

public class Shell
extends Object
implements Cloneable

Class that abstracts the Shell functionality, with subclases for shells that behave particularly, like

Author:
Carlos Sanchez

Constructor Summary
Shell()
           
 
Method Summary
 Object clone()
           
 String getExecutable()
           
 List<String> getShellCommandLine(String... arguments)
          Get the full command line to execute, including shell command, shell arguments, executable and executable arguments
 File getWorkingDirectory()
           
protected  boolean isDoubleQuotedArgumentEscaped()
           
protected  boolean isSingleQuotedArgumentEscaped()
           
 void setExecutable(String executable)
          Sets the executable to run.
 void setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled)
           
 void setWorkingDirectory(File workingDir)
          Sets execution directory.
 void setWorkingDirectory(String path)
          Sets execution directory.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Shell

public Shell()
Method Detail

isDoubleQuotedArgumentEscaped

protected boolean isDoubleQuotedArgumentEscaped()

isSingleQuotedArgumentEscaped

protected boolean isSingleQuotedArgumentEscaped()

getShellCommandLine

public List<String> getShellCommandLine(String... arguments)
Get the full command line to execute, including shell command, shell arguments, executable and executable arguments

Parameters:
arguments - arguments for the executable, not the shell
Returns:
List of String objects, whose array version is suitable to be used as argument of Runtime.getRuntime().exec()

setQuotedArgumentsEnabled

public void setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled)

setExecutable

public void setExecutable(String executable)
Sets the executable to run.


getExecutable

public String getExecutable()

setWorkingDirectory

public void setWorkingDirectory(String path)
Sets execution directory.


setWorkingDirectory

public void setWorkingDirectory(File workingDir)
Sets execution directory.


getWorkingDirectory

public File getWorkingDirectory()

clone

public Object clone()
Overrides:
clone in class Object


Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.