FileDocCategorySizeDatePackage
SOSGet.javaAPI DocApache Ant 1.704210Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs.optional.sos

SOSGet

public class SOSGet extends SOS
Retrieves a read-only copy of the specified project or file from Visual SourceSafe via a SourceOffSite server.
ant.task
name="sosget" category="scm"

Fields Summary
Constructors Summary
Methods Summary
protected org.apache.tools.ant.types.CommandlinebuildCmdLine()
Build the command line
GetFile required parameters: -server -name -password -database -project -file
GetFile optional parameters: -workdir -revision -verbose -nocache -nocompression -soshome
GetProject required parameters: -server -name -password -database -project
GetProject optional parameters: -label -workdir -recursive -verbose -nocache -nocompression -soshome

return
Commandline the generated command to be executed

        commandLine = new Commandline();

        // If we find a "file" attribute then act on a file otherwise act on a project
        if (getFilename() != null) {
            // add -command GetFile to the commandline
            commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
            commandLine.createArgument().setValue(SOSCmd.COMMAND_GET_FILE);
            // add -file xxxxx to the commandline
            commandLine.createArgument().setValue(SOSCmd.FLAG_FILE);
            commandLine.createArgument().setValue(getFilename());
            // look for a version attribute
            if (getVersion() != null) {
                //add -revision xxxxx to the commandline
                commandLine.createArgument().setValue(SOSCmd.FLAG_VERSION);
                commandLine.createArgument().setValue(getVersion());
            }
        } else {
            // add -command GetProject to the commandline
            commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);
            commandLine.createArgument().setValue(SOSCmd.COMMAND_GET_PROJECT);
            // look for a recursive option
            commandLine.createArgument().setValue(getRecursive());
            // look for a label option
            if (getLabel() != null) {
                commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL);
                commandLine.createArgument().setValue(getLabel());
            }
        }

        getRequiredAttributes();
        getOptionalAttributes();

        return commandLine;
    
public final voidsetFile(java.lang.String filename)
The Filename to act upon. If no file is specified then the tasks act upon the project.

param
filename The new file value

        super.setInternalFilename(filename);
    
public voidsetLabel(java.lang.String label)
The labeled version to operate on in SourceSafe.

param
label The new label value

        super.setInternalLabel(label);
    
public voidsetRecursive(boolean recursive)
Flag to recursively apply the action. Defaults to false

param
recursive True for recursive operation.

        super.setInternalRecursive(recursive);
    
public voidsetVersion(java.lang.String version)
Set the version number to get - only works with SOSGet on a file.

param
version The new version value

        super.setInternalVersion(version);