Class SOS
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.sos.SOS
- Direct Known Subclasses:
- SOSCheckin,- SOSCheckout,- SOSGet,- SOSLabel
A base class for creating tasks for executing commands on SourceOffSite.
  These tasks were inspired by the VSS tasks.
- 
Field SummaryFieldsFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, projectFields inherited from interface org.apache.tools.ant.taskdefs.optional.sos.SOSCmdCOMMAND_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidexecute()Execute the created command line.protected StringGet the commentprotected StringGet the filename to be acted upon.protected StringgetLabel()Get the labelprotected StringBuilds and returns the working directory.protected StringGet the NoCache flag.protected StringGet the NoCompress flag.protected voidAdds the optional attributes to the command line.protected StringGet the passwordprotected StringGet the project pathprotected StringGet the 'recursive' Flag.protected voidSets the executable and add the required attributes to the command line.protected StringGet the executable to run.protected StringGet the SOS home directory.protected StringGet the SOS serve path.protected StringGet the usernameprotected StringGet the 'verbose' Flag.protected StringGet the versionprotected StringGet the VSS server pathprotected 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.final voidsetLocalPath(Path path) Override the working directory and get to the specified path.final voidsetNoCache(boolean nocache) Flag to disable the cache when set.final voidsetNoCompress(boolean nocompress) Flag to disable compression when set.final voidsetPassword(String password) The SourceSafe password.final voidsetProjectPath(String projectpath) The SourceSafe project path.final voidThe directory where soscmd(.exe) is located.final voidsetSosHome(String sosHome) Path to the SourceOffSite home directory.final voidsetSosServerPath(String sosServerPath) The address and port of SourceOffSite Server, for example 192.168.0.1:8888.final voidsetUsername(String username) The SourceSafe username.voidsetVerbose(boolean verbose) Enable verbose output.final voidsetVssServerPath(String vssServerPath) The path to the location of the ss.ini file.Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Field Details- 
commandLineCommandline to be executed.
 
- 
- 
Constructor Details- 
SOSpublic SOS()
 
- 
- 
Method Details- 
setNoCachepublic 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.
 
- 
setNoCompresspublic final void setNoCompress(boolean nocompress) Flag to disable compression when set. Defaults to false.- Parameters:
- nocompress- True to disable compression.
 
- 
setSosCmdThe directory where soscmd(.exe) is located. soscmd must be on the path if omitted.- Parameters:
- dir- The new sosCmd value.
 
- 
setUsernameThe SourceSafe username.- Parameters:
- username- The new username value.
 
- 
setPasswordThe SourceSafe password.- Parameters:
- password- The new password value.
 
- 
setProjectPathThe SourceSafe project path.- Parameters:
- projectpath- The new projectpath value.
 
- 
setVssServerPathThe path to the location of the ss.ini file.- Parameters:
- vssServerPath- The new vssServerPath value.
 
- 
setSosHomePath to the SourceOffSite home directory.- Parameters:
- sosHome- The new sosHome value.
 
- 
setSosServerPathThe address and port of SourceOffSite Server, for example 192.168.0.1:8888.- Parameters:
- sosServerPath- The new sosServerPath value.
 
- 
setLocalPathOverride the working directory and get to the specified path.- Parameters:
- path- The new localPath value.
 
- 
setVerbosepublic void setVerbose(boolean verbose) Enable verbose output. Defaults to false.- Parameters:
- verbose- True for verbose output.
 
- 
setInternalFilenameSet the file name.- Parameters:
- file- the filename to use.
 
- 
setInternalRecursiveprotected void setInternalRecursive(boolean recurse) Set the recursive flag.- Parameters:
- recurse- if true use the recursive flag on the command line.
 
- 
setInternalCommentSet the comment text.- Parameters:
- text- the comment text to use.
 
- 
setInternalLabelSet the label.- Parameters:
- text- the label to use.
 
- 
setInternalVersionSet the version.- Parameters:
- text- the version to use.
 
- 
getSosCommandGet the executable to run. Add the path if it was specified in the build file- Returns:
- the executable to run.
 
- 
getCommentGet the comment- Returns:
- if it was set, null if not.
 
- 
getVersionGet the version- Returns:
- if it was set, null if not.
 
- 
getLabelGet the label- Returns:
- if it was set, null if not.
 
- 
getUsernameGet the username- Returns:
- if it was set, null if not.
 
- 
getPasswordGet the password- Returns:
- empty string if it wasn't set.
 
- 
getProjectPathGet the project path- Returns:
- if it was set, null if not.
 
- 
getVssServerPathGet the VSS server path- Returns:
- if it was set, null if not.
 
- 
getSosHomeGet the SOS home directory.- Returns:
- if it was set, null if not.
 
- 
getSosServerPathGet the SOS serve path.- Returns:
- if it was set, null if not.
 
- 
getFilenameGet the filename to be acted upon.- Returns:
- if it was set, null if not.
 
- 
getNoCompressGet the NoCompress flag.- Returns:
- the 'nocompress' Flag if the attribute was 'true', otherwise an empty string.
 
- 
getNoCacheGet the NoCache flag.- Returns:
- the 'nocache' Flag if the attribute was 'true', otherwise an empty string.
 
- 
getVerboseGet the 'verbose' Flag.- Returns:
- the 'verbose' Flag if the attribute was 'true', otherwise an empty string.
 
- 
getRecursiveGet the 'recursive' Flag.- Returns:
- the 'recursive' Flag if the attribute was 'true', otherwise an empty string.
 
- 
getLocalPathBuilds and returns the working directory.The localpath is created if it didn't exist. - Returns:
- the absolute path of the working directory.
 
- 
executeExecute the created command line.- Overrides:
- executein class- Task
- Throws:
- BuildException- on error.
 
- 
runExecute the created command line.- Parameters:
- cmd- The command line to run.
- Returns:
- int the exit code.
- Throws:
- BuildException- if something goes wrong
 
- 
getRequiredAttributesprotected void getRequiredAttributes()Sets the executable and add the required attributes to the command line.
- 
getOptionalAttributesprotected void getOptionalAttributes()Adds the optional attributes to the command line.
 
-