Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.sos

public abstract Class SOS

extends Task
implements SOSCmd
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.optional.sos.SOSCmd
Known Direct Subclasses
org.apache.tools.ant.taskdefs.optional.sos.SOSCheckin, org.apache.tools.ant.taskdefs.optional.sos.SOSCheckout, org.apache.tools.ant.taskdefs.optional.sos.SOSGet, org.apache.tools.ant.taskdefs.optional.sos.SOSLabel
Imports
java.io.File, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.taskdefs.Execute, .LogStreamHandler, org.apache.tools.ant.types.Commandline, .Path, org.apache.tools.ant.util.FileUtils

A base class for creating tasks for executing commands on SourceOffSite. These tasks were inspired by the VSS tasks.

Field Summary

Modifier and TypeField and Description
protected Commandline
commandLine

Commandline to be executed.

private String
private static final int
private String
private String
private String
private boolean
private boolean
private String
private boolean
private String
private String
private String
private String
private String
private boolean
private String
private String
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public
SOS()

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract Commandline

Returns:

The command line to execute.
buildCmdLine
()

Subclasses implement the logic required to construct the command line.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Execute the created command line.
protected String

Returns:

if it was set, null if not.
getComment
()

Get the comment

protected String

Returns:

if it was set, null if not.
getFilename
()

Get the filename to be acted upon.

protected String

Returns:

if it was set, null if not.
getLabel
()

Get the label

protected String

Returns:

the absolute path of the working directory.
getLocalPath
()

Builds and returns the working directory.

protected String

Returns:

the 'nocache' Flag if the attribute was 'true', otherwise an empty string.
getNoCache
()

Get the NoCache flag.

protected String

Returns:

the 'nocompress' Flag if the attribute was 'true', otherwise an empty string.
getNoCompress
()

Get the NoCompress flag.

protected void
getOptionalAttributes()

Adds the optional attributes to the command line.

protected String

Returns:

empty string if it wasn't set.
getPassword
()

Get the password

protected String

Returns:

if it was set, null if not.
getProjectPath
()

Get the project path

protected String

Returns:

the 'recursive' Flag if the attribute was 'true', otherwise an empty string.
getRecursive
()

Get the 'recursive' Flag.

protected void
getRequiredAttributes()

Sets the executable and add the required attributes to the command line.

protected String

Returns:

the executable to run.
getSosCommand
()

Get the executable to run.

protected String

Returns:

if it was set, null if not.
getSosHome
()

Get the SOS home directory.

protected String

Returns:

if it was set, null if not.
getSosServerPath
()

Get the SOS serve path.

protected String

Returns:

if it was set, null if not.
getUsername
()

Get the username

protected String

Returns:

the 'verbose' Flag if the attribute was 'true', otherwise an empty string.
getVerbose
()

Get the 'verbose' Flag.

protected String

Returns:

if it was set, null if not.
getVersion
()

Get the version

protected String

Returns:

if it was set, null if not.
getVssServerPath
()

Get the VSS server path

protected int

Returns:

int the exit code.
run
(Commandline
The command line to run.
cmd
)

Execute the created command line.

protected void
setInternalComment(String
the comment text to use.
text
)

Set the comment text.

protected void
setInternalFilename(String
the filename to use.
file
)

Set the file name.

protected void
setInternalLabel(String
the label to use.
text
)

Set the label.

protected void
setInternalRecursive(boolean
if true use the recursive flag on the command line.
recurse
)

Set the recursive flag.

protected void
setInternalVersion(String
the version to use.
text
)

Set the version.

public final void
setLocalPath(Path
The new localPath value.
path
)

Override the working directory and get to the specified path.

public final void
setNoCache(boolean
True to disable caching.
nocache
)

Flag to disable the cache when set.

public final void
setNoCompress(boolean
True to disable compression.
nocompress
)

Flag to disable compression when set.

public final void
setPassword(String
The new password value.
password
)

The SourceSafe password.

public final void
setProjectPath(String
The new projectpath value.
projectpath
)

The SourceSafe project path.

public final void
setSosCmd(String
The new sosCmd value.
dir
)

The directory where soscmd(.exe) is located.

public final void
setSosHome(String
The new sosHome value.
sosHome
)

Path to the SourceOffSite home directory.

public final void
setSosServerPath(String
The new sosServerPath value.
sosServerPath
)

The address and port of SourceOffSite Server, for example 192.168.0.1:8888.

public final void
setUsername(String
The new username value.
username
)

The SourceSafe username.

public void
setVerbose(boolean
True for verbose output.
verbose
)

Enable verbose output.

public final void
setVssServerPath(String
The new vssServerPath value.
vssServerPath
)

The path to the location of the ss.ini file.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

commandLineback to summary
protected Commandline commandLine

Commandline to be executed.

commentback to summary
private String comment
ERROR_EXIT_STATUSback to summary
private static final int ERROR_EXIT_STATUS
filenameback to summary
private String filename
labelback to summary
private String label
localPathback to summary
private String localPath
noCacheback to summary
private boolean noCache
noCompressback to summary
private boolean noCompress
projectPathback to summary
private String projectPath
recursiveback to summary
private boolean recursive
sosCmdDirback to summary
private String sosCmdDir
sosHomeback to summary
private String sosHome
sosPasswordback to summary
private String sosPassword
sosServerPathback to summary
private String sosServerPath
sosUsernameback to summary
private String sosUsername
verboseback to summary
private boolean verbose
versionback to summary
private String version
vssServerPathback to summary
private String vssServerPath

