|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.gate.versioning.cmdline.AbstractRepository
class AbstractRepository
Abstract repository implementation. The public API of this class is documented on the Repository interface. Implementors control the behaviour of the methods here by overriding parameterisation methods like #getCommandName, or simply by providing their own replacement implementations of the Repository methods.
Nested Class Summary | |
---|---|
class |
AbstractRepository.StreamGobbler
This class is used to consume streams in new threads without blocking. |
Field Summary | |
---|---|
protected static boolean |
DEBUG
Debugging messages. |
protected String |
commandOutput
Output from repository command execution. |
protected String |
nl
Shorthand for newlines. |
protected String |
root
The root or URL of the repository. |
protected String |
stderrOutput
Stderr from repository command execution. |
protected String |
stdoutOutput
Stdout from repository command execution. |
protected File |
workingDir
The current working directory. |
Constructor Summary | |
AbstractRepository()
Construction. |
Method Summary | |
---|---|
boolean
|
add(String fileName)
Add to the repository. |
protected String[]
|
buildCommandArray(String fileName, String subCommand, String subCommandFlag)
Calls { java.lang.String, boolean) buildCommandArray/4} with the no root parameter set false. |
protected String[]
|
buildCommandArray(String fileName, String subCommand, String subCommandFlag, boolean noRoot)
Build an array to pass to runtime.exec. |
boolean
|
checkin(String fileName)
Commit changes. |
boolean
|
checkin(String fileName, String message)
Commit changes. |
boolean
|
checkout(String fileName)
Check out a file, directory or module. |
boolean
|
delete(String fileName)
Delete from the repository. |
String
|
diff(String fileName)
Get the difference with the repository version. |
String
|
getCommandName()
Name of the repository command to execute. |
String
|
getCommandOutput()
Get a string containing the stdout and stderr from the command execution. |
String
|
getCommandStderr()
Get a string containing the stderr from the command execution. |
String
|
getCommandStdout()
Get a string containing the stdout from the command execution. |
protected List
|
getPostCommand(String fileName, boolean noRoot)
Specifies what (if anything) should follow the subcommand. |
protected List
|
getPreCommand()
Specifies what (if anything) should precede the subcommand. |
static Repository
|
getRepository(String root)
Return a class that supports the given root specifier. |
String
|
getRoot()
The root / URL of the repository |
void
|
init()
Validate parameters. |
protected boolean
|
runCommand(String[] command)
Run a command, wait for termination and report status |
protected boolean
|
runCommand(String[] command, boolean allowExitOne)
Run a command, wait for termination and report status. |
void
|
setRoot(String root)
The root / URL of the repository |
void
|
setWorkingDir(File workingDir)
The working directory for repository actions |
String
|
status(String fileName)
Status. |
boolean
|
update(String fileName)
Update. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Field Detail |
---|
protected static boolean DEBUG
protected String commandOutput
protected String nl
protected String root
protected String stderrOutput
protected String stdoutOutput
protected File workingDir
Constructor Detail |
---|
public AbstractRepository()
Method Detail |
---|
public boolean add(String fileName)
protected String[] buildCommandArray(String fileName, String subCommand, String subCommandFlag)
protected String[] buildCommandArray(String fileName, String subCommand, String subCommandFlag, boolean noRoot)
public boolean checkin(String fileName)
public boolean checkin(String fileName, String message)
public boolean checkout(String fileName)
public boolean delete(String fileName)
public String diff(String fileName)
public String getCommandName()
public String getCommandOutput()
public String getCommandStderr()
public String getCommandStdout()
protected List getPostCommand(String fileName, boolean noRoot)
protected List getPreCommand()
public static Repository getRepository(String root)
public String getRoot()
public void init()
protected boolean runCommand(String[] command)
protected boolean runCommand(String[] command, boolean allowExitOne)
public void setRoot(String root)
public void setWorkingDir(File workingDir)
public String status(String fileName)
public boolean update(String fileName)
Groovy Documentation