org.apache.tools.ant.taskdefs.optional.sos

Class SOS

public abstract class SOS extends Task implements SOSCmd

A base class for creating tasks for executing commands on SourceOffSite. These tasks were inspired by the VSS tasks.
Field Summary
protected CommandlinecommandLine
Commandline to be executed.
Method Summary
voidexecute()
Execute the created command line.
protected StringgetComment()
Get the comment
protected StringgetFilename()
Get the filename to be acted upon.
protected StringgetLabel()
Get the label
protected StringgetLocalPath()
Builds and returns the working directory.
protected StringgetNoCache()
Get the NoCache flag.
protected StringgetNoCompress()
Get the NoCompress flag.
protected voidgetOptionalAttributes()
Adds the optional attributes to the command line.
protected StringgetPassword()
Get the password
protected StringgetProjectPath()
Get the project path
protected StringgetRecursive()
Get the 'recursive' Flag.
protected voidgetRequiredAttributes()
Sets the executable and add the required attributes to the command line.
protected StringgetSosCommand()
Get the executable to run.
protected StringgetSosHome()
Get the SOS home directory.
protected StringgetSosServerPath()
Get the SOS serve path.
protected StringgetUsername()
Get the username
protected StringgetVerbose()
Get the 'verbose' Flag.
protected StringgetVersion()
Get the version
protected StringgetVssServerPath()
Get the VSS server path
protected intrun(Commandline cmd)
Execute the created command line.
protected voidsetInternalComment(String text)
Set the comment text.
protected voidsetInternalFilename(String file)
Set the file name.
protected voidsetInternalLabel(String text)
Set the label.
protected voidsetInternalRecursive(boolean recurse)
Set the recursive flag.
protected voidsetInternalVersion(String text)
Set the version.
voidsetLocalPath(Path path)
Override the working directory and get to the specified path.
voidsetNoCache(boolean nocache)
Flag to disable the cache when set.
voidsetNoCompress(boolean nocompress)
Flag to disable compression when set.
voidsetPassword(String password)
The SourceSafe password.
voidsetProjectPath(String projectpath)
The SourceSafe project path.
voidsetSosCmd(String dir)
The directory where soscmd(.exe) is located. soscmd must be on the path if omitted.
voidsetSosHome(String sosHome)
Path to the SourceOffSite home directory.
voidsetSosServerPath(String sosServerPath)
The address and port of SourceOffSite Server, for example 192.168.0.1:8888.
voidsetUsername(String username)
The SourceSafe username.
voidsetVerbose(boolean verbose)
Enable verbose output.
voidsetVssServerPath(String vssServerPath)
The path to the location of the ss.ini file.

Field Detail

commandLine

protected Commandline commandLine
Commandline to be executed.

Method Detail

execute

public void execute()
Execute the created command line.

Throws: BuildException on error.

getComment

protected String getComment()
Get the comment

Returns: if it was set, null if not.

getFilename

protected String getFilename()
Get the filename to be acted upon.

Returns: if it was set, null if not.

getLabel

protected String getLabel()
Get the label

Returns: if it was set, null if not.

getLocalPath

protected String getLocalPath()
Builds and returns the working directory.

The localpath is created if it didn't exist.

Returns: the absolute path of the working directory.

getNoCache

protected String getNoCache()
Get the NoCache flag.

Returns: the 'nocache' Flag if the attribute was 'true', otherwise an empty string.

getNoCompress

protected String getNoCompress()
Get the NoCompress flag.

Returns: the 'nocompress' Flag if the attribute was 'true', otherwise an empty string.

getOptionalAttributes

protected void getOptionalAttributes()
Adds the optional attributes to the command line.

getPassword

protected String getPassword()
Get the password

Returns: empty string if it wasn't set.

getProjectPath

protected String getProjectPath()
Get the project path

Returns: if it was set, null if not.

getRecursive

protected String getRecursive()
Get the 'recursive' Flag.

Returns: the 'recursive' Flag if the attribute was 'true', otherwise an empty string.

getRequiredAttributes

protected void getRequiredAttributes()
Sets the executable and add the required attributes to the command line.

getSosCommand

protected String getSosCommand()
Get the executable to run. Add the path if it was specifed in the build file

Returns: the executable to run.

getSosHome

protected String getSosHome()
Get the SOS home directory.

Returns: if it was set, null if not.

getSosServerPath

protected String getSosServerPath()
Get the SOS serve path.

Returns: if it was set, null if not.

getUsername

protected String getUsername()
Get the username

Returns: if it was set, null if not.

getVerbose

protected String getVerbose()
Get the 'verbose' Flag.

Returns: the 'verbose' Flag if the attribute was 'true', otherwise an empty string.

getVersion

protected String getVersion()
Get the version

Returns: if it was set, null if not.

getVssServerPath

protected String getVssServerPath()
Get the VSS server path

Returns: if it was set, null if not.

run

protected int run(Commandline cmd)
Execute the created command line.

Parameters: cmd The command line to run.

Returns: int the exit code.

Throws: BuildException

setInternalComment

protected void setInternalComment(String text)
Set the comment text.

Parameters: text the comment text to use.

setInternalFilename

protected void setInternalFilename(String file)
Set the file name.

Parameters: file the filename to use.

setInternalLabel

protected void setInternalLabel(String text)
Set the label.

Parameters: text the label to use.

setInternalRecursive

protected void setInternalRecursive(boolean recurse)
Set the recursive flag.

Parameters: recurse if true use the recursive flag on the command line.

setInternalVersion

protected void setInternalVersion(String text)
Set the version.

Parameters: text the version to use.

setLocalPath

public final void setLocalPath(Path path)
Override the working directory and get to the specified path.

Parameters: path The new localPath value.

setNoCache

public final void setNoCache(boolean nocache)
Flag to disable the cache when set. Required if SOSHOME is set as an environment variable. Defaults to false.

Parameters: nocache True to disable caching.

setNoCompress

public final void setNoCompress(boolean nocompress)
Flag to disable compression when set. Defaults to false.

Parameters: nocompress True to disable compression.

setPassword

public final void setPassword(String password)
The SourceSafe password.

Parameters: password The new password value.

setProjectPath

public final void setProjectPath(String projectpath)
The SourceSafe project path.

Parameters: projectpath The new projectpath value.

UNKNOWN: group="required"

setSosCmd

public final void setSosCmd(String dir)
The directory where soscmd(.exe) is located. soscmd must be on the path if omitted.

Parameters: dir The new sosCmd value.

setSosHome

public final void setSosHome(String sosHome)
Path to the SourceOffSite home directory.

Parameters: sosHome The new sosHome value.

setSosServerPath

public final void setSosServerPath(String sosServerPath)
The address and port of SourceOffSite Server, for example 192.168.0.1:8888.

Parameters: sosServerPath The new sosServerPath value.

UNKNOWN: group="required"

setUsername

public final void setUsername(String username)
The SourceSafe username.

Parameters: username The new username value.

UNKNOWN: group="required"

setVerbose

public void setVerbose(boolean verbose)
Enable verbose output. Defaults to false.

Parameters: verbose True for verbose output.

setVssServerPath

public final void setVssServerPath(String vssServerPath)
The path to the location of the ss.ini file.

Parameters: vssServerPath The new vssServerPath value.

UNKNOWN: group="required"