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

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.optional.sos.SOS
All Implemented Interfaces:
SOSCmd
Direct Known Subclasses:
SOSCheckin, SOSCheckout, SOSGet, SOSLabel

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  Commandline commandLine
          Commandline to be executed
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Fields inherited from interface org.apache.tools.ant.taskdefs.optional.sos.SOSCmd
COMMAND_CHECKIN_FILE, COMMAND_CHECKIN_PROJECT, COMMAND_CHECKOUT_FILE, COMMAND_CHECKOUT_PROJECT, COMMAND_GET_FILE, COMMAND_GET_PROJECT, COMMAND_HISTORY, COMMAND_LABEL, COMMAND_SOS_EXE, FLAG_COMMAND, FLAG_COMMENT, FLAG_FILE, FLAG_LABEL, FLAG_NO_CACHE, FLAG_NO_COMPRESSION, FLAG_PASSWORD, FLAG_PROJECT, FLAG_RECURSION, FLAG_SOS_HOME, FLAG_SOS_SERVER, FLAG_USERNAME, FLAG_VERBOSE, FLAG_VERSION, FLAG_VSS_SERVER, FLAG_WORKING_DIR, PROJECT_PREFIX
 
Constructor Summary
SOS()
           
 
Method Summary
 void execute()
          Execute the created command line.
protected  java.lang.String getComment()
          Get the comment
protected  java.lang.String getFilename()
          Get the filename to be acted upon
protected  java.lang.String getLabel()
          Get the label
protected  java.lang.String getLocalPath()
          Builds and returns the working directory.
protected  java.lang.String getNoCache()
          Get the NoCache flag
protected  java.lang.String getNoCompress()
          Get the NoCompress flag
protected  void getOptionalAttributes()
          Adds the optional attributes to the command line.
protected  java.lang.String getPassword()
          Get the password
protected  java.lang.String getProjectPath()
          Get the project path
protected  java.lang.String getRecursive()
          Get the 'recursive' Flag
protected  void getRequiredAttributes()
          Sets the executable and add the required attributes to the command line.
protected  java.lang.String getSosCommand()
          Get the executable to run.
protected  java.lang.String getSosHome()
          Get the SOS home directory
protected  java.lang.String getSosServerPath()
          Get the SOS serve path
protected  java.lang.String getUsername()
          Get the username
protected  java.lang.String getVerbose()
          Get the 'verbose' Flag
protected  java.lang.String getVersion()
          Get the version
protected  java.lang.String getVssServerPath()
          Get the VSS server path
protected  int run(Commandline cmd)
          Execute the created command line.
protected  void setInternalComment(java.lang.String text)
           
protected  void setInternalFilename(java.lang.String file)
           
protected  void setInternalLabel(java.lang.String text)
           
protected  void setInternalRecursive(boolean recurse)
           
protected  void setInternalVersion(java.lang.String text)
           
 void setLocalPath(Path path)
          Override the working directory and get to the specified path.
 void setNoCache(boolean nocache)
          Flag to disable the cache when set.
 void setNoCompress(boolean nocompress)
          Flag to disable compression when set.
 void setPassword(java.lang.String password)
          The SourceSafe password.
 void setProjectPath(java.lang.String projectpath)
          The SourceSafe project path.
 void setSosCmd(java.lang.String dir)
          The directory where soscmd(.exe) is located.
 void setSosHome(java.lang.String sosHome)
          Path to the SourceOffSite home directory.
 void setSosServerPath(java.lang.String sosServerPath)
          The address and port of SourceOffSite Server, for example 192.168.0.1:8888.
 void setUsername(java.lang.String username)
          The SourceSafe username.
 void setVerbose(boolean verbose)
          Enable verbose output.
 void setVssServerPath(java.lang.String vssServerPath)
          The path to the location of the ss.ini file.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandLine

protected Commandline commandLine
Commandline to be executed

Constructor Detail

SOS

public SOS()
Method Detail

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.

setSosCmd

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

Parameters:
dir - The new sosCmd value

setUsername

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

Parameters:
username - The new username value

setPassword

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

Parameters:
password - The new password value

setProjectPath

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

Parameters:
projectpath - The new projectpath value

setVssServerPath

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

Parameters:
vssServerPath - The new vssServerPath value

setSosHome

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

Parameters:
sosHome - The new sosHome value

setSosServerPath

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

Parameters:
sosServerPath - The new sosServerPath value

setLocalPath

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

Parameters:
path - The new localPath value

setVerbose

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

Parameters:
verbose - True for verbose output.

setInternalFilename

protected void setInternalFilename(java.lang.String file)

setInternalRecursive

protected void setInternalRecursive(boolean recurse)

setInternalComment

protected void setInternalComment(java.lang.String text)

setInternalLabel

protected void setInternalLabel(java.lang.String text)

setInternalVersion

protected void setInternalVersion(java.lang.String text)

getSosCommand

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

Returns:
the executable to run

getComment

protected java.lang.String getComment()
Get the comment

Returns:
if it was set, null if not

getVersion

protected java.lang.String getVersion()
Get the version

Returns:
if it was set, null if not

getLabel

protected java.lang.String getLabel()
Get the label

Returns:
if it was set, null if not

getUsername

protected java.lang.String getUsername()
Get the username

Returns:
if it was set, null if not

getPassword

protected java.lang.String getPassword()
Get the password

Returns:
empty string if it wans't set

getProjectPath

protected java.lang.String getProjectPath()
Get the project path

Returns:
if it was set, null if not

getVssServerPath

protected java.lang.String getVssServerPath()
Get the VSS server path

Returns:
if it was set, null if not

getSosHome

protected java.lang.String getSosHome()
Get the SOS home directory

Returns:
if it was set, null if not

getSosServerPath

protected java.lang.String getSosServerPath()
Get the SOS serve path

Returns:
if it was set, null if not

getFilename

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

Returns:
if it was set, null if not

getNoCompress

protected java.lang.String getNoCompress()
Get the NoCompress flag

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

getNoCache

protected java.lang.String getNoCache()
Get the NoCache flag

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

getVerbose

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

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

getRecursive

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

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

getLocalPath

protected java.lang.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

execute

public void execute()
             throws BuildException
Execute the created command line.

Overrides:
execute in class Task
Throws:
BuildException

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

getRequiredAttributes

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


getOptionalAttributes

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



Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.