Constructor Detail

SOSback to summary
public SOS()

Method Detail

buildCmdLineback to summary
pack-priv abstract Commandline buildCmdLine()

Subclasses implement the logic required to construct the command line.

Returns:Commandline

The command line to execute.

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Execute the created command line.

Annotations
@Override
Exceptions
BuildException:
on error.
getCommentback to summary
protected String getComment()

Get the comment

Returns:String

if it was set, null if not.

getFilenameback to summary
protected String getFilename()

Get the filename to be acted upon.

Returns:String

if it was set, null if not.

getLabelback to summary
protected String getLabel()

Get the label

Returns:String

if it was set, null if not.

getLocalPathback to summary
protected String getLocalPath()

Builds and returns the working directory.

The localpath is created if it didn't exist.

Returns:String

the absolute path of the working directory.

getNoCacheback to summary
protected String getNoCache()

Get the NoCache flag.

Returns:String

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

getNoCompressback to summary
protected String getNoCompress()

Get the NoCompress flag.

Returns:String

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

getOptionalAttributesback to summary
protected void getOptionalAttributes()

Adds the optional attributes to the command line.

getPasswordback to summary
protected String getPassword()

Get the password

Returns:String

empty string if it wasn't set.

getProjectPathback to summary
protected String getProjectPath()

Get the project path

Returns:String

if it was set, null if not.

getRecursiveback to summary
protected String getRecursive()

Get the 'recursive' Flag.

Returns:String

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

getRequiredAttributesback to summary
protected void getRequiredAttributes()

Sets the executable and add the required attributes to the command line.

getSosCommandback to summary
protected String getSosCommand()

Get the executable to run. Add the path if it was specified in the build file

Returns:String

the executable to run.

getSosHomeback to summary
protected String getSosHome()

Get the SOS home directory.

Returns:String

if it was set, null if not.

getSosServerPathback to summary
protected String getSosServerPath()

Get the SOS serve path.

Returns:String

if it was set, null if not.

getUsernameback to summary
protected String getUsername()

Get the username

Returns:String

if it was set, null if not.

getVerboseback to summary
protected String getVerbose()

Get the 'verbose' Flag.

Returns:String

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

getVersionback to summary
protected String getVersion()

Get the version

Returns:String

if it was set, null if not.

getVssServerPathback to summary
protected String getVssServerPath()

Get the VSS server path

Returns:String

if it was set, null if not.

runback to summary
protected int run(Commandline cmd)

Execute the created command line.

Parameters
cmd:Commandline

The command line to run.

Returns:int

int the exit code.

Exceptions
BuildException:
if something goes wrong
setInternalCommentback to summary
protected void setInternalComment(String text)

Set the comment text.

Parameters
text:String

the comment text to use.

setInternalFilenameback to summary
protected void setInternalFilename(String file)

Set the file name.

Parameters
file:String

the filename to use.

setInternalLabelback to summary
protected void setInternalLabel(String text)

Set the label.

Parameters
text:String

the label to use.

setInternalRecursiveback to summary
protected void setInternalRecursive(boolean recurse)

Set the recursive flag.

Parameters
recurse:boolean

if true use the recursive flag on the command line.

setInternalVersionback to summary
protected void setInternalVersion(String text)

Set the version.

Parameters
text:String

the version to use.

setLocalPathback to summary
public final void setLocalPath(Path path)

Override the working directory and get to the specified path.

Parameters
path:Path

The new localPath value.

setNoCacheback to summary
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:boolean

True to disable caching.

setNoCompressback to summary
public final void setNoCompress(boolean nocompress)

Flag to disable compression when set. Defaults to false.

Parameters
nocompress:boolean

True to disable compression.

setPasswordback to summary
public final void setPassword(String password)

The SourceSafe password.

Parameters
password:String

The new password value.

setProjectPathback to summary
public final void setProjectPath(String projectpath)

The SourceSafe project path.

Parameters
projectpath:String

The new projectpath value.

setSosCmdback to summary
public final void setSosCmd(String dir)

The directory where soscmd(.exe) is located. soscmd must be on the path if omitted.

Parameters
dir:String

The new sosCmd value.

setSosHomeback to summary
public final void setSosHome(String sosHome)

Path to the SourceOffSite home directory.

Parameters
sosHome:String

The new sosHome value.

setSosServerPathback to summary
public final void setSosServerPath(String sosServerPath)

The address and port of SourceOffSite Server, for example 192.168.0.1:8888.

Parameters
sosServerPath:String

The new sosServerPath value.

setUsernameback to summary
public final void setUsername(String username)

The SourceSafe username.

Parameters
username:String

The new username value.

setVerboseback to summary
public void setVerbose(boolean verbose)

Enable verbose output. Defaults to false.

Parameters
verbose:boolean

True for verbose output.

setVssServerPathback to summary
public final void setVssServerPath(String vssServerPath)

The path to the location of the ss.ini file.

Parameters
vssServerPath:String

The new vssServerPath value.