MSVSSADD (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.optional.vss, class: MSVSSADD

# Class MSVSSADD

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.vss.MSVSS
org.apache.tools.ant.taskdefs.optional.vss.MSVSSADD

All Implemented Interfaces:
  `Cloneable, MSVSSConstants`

public class MSVSSADD extends MSVSS
Performs Add commands to Microsoft Visual SourceSafe.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class MSVSS

  `MSVSS.CurrentModUpdated, MSVSS.WritableFiles`
  Modifier and Type
  Class
  Description
  `static class`
  `MSVSS.CurrentModUpdated`
  Extension of EnumeratedAttribute to hold the values for file time stamp.
  `static class`
  `MSVSS.WritableFiles`
  Extension of EnumeratedAttribute to hold the values for writable filess.

- ## Field Summary

  ### Fields inherited from class Task

  `target, taskName, taskType, wrapper`
  Modifier and Type
  Field
  Description
  `protected Target`
  `target`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskName`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskType`
  Deprecated.
  since 1.6.x.
  `protected RuntimeConfigurable`
  `wrapper`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from interface MSVSSConstants

  `COMMAND_ADD, COMMAND_CHECKIN, COMMAND_CHECKOUT, COMMAND_CP, COMMAND_CREATE, COMMAND_GET, COMMAND_HISTORY, COMMAND_LABEL, FLAG_AUTORESPONSE_DEF, FLAG_AUTORESPONSE_NO, FLAG_AUTORESPONSE_YES, FLAG_BRIEF, FLAG_CODEDIFF, FLAG_COMMENT, FLAG_FILETIME_DEF, FLAG_FILETIME_MODIFIED, FLAG_FILETIME_UPDATED, FLAG_LABEL, FLAG_LOGIN, FLAG_NO_FILE, FLAG_NO_GET, FLAG_OUTPUT, FLAG_OVERRIDE_WORKING_DIR, FLAG_QUIET, FLAG_RECURSION, FLAG_REPLACE_WRITABLE, FLAG_SKIP_WRITABLE, FLAG_USER, FLAG_VERSION, FLAG_VERSION_DATE, FLAG_VERSION_LABEL, FLAG_WRITABLE, PROJECT_PREFIX, SS_EXE, STYLE_BRIEF, STYLE_CODEDIFF, STYLE_DEFAULT, STYLE_NOFILE, TIME_CURRENT, TIME_MODIFIED, TIME_UPDATED, VALUE_FROMDATE, VALUE_FROMLABEL, VALUE_NO, VALUE_YES, WRITABLE_FAIL, WRITABLE_REPLACE, WRITABLE_SKIP`
  Modifier and Type
  Field
  Description
  `static final String`
  `COMMAND_ADD`
  The 'Add' command
  `static final String`
  `COMMAND_CHECKIN`
  The 'Checkin' command
  `static final String`
  `COMMAND_CHECKOUT`
  The 'Checkout' command
  `static final String`
  `COMMAND_CP`
  The 'CP' command
  `static final String`
  `COMMAND_CREATE`
  The 'Create' command
  `static final String`
  `COMMAND_GET`
  The 'Get' command
  `static final String`
  `COMMAND_HISTORY`
  The 'History' command
  `static final String`
  `COMMAND_LABEL`
  The 'Label' command
  `static final String`
  `FLAG_AUTORESPONSE_DEF`
  -I- flag
  `static final String`
  `FLAG_AUTORESPONSE_NO`
  -I-N flag
  `static final String`
  `FLAG_AUTORESPONSE_YES`
  -I-Y flag
  `static final String`
  `FLAG_BRIEF`
  -B flag
  `static final String`
  `FLAG_CODEDIFF`
  -D flag
  `static final String`
  `FLAG_COMMENT`
  -C flag
  `static final String`
  `FLAG_FILETIME_DEF`
  -GTC flag
  `static final String`
  `FLAG_FILETIME_MODIFIED`
  -GTM flag
  `static final String`
  `FLAG_FILETIME_UPDATED`
  -GTU flag
  `static final String`
  `FLAG_LABEL`
  -L flag
  `static final String`
  `FLAG_LOGIN`
  -Y flag
  `static final String`
  `FLAG_NO_FILE`
  -F- flag
  `static final String`
  `FLAG_NO_GET`
  -G- flag
  `static final String`
  `FLAG_OUTPUT`
  -O flag
  `static final String`
  `FLAG_OVERRIDE_WORKING_DIR`
  -GL flag
  `static final String`
  `FLAG_QUIET`
  -O- flag
  `static final String`
  `FLAG_RECURSION`
  -R flag
  `static final String`
  `FLAG_REPLACE_WRITABLE`
  -GWR flag
  `static final String`
  `FLAG_SKIP_WRITABLE`
  -GWS flag
  `static final String`
  `FLAG_USER`
  -U flag
  `static final String`
  `FLAG_VERSION`
  -V flag
  `static final String`
  `FLAG_VERSION_DATE`
  -Vd flag
  `static final String`
  `FLAG_VERSION_LABEL`
  -VL flag
  `static final String`
  `FLAG_WRITABLE`
  -W flag
  `static final String`
  `PROJECT_PREFIX`
  Dollar Sigh to prefix the project path
  `static final String`
  `SS_EXE`
  Constant for the thing to execute
  `static final String`
  `STYLE_BRIEF`
  The brief style flag
  `static final String`
  `STYLE_CODEDIFF`
  The codediff style flag
  `static final String`
  `STYLE_DEFAULT`
  The default style flag
  `static final String`
  `STYLE_NOFILE`
  The nofile style flag
  `static final String`
  `TIME_CURRENT`
  The text for current (default) timestamp
  `static final String`
  `TIME_MODIFIED`
  The text for modified timestamp
  `static final String`
  `TIME_UPDATED`
  The text for updated timestamp
  `static final String`
  `VALUE_FROMDATE`
  ~d flag
  `static final String`
  `VALUE_FROMLABEL`
  ~L flag
  `static final String`
  `VALUE_NO`
  -N flag
  `static final String`
  `VALUE_YES`
  -Y flag
  `static final String`
  `WRITABLE_FAIL`
  The text for failing on writable files
  `static final String`
  `WRITABLE_REPLACE`
  The text for replacing writable files
  `static final String`
  `WRITABLE_SKIP`
  The text for skipping writable files

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MSVSSADD()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Commandline`
  `buildCmdLine()`
  Builds a command line to execute ss.
  `protected String`
  `getLocalpath()`
  Returns the local path without the flag.; required
  `void`
  `setAutoresponse(String response)`
  Autoresponse behaviour.
  `void`
  `setComment(String comment)`
  Comment to apply to files added to SourceSafe.
  `void`
  `setLocalpath(Path localPath)`
  Override the project working directory.
  `void`
  `setRecursive(boolean recursive)`
  Add files recursively.
  `final void`
  `setWritable(boolean writable)`
  Unset the READ-ONLY flag on local copies of files added to VSS.

  ### Methods inherited from class MSVSS

  `execute, getAutoresponse, getComment, getFileTimeStamp, getGetLocalCopy, getLabel, getLogin, getOutput, getQuiet, getRecursive, getSSCommand, getStyle, getUser, getVersion, getVersionDate, getVersionDateLabel, getVersionLabel, getVsspath, getWritable, getWritableFiles, setFailOnError, setInternalAutoResponse, setInternalComment, setInternalDate, setInternalDateFormat, setInternalFailOnError, setInternalFileTimeStamp, setInternalFromDate, setInternalFromLabel, setInternalGetLocalCopy, setInternalLabel, setInternalLocalPath, setInternalNumDays, setInternalOutputFilename, setInternalQuiet, setInternalRecursive, setInternalStyle, setInternalToDate, setInternalToLabel, setInternalUser, setInternalVersion, setInternalWritable, setInternalWritableFiles, setLogin, setServerpath, setSsdir, setVsspath`
  Modifier and Type
  Method
  Description
  `void`
  `execute()`
  Executes the task.
  `protected String`
  `getAutoresponse()`
  Gets the auto response string.
  `protected String`
  `getComment()`
  Gets the comment string.
  `String`
  `getFileTimeStamp()`
  Gets the value set for the FileTimeStamp.
  `protected String`
  `getGetLocalCopy()`
  Builds and returns the -G- flag if required.
  `protected String`
  `getLabel()`
  Gets the label string.
  `protected String`
  `getLogin()`
  Gets the login string.
  `protected String`
  `getOutput()`
  Gets the output file string.
  `protected String`
  `getQuiet()`
  Gets the quiet string.
  `protected String`
  `getRecursive()`
  Gets the recursive string.
  `protected String`
  `getSSCommand()`
  Gets the sscommand string.
  `protected String`
  `getStyle()`
  Gets the style string.
  `protected String`
  `getUser()`
  Gets the user string.
  `protected String`
  `getVersion()`
  Gets the version string.
  `protected String`
  `getVersionDate()`
  Gets the Version date string.
  `protected String`
  `getVersionDateLabel()`
  Gets the version string.
  `protected String`
  `getVersionLabel()`
  Gets the version string.
  `protected String`
  `getVsspath()`
  Gets the vssserverpath string.
  `protected String`
  `getWritable()`
  Gets the writable string.
  `String`
  `getWritableFiles()`
  Gets the value to determine the behaviour when encountering writable files.
  `final void`
  `setFailOnError(boolean failOnError)`
  Indicates if the build should fail if the Sourcesafe command does.
  `protected void`
  `setInternalAutoResponse(String autoResponse)`
  Set the auto response attribute.
  `protected void`
  `setInternalComment(String comment)`
  Set the internal comment attribute.
  `protected void`
  `setInternalDate(String date)`
  Set the date attribute.
  `protected void`
  `setInternalDateFormat(DateFormat dateFormat)`
  Set the date format attribute.
  `protected void`
  `setInternalFailOnError(boolean failOnError)`
  Set the failOnError attribute.
  `protected void`
  `setInternalFileTimeStamp(MSVSS.CurrentModUpdated timestamp)`
  Set the timestamp attribute.
  `protected void`
  `setInternalFromDate(String fromDate)`
  Set the from date attribute.
  `protected void`
  `setInternalFromLabel(String fromLabel)`
  Set the from label attribute.
  `protected void`
  `setInternalGetLocalCopy(boolean getLocalCopy)`
  Set the getLocalCopy attribute.
  `protected void`
  `setInternalLabel(String label)`
  Set the label attribute.
  `protected void`
  `setInternalLocalPath(String localPath)`
  Set the local path comment attribute.
  `protected void`
  `setInternalNumDays(int numDays)`
  Set the num days attribute.
  `protected void`
  `setInternalOutputFilename(String outputFileName)`
  Set the outputFileName comment attribute.
  `protected void`
  `setInternalQuiet(boolean quiet)`
  Set the quiet attribute.
  `protected void`
  `setInternalRecursive(boolean recursive)`
  Set the recursive attribute.
  `protected void`
  `setInternalStyle(String style)`
  Set the style attribute.
  `protected void`
  `setInternalToDate(String toDate)`
  Set the to date attribute.
  `protected void`
  `setInternalToLabel(String toLabel)`
  Set the to label attribute.
  `protected void`
  `setInternalUser(String user)`
  Set the user attribute.
  `protected void`
  `setInternalVersion(String version)`
  Set the version attribute.
  `protected void`
  `setInternalWritable(boolean writable)`
  Set the writable attribute.
  `protected void`
  `setInternalWritableFiles(MSVSS.WritableFiles writableFiles)`
  Set the writableFiles attribute.
  `final void`
  `setLogin(String vssLogin)`
  Login to use when accessing VSS, formatted as "username,password".
  `final void`
  `setServerpath(String serverPath)`
  Directory where `srssafe.ini` resides.
  `final void`
  `setSsdir(String dir)`
  Directory where `ss.exe` resides.
  `final void`
  `setVsspath(String vssPath)`
  SourceSafe path which specifies the project/file(s) you wish to perform the action on.

  ### Methods inherited from class Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`
  Modifier and Type
  Method
  Description
  `final void`
  `bindToOwner(Task owner)`
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
  `Target`
  `getOwningTarget()`
  Returns the container target of this task.
  `RuntimeConfigurable`
  `getRuntimeConfigurableWrapper()`
  Returns the wrapper used for runtime configuration.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `String`
  `getTaskType()`
  Return the type of task.
  `protected RuntimeConfigurable`
  `getWrapper()`
  Return the runtime configurable structure for this task.
  `protected void`
  `handleErrorFlush(String output)`
  Handles an error line by logging it with the WARN priority.
  `protected void`
  `handleErrorOutput(String output)`
  Handles an error output by logging it with the WARN priority.
  `protected void`
  `handleFlush(String output)`
  Handles output by logging it with the INFO priority.
  `protected int`
  `handleInput(byte[] buffer, int offset, int length)`
  Handle an input request by this task.
  `protected void`
  `handleOutput(String output)`
  Handles output by logging it with the INFO priority.
  `void`
  `init()`
  Called by the project to let the task initialize properly.
  `protected final boolean`
  `isInvalid()`
  Has this task been marked invalid?
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(String msg, Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `maybeConfigure()`
  Configures this task - if it hasn't been done already.
  `final void`
  `perform()`
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
  `void`
  `reconfigure()`
  Force the task to be reconfigured from its RuntimeConfigurable.
  `void`
  `setOwningTarget(Target target)`
  Sets the target container of this task.
  `void`
  `setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)`
  Sets the wrapper to be used for runtime configuration.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.
  `void`
  `setTaskType(String type)`
  Sets the name with which the task has been invoked.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MSVSSADD

    public MSVSSADD()

- ## Method Details

  - ### buildCmdLine

    protected Commandline buildCmdLine()
    Builds a command line to execute ss.
    Returns:
      The constructed commandline.

  - ### getLocalpath

    protected String getLocalpath()
    Returns the local path without the flag.; required
    Overrides:
      `getLocalpath` in class `MSVSS`
    Returns:
      The local path value.
    To do:
      See why this returns the local path without the flag.

  - ### setRecursive

    public void setRecursive(boolean recursive)
    Add files recursively. Defaults to false.
    Parameters:
      `recursive` - The boolean value for recursive.

  - ### setWritable

    public final void setWritable(boolean writable)
    Unset the READ-ONLY flag on local copies of files added to VSS. Defaults to false.
    Parameters:
      `writable` - The boolean value for writable.

  - ### setAutoresponse

    public void setAutoresponse(String response)
    Autoresponse behaviour. Valid options are Y and N.
    Parameters:
      `response` - The auto response value.

  - ### setComment

    public void setComment(String comment)
    Comment to apply to files added to SourceSafe.
    Parameters:
      `comment` - The comment to apply in SourceSafe

  - ### setLocalpath

    public void setLocalpath(Path localPath)
    Override the project working directory.
    Parameters:
      `localPath` - The path on disk.