ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r397075 [2/3] - in /ant/sandbox/antlibs/vss: ./ docs/ src/etc/testcases/ src/main/org/apache/ant/vss/ test/org/apache/ant/vss/
Date Wed, 26 Apr 2006 04:01:23 GMT
Modified: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSS.java
URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSS.java?rev=397075&r1=397074&r2=397075&view=diff
==============================================================================
--- ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSS.java (original)
+++ ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSS.java Tue Apr 25 21:01:19 2006
@@ -1,690 +1,690 @@
-/*
- * Copyright  2000-2004, 2006 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.ant.vss;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-import java.io.File;
-import java.io.IOException;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.util.FileUtils;
-
-/**
- * A base class for creating tasks for executing commands on Visual SourceSafe.
- * <p>
- * The class extends the 'exec' task as it operates by executing the ss.exe program
- * supplied with SourceSafe. By default the task expects ss.exe to be in the path,
- * you can override this be specifying the ssdir attribute.
- * </p>
- * <p>
- * This class provides set and get methods for 'login' and 'vsspath' attributes. It
- * also contains constants for the flags that can be passed to SS.
- * </p>
- *
- */
-public abstract class MSVSS extends Task implements MSVSSConstants {
-
-    private String ssDir = null;
-    private String vssLogin = null;
-    private String vssPath = null;
-    private String serverPath = null;
-
-    /**  Version */
-    private String version = null;
-    /**  Date */
-    private String date = null;
-    /**  Label */
-    private String label = null;
-    /**  Auto response */
-    private String autoResponse = null;
-    /**  Local path */
-    private String localPath = null;
-    /**  Comment */
-    private String comment = null;
-    /**  From label */
-    private String fromLabel = null;
-    /**  To label */
-    private String toLabel = null;
-    /**  Output file name */
-    private String outputFileName = null;
-    /**  User */
-    private String user = null;
-    /**  From date */
-    private String fromDate = null;
-    /**  To date */
-    private String toDate = null;
-    /**  History style */
-    private String style = null;
-    /**  Quiet defaults to false */
-    private boolean quiet = false;
-    /**  Recursive defaults to false */
-    private boolean recursive = false;
-    /**  Writable defaults to false */
-    private boolean writable = false;
-    /**  Fail on error defaults to true */
-    private boolean failOnError = true;
-    /**  Get local copy for checkout defaults to true */
-    private boolean getLocalCopy = true;
-    /**  Number of days offset for History */
-    private int numDays = Integer.MIN_VALUE;
-    /**  Date format for History */
-    private DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
-    /**  Timestamp for retreived files */
-    private CurrentModUpdated timestamp = null;
-    /**  Behaviour for writable files */
-    private WritableFiles writableFiles = null;
-    /**
-     * Each sub-class must implemnt this method and return the constructed
-     * command line to be executed. It is up to the sub-task to determine the
-     * required attrubutes and their order.
-     * @return    The Constructed command line.
-     */
-    abstract Commandline buildCmdLine();
-
-    /**
-     * Directory where <code>ss.exe</code> resides.
-     * By default the task expects it to be in the PATH.
-     * @param  dir  The directory containing ss.exe.
-     */
-    public final void setSsdir(String dir) {
-        this.ssDir = FileUtils.translatePath(dir);
-    }
-
-    /**
-     * Login to use when accessing VSS, formatted as "username,password".
-     * <p>
-     * You can omit the password if your database is not password protected.
-     * If you have a password and omit it, Ant will hang.
-     * @param  vssLogin  The login string to use.
-     */
-    public final void setLogin(final String vssLogin) {
-        this.vssLogin = vssLogin;
-    }
-
-    /**
-     * SourceSafe path which specifies the project/file(s) you wish to perform
-     * the action on.
-     * <p>
-     * A prefix of 'vss://' will be removed if specified.
-     * @param  vssPath  The VSS project path.
-     * @ant.attribute group="required"
-     */
-    public final void setVsspath(final String vssPath) {
-        String projectPath;
-        if (vssPath.startsWith("vss://")) { //$NON-NLS-1$
-            projectPath = vssPath.substring(5);
-        } else {
-            projectPath = vssPath;
-        }
-
-        if (projectPath.startsWith(PROJECT_PREFIX)) {
-            this.vssPath = projectPath;
-        } else {
-            this.vssPath = PROJECT_PREFIX + projectPath;
-        }
-    }
-
-    /**
-     * Directory where <code>srssafe.ini</code> resides.
-     * @param  serverPath  The path to the VSS server.
-     */
-    public final void setServerpath(final String serverPath) {
-        this.serverPath = serverPath;
-    }
-
-    /**
-     * Indicates if the build should fail if the Sourcesafe command does. Defaults to true.
-     * @param failOnError True if task should fail on any error.
-     */
-    public final void setFailOnError(final boolean failOnError) {
-        this.failOnError = failOnError;
-    }
-
-    /**
-     * Executes the task. <br>
-     * Builds a command line to execute ss.exe and then calls Exec's run method
-     * to execute the command line.
-     * @throws BuildException if the command cannot execute.
-     */
-    public void execute() throws BuildException {
-        int result = 0;
-        Commandline commandLine = buildCmdLine();
-        result = run(commandLine);
-        if (Execute.isFailure(result) && getFailOnError()) {
-            String msg = "Failed executing: " + formatCommandLine(commandLine)
-                     + " With a return code of " + result;
-            throw new BuildException(msg, getLocation());
-        }
-    }
-
-    // Special setters for the sub-classes
-
-    protected void setInternalComment(final String comment) {
-        this.comment = comment;
-    }
-
-    protected void setInternalAutoResponse(final String autoResponse) {
-        this.autoResponse = autoResponse;
-    }
-
-    protected void setInternalDate(final String date) {
-        this.date = date;
-    }
-
-    protected void setInternalDateFormat(final DateFormat dateFormat) {
-        this.dateFormat = dateFormat;
-    }
-
-    protected void setInternalFailOnError(final boolean failOnError) {
-        this.failOnError = failOnError;
-    }
-
-    protected void setInternalFromDate(final String fromDate) {
-        this.fromDate = fromDate;
-    }
-
-    protected void setInternalFromLabel(final String fromLabel) {
-        this.fromLabel = fromLabel;
-    }
-
-    protected void setInternalLabel(final String label) {
-        this.label = label;
-    }
-
-    protected void setInternalLocalPath(final String localPath) {
-        this.localPath = localPath;
-    }
-
-    protected void setInternalNumDays(final int numDays) {
-        this.numDays = numDays;
-    }
-
-    protected void setInternalOutputFilename(final String outputFileName) {
-        this.outputFileName = outputFileName;
-    }
-
-    protected void setInternalQuiet(final boolean quiet) {
-        this.quiet = quiet;
-    }
-
-    protected void setInternalRecursive(final boolean recursive) {
-        this.recursive = recursive;
-    }
-
-    protected void setInternalStyle(final String style) {
-        this.style = style;
-    }
-
-    protected void setInternalToDate(final String toDate) {
-        this.toDate = toDate;
-    }
-
-    protected void setInternalToLabel(final String toLabel) {
-        this.toLabel = toLabel;
-    }
-
-    protected void setInternalUser(final String user) {
-        this.user = user;
-    }
-
-    protected void setInternalVersion(final String version) {
-        this.version = version;
-    }
-
-    protected void setInternalWritable(final boolean writable) {
-        this.writable = writable;
-    }
-
-    protected void setInternalFileTimeStamp(final CurrentModUpdated timestamp) {
-        this.timestamp = timestamp;
-    }
-
-    protected void setInternalWritableFiles(final WritableFiles writableFiles) {
-        this.writableFiles = writableFiles;
-    }
-
-    protected void setInternalGetLocalCopy(final boolean getLocalCopy) {
-        this.getLocalCopy = getLocalCopy;
-    }
-
-    /**
-     * Gets the sscommand string. "ss" or "c:\path\to\ss"
-     * @return    The path to ss.exe or just ss if sscommand is not set.
-     */
-    protected String getSSCommand() {
-        if (ssDir == null) {
-            return SS_EXE;
-        }
-        return ssDir.endsWith(File.separator) ? ssDir + SS_EXE : ssDir
-                 + File.separator + SS_EXE;
-    }
-
-    /**
-     * Gets the vssserverpath string.
-     * @return    null if vssserverpath is not set.
-     */
-    protected String getVsspath() {
-        return vssPath;
-    }
-
-    /**
-     * Gets the quiet string. -O-
-     * @return An empty string if quiet is not set or is false.
-     */
-    protected String getQuiet() {
-        return quiet ? FLAG_QUIET : "";
-    }
-
-    /**
-     * Gets the recursive string. "-R"
-     * @return An empty string if recursive is not set or is false.
-     */
-    protected String getRecursive() {
-        return recursive ? FLAG_RECURSION : "";
-    }
-
-    /**
-     * Gets the writable string. "-W"
-     * @return An empty string if writable is not set or is false.
-     */
-    protected String getWritable() {
-        return writable ? FLAG_WRITABLE : "";
-    }
-
-    /**
-     * Gets the label string. "-Lbuild1"
-     * Max label length is 32 chars
-     * @return An empty string if label is not set.
-     */
-    protected String getLabel() {
-        String shortLabel = "";
-        if (label != null && label.length() > 0) {
-                shortLabel = FLAG_LABEL + getShortLabel();
-        }
-        return shortLabel;
-    }
-    /**
-     * Return at most the 30 first chars of the label,
-     * logging a warning message about the truncation
-     * @return at most the 30 first chars of the label
-     */
-    private String getShortLabel() {
-        String shortLabel;
-        if (label !=  null && label.length() > 31) {
-            shortLabel = this.label.substring(0, 30);
-            log("Label is longer than 31 characters, truncated to: " + shortLabel,
-                Project.MSG_WARN);
-        } else {
-            shortLabel = label;
-        }
-        return shortLabel;
-    }
-    /**
-     * Gets the style string. "-Lbuild1"
-     * @return An empty string if label is not set.
-     */
-    protected String getStyle() {
-        return style != null ? style : "";
-    }
-
-    /**
-     * Gets the version string. Returns the first specified of version "-V1.0",
-     * date "-Vd01.01.01", label "-Vlbuild1".
-     * @return An empty string if a version, date and label are not set.
-     */
-    protected String getVersionDateLabel() {
-        String versionDateLabel = "";
-        if (version != null) {
-            versionDateLabel = FLAG_VERSION + version;
-        } else if (date != null) {
-            versionDateLabel = FLAG_VERSION_DATE + date;
-        } else {
-            // Use getShortLabel() so labels longer then 30 char are truncated
-            // and the user is warned
-            String shortLabel = getShortLabel();
-            if (shortLabel != null && !shortLabel.equals("")) {
-                versionDateLabel = FLAG_VERSION_LABEL + shortLabel;
-            }
-        }
-        return versionDateLabel;
-    }
-
-    /**
-     * Gets the version string.
-     * @return An empty string if a version is not set.
-     */
-    protected String getVersion() {
-        return version != null ? FLAG_VERSION + version : "";
-    }
-
-    /**
-     * Gets the localpath string. "-GLc:\source" <p>
-     * The localpath is created if it didn't exist.
-     * @return An empty string if localpath is not set.
-     */
-    protected String getLocalpath() {
-        String lclPath = ""; //set to empty str if no local path return
-        if (localPath != null) {
-            //make sure m_LocalDir exists, create it if it doesn't
-            File dir = getProject().resolveFile(localPath);
-            if (!dir.exists()) {
-                boolean done = dir.mkdirs();
-                if (!done) {
-                    String msg = "Directory " + localPath + " creation was not "
-                            + "successful for an unknown reason";
-                    throw new BuildException(msg, getLocation());
-                }
-                getProject().log("Created dir: " + dir.getAbsolutePath());
-            }
-            lclPath = FLAG_OVERRIDE_WORKING_DIR + localPath;
-        }
-        return lclPath;
-    }
-
-    /**
-     * Gets the comment string. "-Ccomment text"
-     * @return A comment of "-" if comment is not set.
-     */
-    protected String getComment() {
-        return comment != null ? FLAG_COMMENT + comment : FLAG_COMMENT + "-";
-    }
-
-    /**
-     * Gets the auto response string. This can be Y "-I-Y" or N "-I-N".
-     * @return The default value "-I-" if autoresponse is not set.
-     */
-    protected String getAutoresponse() {
-        if (autoResponse == null) {
-            return FLAG_AUTORESPONSE_DEF;
-        } else if (autoResponse.equalsIgnoreCase("Y")) {
-            return FLAG_AUTORESPONSE_YES;
-        } else if (autoResponse.equalsIgnoreCase("N")) {
-            return FLAG_AUTORESPONSE_NO;
-        } else {
-            return FLAG_AUTORESPONSE_DEF;
-        }
-    }
-
-    /**
-     * Gets the login string. This can be user and password, "-Yuser,password"
-     * or just user "-Yuser".
-     * @return An empty string if login is not set.
-     */
-    protected String getLogin() {
-        return vssLogin != null ? FLAG_LOGIN + vssLogin : "";
-    }
-
-    /**
-     * Gets the output file string. "-Ooutput.file"
-     * @return An empty string if user is not set.
-     */
-    protected String getOutput() {
-        return outputFileName != null ? FLAG_OUTPUT + outputFileName : "";
-    }
-
-    /**
-     * Gets the user string. "-Uusername"
-     * @return An empty string if user is not set.
-     */
-    protected String getUser() {
-        return user != null ? FLAG_USER + user : "";
-    }
-
-    /**
-     * Gets the version string. This can be to-from "-VLbuild2~Lbuild1", from
-     * "~Lbuild1" or to "-VLbuild2".
-     * @return An empty string if neither tolabel or fromlabel are set.
-     */
-    protected String getVersionLabel() {
-        if (fromLabel == null && toLabel == null) {
-            return "";
-        }
-        if (fromLabel != null && toLabel != null) {
-            if (fromLabel.length() > 31) {
-                fromLabel = fromLabel.substring(0, 30);
-                log("FromLabel is longer than 31 characters, truncated to: "
-                    + fromLabel, Project.MSG_WARN);
-            }
-            if (toLabel.length() > 31) {
-                toLabel = toLabel.substring(0, 30);
-                log("ToLabel is longer than 31 characters, truncated to: "
-                    + toLabel, Project.MSG_WARN);
-            }
-            return FLAG_VERSION_LABEL + toLabel + VALUE_FROMLABEL + fromLabel;
-        } else if (fromLabel != null) {
-            if (fromLabel.length() > 31) {
-                fromLabel = fromLabel.substring(0, 30);
-                log("FromLabel is longer than 31 characters, truncated to: "
-                    + fromLabel, Project.MSG_WARN);
-            }
-            return FLAG_VERSION + VALUE_FROMLABEL + fromLabel;
-        } else {
-            if (toLabel.length() > 31) {
-                toLabel = toLabel.substring(0, 30);
-                log("ToLabel is longer than 31 characters, truncated to: "
-                    + toLabel, Project.MSG_WARN);
-            }
-            return FLAG_VERSION_LABEL + toLabel;
-        }
-    }
-
-    /**
-     * Gets the Version date string.
-     * @return An empty string if neither Todate or from date are set.
-     * @throws BuildException
-     */
-    protected String getVersionDate() throws BuildException {
-        if (fromDate == null && toDate == null
-            && numDays == Integer.MIN_VALUE) {
-            return "";
-        }
-        if (fromDate != null && toDate != null) {
-            return FLAG_VERSION_DATE + toDate + VALUE_FROMDATE + fromDate;
-        } else if (toDate != null && numDays != Integer.MIN_VALUE) {
-            try {
-                return FLAG_VERSION_DATE + toDate + VALUE_FROMDATE
-                        + calcDate(toDate, numDays);
-            } catch (ParseException ex) {
-                String msg = "Error parsing date: " + toDate;
-                throw new BuildException(msg, getLocation());
-            }
-        } else if (fromDate != null && numDays != Integer.MIN_VALUE) {
-            try {
-                return FLAG_VERSION_DATE + calcDate(fromDate, numDays)
-                        + VALUE_FROMDATE + fromDate;
-            } catch (ParseException ex) {
-                String msg = "Error parsing date: " + fromDate;
-                throw new BuildException(msg, getLocation());
-            }
-        } else {
-            return fromDate != null ? FLAG_VERSION + VALUE_FROMDATE
-                    + fromDate : FLAG_VERSION_DATE + toDate;
-        }
-    }
-
-    /**
-     * Builds and returns the -G- flag if required.
-     * @return An empty string if get local copy is true.
-     */
-    protected String getGetLocalCopy() {
-        return (!getLocalCopy) ? FLAG_NO_GET : "";
-    }
-
-    /**
-     * Gets the value of the fail on error flag.
-     * @return    True if the FailOnError flag has been set or if 'writablefiles=skip'.
-     */
-    private boolean getFailOnError() {
-        return getWritableFiles().equals(WRITABLE_SKIP) ? false : failOnError;
-    }
-
-
-    /**
-     * Gets the value set for the FileTimeStamp.
-     * if it equals "current" then we return -GTC
-     * if it equals "modified" then we return -GTM
-     * if it equals "updated" then we return -GTU
-     * otherwise we return -GTC
-     *
-     * @return The default file time flag, if not set.
-     */
-    public String getFileTimeStamp() {
-        if (timestamp == null) {
-            return "";
-        } else if (timestamp.getValue().equals(TIME_MODIFIED)) {
-            return FLAG_FILETIME_MODIFIED;
-        } else if (timestamp.getValue().equals(TIME_UPDATED)) {
-            return FLAG_FILETIME_UPDATED;
-        } else {
-            return FLAG_FILETIME_DEF;
-        }
-    }
-
-
-    /**
-     * Gets the value to determine the behaviour when encountering writable files.
-     * @return An empty String, if not set.
-     */
-    public String getWritableFiles() {
-        if (writableFiles == null) {
-            return "";
-        } else if (writableFiles.getValue().equals(WRITABLE_REPLACE)) {
-            return FLAG_REPLACE_WRITABLE;
-        } else if (writableFiles.getValue().equals(WRITABLE_SKIP)) {
-            // ss.exe exits with '100', when files have been skipped
-            // so we have to ignore the failure
-            failOnError = false;
-            return FLAG_SKIP_WRITABLE;
-        } else {
-            return "";
-        }
-    }
-
-    /**
-     *  Sets up the required environment and executes the command line.
-     *
-     * @param  cmd  The command line to execute.
-     * @return      The return code from the exec'd process.
-     */
-    private int run(Commandline cmd) {
-        try {
-            Execute exe = new Execute(new LogStreamHandler(this,
-                    Project.MSG_INFO,
-                    Project.MSG_WARN));
-
-            // If location of ss.ini is specified we need to set the
-            // environment-variable SSDIR to this value
-            if (serverPath != null) {
-                String[] env = exe.getEnvironment();
-                if (env == null) {
-                    env = new String[0];
-                }
-                String[] newEnv = new String[env.length + 1];
-                for (int i = 0; i < env.length; i++) {
-                    newEnv[i] = env[i];
-                }
-                newEnv[env.length] = "SSDIR=" + serverPath;
-
-                exe.setEnvironment(newEnv);
-            }
-
-            exe.setAntRun(getProject());
-            exe.setWorkingDirectory(getProject().getBaseDir());
-            exe.setCommandline(cmd.getCommandline());
-            // Use the OS launcher so we get environment variables
-            exe.setVMLauncher(false);
-            return exe.execute();
-        } catch (IOException e) {
-            throw new BuildException(e, getLocation());
-        }
-    }
-
-     /**
-     * Calculates the start date for version comparison.
-     * <p>
-     * Calculates the date numDay days earlier than startdate.
-     * @param   startDate    The start date.
-     * @param   daysToAdd     The number of days to add.
-     * @return The calculated date.
-     * @throws ParseException
-     */
-    private String calcDate(String startDate, int daysToAdd) throws ParseException {
-        Date currentDate = new Date();
-        Calendar calendar = new GregorianCalendar();
-        currentDate = dateFormat.parse(startDate);
-        calendar.setTime(currentDate);
-        calendar.add(Calendar.DATE, daysToAdd);
-        return dateFormat.format(calendar.getTime());
-    }
-
-    /**
-     * Changes the password to '***' so it isn't displayed on screen if the build fails
-     *
-     * @param cmd   The command line to clean
-     * @return The command line as a string with out the password
-     */
-    private String formatCommandLine(Commandline cmd) {
-        StringBuffer sBuff = new StringBuffer(cmd.toString());
-        int indexUser = sBuff.substring(0).indexOf(FLAG_LOGIN);
-        if (indexUser > 0) {
-            int indexPass = sBuff.substring(0).indexOf(",", indexUser);
-            int indexAfterPass = sBuff.substring(0).indexOf(" ", indexPass);
-
-            for (int i = indexPass + 1; i < indexAfterPass; i++) {
-                sBuff.setCharAt(i, '*');
-            }
-        }
-        return sBuff.toString();
-    }
-
-    /**
-     * Extention of EnumeratedAttribute to hold the values for file time stamp.
-     */
-    public static class CurrentModUpdated extends EnumeratedAttribute {
-        /**
-         * Gets the list of allowable values.
-         * @return The values.
-         */
-        public String[] getValues() {
-            return new String[] {TIME_CURRENT, TIME_MODIFIED, TIME_UPDATED};
-        }
-    }
-
-    /**
-     * Extention of EnumeratedAttribute to hold the values for writable filess.
-     */
-    public static class WritableFiles extends EnumeratedAttribute {
-        /**
-         * Gets the list of allowable values.
-         * @return The values.
-         */
-        public String[] getValues() {
-            return new String[] {WRITABLE_REPLACE, WRITABLE_SKIP, WRITABLE_FAIL};
-        }
-    }
-}
+/*
+ * Copyright  2000-2004, 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.vss;
+
+import org.apache.tools.ant.types.EnumeratedAttribute;
+import java.io.File;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.Execute;
+import org.apache.tools.ant.taskdefs.LogStreamHandler;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.util.FileUtils;
+
+/**
+ * A base class for creating tasks for executing commands on Visual SourceSafe.
+ * <p>
+ * The class extends the 'exec' task as it operates by executing the ss.exe program
+ * supplied with SourceSafe. By default the task expects ss.exe to be in the path,
+ * you can override this be specifying the ssdir attribute.
+ * </p>
+ * <p>
+ * This class provides set and get methods for 'login' and 'vsspath' attributes. It
+ * also contains constants for the flags that can be passed to SS.
+ * </p>
+ *
+ */
+public abstract class MSVSS extends Task implements MSVSSConstants {
+
+    private String ssDir = null;
+    private String vssLogin = null;
+    private String vssPath = null;
+    private String serverPath = null;
+
+    /**  Version */
+    private String version = null;
+    /**  Date */
+    private String date = null;
+    /**  Label */
+    private String label = null;
+    /**  Auto response */
+    private String autoResponse = null;
+    /**  Local path */
+    private String localPath = null;
+    /**  Comment */
+    private String comment = null;
+    /**  From label */
+    private String fromLabel = null;
+    /**  To label */
+    private String toLabel = null;
+    /**  Output file name */
+    private String outputFileName = null;
+    /**  User */
+    private String user = null;
+    /**  From date */
+    private String fromDate = null;
+    /**  To date */
+    private String toDate = null;
+    /**  History style */
+    private String style = null;
+    /**  Quiet defaults to false */
+    private boolean quiet = false;
+    /**  Recursive defaults to false */
+    private boolean recursive = false;
+    /**  Writable defaults to false */
+    private boolean writable = false;
+    /**  Fail on error defaults to true */
+    private boolean failOnError = true;
+    /**  Get local copy for checkout defaults to true */
+    private boolean getLocalCopy = true;
+    /**  Number of days offset for History */
+    private int numDays = Integer.MIN_VALUE;
+    /**  Date format for History */
+    private DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
+    /**  Timestamp for retreived files */
+    private CurrentModUpdated timestamp = null;
+    /**  Behaviour for writable files */
+    private WritableFiles writableFiles = null;
+    /**
+     * Each sub-class must implemnt this method and return the constructed
+     * command line to be executed. It is up to the sub-task to determine the
+     * required attrubutes and their order.
+     * @return    The Constructed command line.
+     */
+    abstract Commandline buildCmdLine();
+
+    /**
+     * Directory where <code>ss.exe</code> resides.
+     * By default the task expects it to be in the PATH.
+     * @param  dir  The directory containing ss.exe.
+     */
+    public final void setSsdir(String dir) {
+        this.ssDir = FileUtils.translatePath(dir);
+    }
+
+    /**
+     * Login to use when accessing VSS, formatted as "username,password".
+     * <p>
+     * You can omit the password if your database is not password protected.
+     * If you have a password and omit it, Ant will hang.
+     * @param  vssLogin  The login string to use.
+     */
+    public final void setLogin(final String vssLogin) {
+        this.vssLogin = vssLogin;
+    }
+
+    /**
+     * SourceSafe path which specifies the project/file(s) you wish to perform
+     * the action on.
+     * <p>
+     * A prefix of 'vss://' will be removed if specified.
+     * @param  vssPath  The VSS project path.
+     * @ant.attribute group="required"
+     */
+    public final void setVsspath(final String vssPath) {
+        String projectPath;
+        if (vssPath.startsWith("vss://")) { //$NON-NLS-1$
+            projectPath = vssPath.substring(5);
+        } else {
+            projectPath = vssPath;
+        }
+
+        if (projectPath.startsWith(PROJECT_PREFIX)) {
+            this.vssPath = projectPath;
+        } else {
+            this.vssPath = PROJECT_PREFIX + projectPath;
+        }
+    }
+
+    /**
+     * Directory where <code>srssafe.ini</code> resides.
+     * @param  serverPath  The path to the VSS server.
+     */
+    public final void setServerpath(final String serverPath) {
+        this.serverPath = serverPath;
+    }
+
+    /**
+     * Indicates if the build should fail if the Sourcesafe command does. Defaults to true.
+     * @param failOnError True if task should fail on any error.
+     */
+    public final void setFailOnError(final boolean failOnError) {
+        this.failOnError = failOnError;
+    }
+
+    /**
+     * Executes the task. <br>
+     * Builds a command line to execute ss.exe and then calls Exec's run method
+     * to execute the command line.
+     * @throws BuildException if the command cannot execute.
+     */
+    public void execute() throws BuildException {
+        int result = 0;
+        Commandline commandLine = buildCmdLine();
+        result = run(commandLine);
+        if (Execute.isFailure(result) && getFailOnError()) {
+            String msg = "Failed executing: " + formatCommandLine(commandLine)
+                     + " With a return code of " + result;
+            throw new BuildException(msg, getLocation());
+        }
+    }
+
+    // Special setters for the sub-classes
+
+    protected void setInternalComment(final String comment) {
+        this.comment = comment;
+    }
+
+    protected void setInternalAutoResponse(final String autoResponse) {
+        this.autoResponse = autoResponse;
+    }
+
+    protected void setInternalDate(final String date) {
+        this.date = date;
+    }
+
+    protected void setInternalDateFormat(final DateFormat dateFormat) {
+        this.dateFormat = dateFormat;
+    }
+
+    protected void setInternalFailOnError(final boolean failOnError) {
+        this.failOnError = failOnError;
+    }
+
+    protected void setInternalFromDate(final String fromDate) {
+        this.fromDate = fromDate;
+    }
+
+    protected void setInternalFromLabel(final String fromLabel) {
+        this.fromLabel = fromLabel;
+    }
+
+    protected void setInternalLabel(final String label) {
+        this.label = label;
+    }
+
+    protected void setInternalLocalPath(final String localPath) {
+        this.localPath = localPath;
+    }
+
+    protected void setInternalNumDays(final int numDays) {
+        this.numDays = numDays;
+    }
+
+    protected void setInternalOutputFilename(final String outputFileName) {
+        this.outputFileName = outputFileName;
+    }
+
+    protected void setInternalQuiet(final boolean quiet) {
+        this.quiet = quiet;
+    }
+
+    protected void setInternalRecursive(final boolean recursive) {
+        this.recursive = recursive;
+    }
+
+    protected void setInternalStyle(final String style) {
+        this.style = style;
+    }
+
+    protected void setInternalToDate(final String toDate) {
+        this.toDate = toDate;
+    }
+
+    protected void setInternalToLabel(final String toLabel) {
+        this.toLabel = toLabel;
+    }
+
+    protected void setInternalUser(final String user) {
+        this.user = user;
+    }
+
+    protected void setInternalVersion(final String version) {
+        this.version = version;
+    }
+
+    protected void setInternalWritable(final boolean writable) {
+        this.writable = writable;
+    }
+
+    protected void setInternalFileTimeStamp(final CurrentModUpdated timestamp) {
+        this.timestamp = timestamp;
+    }
+
+    protected void setInternalWritableFiles(final WritableFiles writableFiles) {
+        this.writableFiles = writableFiles;
+    }
+
+    protected void setInternalGetLocalCopy(final boolean getLocalCopy) {
+        this.getLocalCopy = getLocalCopy;
+    }
+
+    /**
+     * Gets the sscommand string. "ss" or "c:\path\to\ss"
+     * @return    The path to ss.exe or just ss if sscommand is not set.
+     */
+    protected String getSSCommand() {
+        if (ssDir == null) {
+            return SS_EXE;
+        }
+        return ssDir.endsWith(File.separator) ? ssDir + SS_EXE : ssDir
+                 + File.separator + SS_EXE;
+    }
+
+    /**
+     * Gets the vssserverpath string.
+     * @return    null if vssserverpath is not set.
+     */
+    protected String getVsspath() {
+        return vssPath;
+    }
+
+    /**
+     * Gets the quiet string. -O-
+     * @return An empty string if quiet is not set or is false.
+     */
+    protected String getQuiet() {
+        return quiet ? FLAG_QUIET : "";
+    }
+
+    /**
+     * Gets the recursive string. "-R"
+     * @return An empty string if recursive is not set or is false.
+     */
+    protected String getRecursive() {
+        return recursive ? FLAG_RECURSION : "";
+    }
+
+    /**
+     * Gets the writable string. "-W"
+     * @return An empty string if writable is not set or is false.
+     */
+    protected String getWritable() {
+        return writable ? FLAG_WRITABLE : "";
+    }
+
+    /**
+     * Gets the label string. "-Lbuild1"
+     * Max label length is 32 chars
+     * @return An empty string if label is not set.
+     */
+    protected String getLabel() {
+        String shortLabel = "";
+        if (label != null && label.length() > 0) {
+                shortLabel = FLAG_LABEL + getShortLabel();
+        }
+        return shortLabel;
+    }
+    /**
+     * Return at most the 30 first chars of the label,
+     * logging a warning message about the truncation
+     * @return at most the 30 first chars of the label
+     */
+    private String getShortLabel() {
+        String shortLabel;
+        if (label !=  null && label.length() > 31) {
+            shortLabel = this.label.substring(0, 30);
+            log("Label is longer than 31 characters, truncated to: " + shortLabel,
+                Project.MSG_WARN);
+        } else {
+            shortLabel = label;
+        }
+        return shortLabel;
+    }
+    /**
+     * Gets the style string. "-Lbuild1"
+     * @return An empty string if label is not set.
+     */
+    protected String getStyle() {
+        return style != null ? style : "";
+    }
+
+    /**
+     * Gets the version string. Returns the first specified of version "-V1.0",
+     * date "-Vd01.01.01", label "-Vlbuild1".
+     * @return An empty string if a version, date and label are not set.
+     */
+    protected String getVersionDateLabel() {
+        String versionDateLabel = "";
+        if (version != null) {
+            versionDateLabel = FLAG_VERSION + version;
+        } else if (date != null) {
+            versionDateLabel = FLAG_VERSION_DATE + date;
+        } else {
+            // Use getShortLabel() so labels longer then 30 char are truncated
+            // and the user is warned
+            String shortLabel = getShortLabel();
+            if (shortLabel != null && !shortLabel.equals("")) {
+                versionDateLabel = FLAG_VERSION_LABEL + shortLabel;
+            }
+        }
+        return versionDateLabel;
+    }
+
+    /**
+     * Gets the version string.
+     * @return An empty string if a version is not set.
+     */
+    protected String getVersion() {
+        return version != null ? FLAG_VERSION + version : "";
+    }
+
+    /**
+     * Gets the localpath string. "-GLc:\source" <p>
+     * The localpath is created if it didn't exist.
+     * @return An empty string if localpath is not set.
+     */
+    protected String getLocalpath() {
+        String lclPath = ""; //set to empty str if no local path return
+        if (localPath != null) {
+            //make sure m_LocalDir exists, create it if it doesn't
+            File dir = getProject().resolveFile(localPath);
+            if (!dir.exists()) {
+                boolean done = dir.mkdirs();
+                if (!done) {
+                    String msg = "Directory " + localPath + " creation was not "
+                            + "successful for an unknown reason";
+                    throw new BuildException(msg, getLocation());
+                }
+                getProject().log("Created dir: " + dir.getAbsolutePath());
+            }
+            lclPath = FLAG_OVERRIDE_WORKING_DIR + localPath;
+        }
+        return lclPath;
+    }
+
+    /**
+     * Gets the comment string. "-Ccomment text"
+     * @return A comment of "-" if comment is not set.
+     */
+    protected String getComment() {
+        return comment != null ? FLAG_COMMENT + comment : FLAG_COMMENT + "-";
+    }
+
+    /**
+     * Gets the auto response string. This can be Y "-I-Y" or N "-I-N".
+     * @return The default value "-I-" if autoresponse is not set.
+     */
+    protected String getAutoresponse() {
+        if (autoResponse == null) {
+            return FLAG_AUTORESPONSE_DEF;
+        } else if (autoResponse.equalsIgnoreCase("Y")) {
+            return FLAG_AUTORESPONSE_YES;
+        } else if (autoResponse.equalsIgnoreCase("N")) {
+            return FLAG_AUTORESPONSE_NO;
+        } else {
+            return FLAG_AUTORESPONSE_DEF;
+        }
+    }
+
+    /**
+     * Gets the login string. This can be user and password, "-Yuser,password"
+     * or just user "-Yuser".
+     * @return An empty string if login is not set.
+     */
+    protected String getLogin() {
+        return vssLogin != null ? FLAG_LOGIN + vssLogin : "";
+    }
+
+    /**
+     * Gets the output file string. "-Ooutput.file"
+     * @return An empty string if user is not set.
+     */
+    protected String getOutput() {
+        return outputFileName != null ? FLAG_OUTPUT + outputFileName : "";
+    }
+
+    /**
+     * Gets the user string. "-Uusername"
+     * @return An empty string if user is not set.
+     */
+    protected String getUser() {
+        return user != null ? FLAG_USER + user : "";
+    }
+
+    /**
+     * Gets the version string. This can be to-from "-VLbuild2~Lbuild1", from
+     * "~Lbuild1" or to "-VLbuild2".
+     * @return An empty string if neither tolabel or fromlabel are set.
+     */
+    protected String getVersionLabel() {
+        if (fromLabel == null && toLabel == null) {
+            return "";
+        }
+        if (fromLabel != null && toLabel != null) {
+            if (fromLabel.length() > 31) {
+                fromLabel = fromLabel.substring(0, 30);
+                log("FromLabel is longer than 31 characters, truncated to: "
+                    + fromLabel, Project.MSG_WARN);
+            }
+            if (toLabel.length() > 31) {
+                toLabel = toLabel.substring(0, 30);
+                log("ToLabel is longer than 31 characters, truncated to: "
+                    + toLabel, Project.MSG_WARN);
+            }
+            return FLAG_VERSION_LABEL + toLabel + VALUE_FROMLABEL + fromLabel;
+        } else if (fromLabel != null) {
+            if (fromLabel.length() > 31) {
+                fromLabel = fromLabel.substring(0, 30);
+                log("FromLabel is longer than 31 characters, truncated to: "
+                    + fromLabel, Project.MSG_WARN);
+            }
+            return FLAG_VERSION + VALUE_FROMLABEL + fromLabel;
+        } else {
+            if (toLabel.length() > 31) {
+                toLabel = toLabel.substring(0, 30);
+                log("ToLabel is longer than 31 characters, truncated to: "
+                    + toLabel, Project.MSG_WARN);
+            }
+            return FLAG_VERSION_LABEL + toLabel;
+        }
+    }
+
+    /**
+     * Gets the Version date string.
+     * @return An empty string if neither Todate or from date are set.
+     * @throws BuildException
+     */
+    protected String getVersionDate() throws BuildException {
+        if (fromDate == null && toDate == null
+            && numDays == Integer.MIN_VALUE) {
+            return "";
+        }
+        if (fromDate != null && toDate != null) {
+            return FLAG_VERSION_DATE + toDate + VALUE_FROMDATE + fromDate;
+        } else if (toDate != null && numDays != Integer.MIN_VALUE) {
+            try {
+                return FLAG_VERSION_DATE + toDate + VALUE_FROMDATE
+                        + calcDate(toDate, numDays);
+            } catch (ParseException ex) {
+                String msg = "Error parsing date: " + toDate;
+                throw new BuildException(msg, getLocation());
+            }
+        } else if (fromDate != null && numDays != Integer.MIN_VALUE) {
+            try {
+                return FLAG_VERSION_DATE + calcDate(fromDate, numDays)
+                        + VALUE_FROMDATE + fromDate;
+            } catch (ParseException ex) {
+                String msg = "Error parsing date: " + fromDate;
+                throw new BuildException(msg, getLocation());
+            }
+        } else {
+            return fromDate != null ? FLAG_VERSION + VALUE_FROMDATE
+                    + fromDate : FLAG_VERSION_DATE + toDate;
+        }
+    }
+
+    /**
+     * Builds and returns the -G- flag if required.
+     * @return An empty string if get local copy is true.
+     */
+    protected String getGetLocalCopy() {
+        return (!getLocalCopy) ? FLAG_NO_GET : "";
+    }
+
+    /**
+     * Gets the value of the fail on error flag.
+     * @return    True if the FailOnError flag has been set or if 'writablefiles=skip'.
+     */
+    private boolean getFailOnError() {
+        return getWritableFiles().equals(WRITABLE_SKIP) ? false : failOnError;
+    }
+
+
+    /**
+     * Gets the value set for the FileTimeStamp.
+     * if it equals "current" then we return -GTC
+     * if it equals "modified" then we return -GTM
+     * if it equals "updated" then we return -GTU
+     * otherwise we return -GTC
+     *
+     * @return The default file time flag, if not set.
+     */
+    public String getFileTimeStamp() {
+        if (timestamp == null) {
+            return "";
+        } else if (timestamp.getValue().equals(TIME_MODIFIED)) {
+            return FLAG_FILETIME_MODIFIED;
+        } else if (timestamp.getValue().equals(TIME_UPDATED)) {
+            return FLAG_FILETIME_UPDATED;
+        } else {
+            return FLAG_FILETIME_DEF;
+        }
+    }
+
+
+    /**
+     * Gets the value to determine the behaviour when encountering writable files.
+     * @return An empty String, if not set.
+     */
+    public String getWritableFiles() {
+        if (writableFiles == null) {
+            return "";
+        } else if (writableFiles.getValue().equals(WRITABLE_REPLACE)) {
+            return FLAG_REPLACE_WRITABLE;
+        } else if (writableFiles.getValue().equals(WRITABLE_SKIP)) {
+            // ss.exe exits with '100', when files have been skipped
+            // so we have to ignore the failure
+            failOnError = false;
+            return FLAG_SKIP_WRITABLE;
+        } else {
+            return "";
+        }
+    }
+
+    /**
+     *  Sets up the required environment and executes the command line.
+     *
+     * @param  cmd  The command line to execute.
+     * @return      The return code from the exec'd process.
+     */
+    private int run(Commandline cmd) {
+        try {
+            Execute exe = new Execute(new LogStreamHandler(this,
+                    Project.MSG_INFO,
+                    Project.MSG_WARN));
+
+            // If location of ss.ini is specified we need to set the
+            // environment-variable SSDIR to this value
+            if (serverPath != null) {
+                String[] env = exe.getEnvironment();
+                if (env == null) {
+                    env = new String[0];
+                }
+                String[] newEnv = new String[env.length + 1];
+                for (int i = 0; i < env.length; i++) {
+                    newEnv[i] = env[i];
+                }
+                newEnv[env.length] = "SSDIR=" + serverPath;
+
+                exe.setEnvironment(newEnv);
+            }
+
+            exe.setAntRun(getProject());
+            exe.setWorkingDirectory(getProject().getBaseDir());
+            exe.setCommandline(cmd.getCommandline());
+            // Use the OS launcher so we get environment variables
+            exe.setVMLauncher(false);
+            return exe.execute();
+        } catch (IOException e) {
+            throw new BuildException(e, getLocation());
+        }
+    }
+
+     /**
+     * Calculates the start date for version comparison.
+     * <p>
+     * Calculates the date numDay days earlier than startdate.
+     * @param   startDate    The start date.
+     * @param   daysToAdd     The number of days to add.
+     * @return The calculated date.
+     * @throws ParseException
+     */
+    private String calcDate(String startDate, int daysToAdd) throws ParseException {
+        Date currentDate = new Date();
+        Calendar calendar = new GregorianCalendar();
+        currentDate = dateFormat.parse(startDate);
+        calendar.setTime(currentDate);
+        calendar.add(Calendar.DATE, daysToAdd);
+        return dateFormat.format(calendar.getTime());
+    }
+
+    /**
+     * Changes the password to '***' so it isn't displayed on screen if the build fails
+     *
+     * @param cmd   The command line to clean
+     * @return The command line as a string with out the password
+     */
+    private String formatCommandLine(Commandline cmd) {
+        StringBuffer sBuff = new StringBuffer(cmd.toString());
+        int indexUser = sBuff.substring(0).indexOf(FLAG_LOGIN);
+        if (indexUser > 0) {
+            int indexPass = sBuff.substring(0).indexOf(",", indexUser);
+            int indexAfterPass = sBuff.substring(0).indexOf(" ", indexPass);
+
+            for (int i = indexPass + 1; i < indexAfterPass; i++) {
+                sBuff.setCharAt(i, '*');
+            }
+        }
+        return sBuff.toString();
+    }
+
+    /**
+     * Extention of EnumeratedAttribute to hold the values for file time stamp.
+     */
+    public static class CurrentModUpdated extends EnumeratedAttribute {
+        /**
+         * Gets the list of allowable values.
+         * @return The values.
+         */
+        public String[] getValues() {
+            return new String[] {TIME_CURRENT, TIME_MODIFIED, TIME_UPDATED};
+        }
+    }
+
+    /**
+     * Extention of EnumeratedAttribute to hold the values for writable filess.
+     */
+    public static class WritableFiles extends EnumeratedAttribute {
+        /**
+         * Gets the list of allowable values.
+         * @return The values.
+         */
+        public String[] getValues() {
+            return new String[] {WRITABLE_REPLACE, WRITABLE_SKIP, WRITABLE_FAIL};
+        }
+    }
+}

Propchange: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSADD.java
URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSADD.java?rev=397075&r1=397074&r2=397075&view=diff
==============================================================================
--- ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSADD.java (original)
+++ ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSADD.java Tue Apr 25 21:01:19 2006
@@ -1,121 +1,121 @@
-/*
- * Copyright  2002-2004, 2006 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.ant.vss;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.Path;
-
-/**
- * Performs Add commands to Microsoft Visual SourceSafe.
- *
- * @ant.task name="vssadd" category="scm"
- */
-public class MSVSSADD extends MSVSS {
-
-    private String localPath = null;
-
-    /**
-     * Builds a command line to execute ss.
-     * @return     The constructed commandline.
-     */
-    protected Commandline buildCmdLine() {
-        Commandline commandLine = new Commandline();
-
-        // first off, make sure that we've got a command and a localPath ...
-        if (getLocalpath() == null) {
-            String msg = "localPath attribute must be set!";
-            throw new BuildException(msg, getLocation());
-        }
-
-        // build the command line from what we got the format is
-        // ss Add VSS items [-B] [-C] [-D-] [-H] [-I-] [-K] [-N] [-O] [-R] [-W] [-Y] [-?]
-        // as specified in the SS.EXE help
-        commandLine.setExecutable(getSSCommand());
-        commandLine.createArgument().setValue(COMMAND_ADD);
-
-        // VSS items
-        commandLine.createArgument().setValue(getLocalpath());
-        // -I- or -I-Y or -I-N
-        commandLine.createArgument().setValue(getAutoresponse());
-        // -R
-        commandLine.createArgument().setValue(getRecursive());
-        // -W
-        commandLine.createArgument().setValue(getWritable());
-        // -Y
-        commandLine.createArgument().setValue(getLogin());
-        // -C
-        commandLine.createArgument().setValue(getComment());
-
-        return commandLine;
-    }
-
-    /**
-     * Returns the local path without the flag.; required
-     * @todo See why this returns the local path without the flag.
-     * @return The local path value.
-     */
-    protected String getLocalpath() {
-        return localPath;
-    }
-
-    /**
-     * Add files recursively. Defaults to false.
-     *
-     * @param recursive  The boolean value for recursive.
-     */
-    public void setRecursive(boolean recursive) {
-        super.setInternalRecursive(recursive);
-    }
-
-    /**
-     * Unset the READ-ONLY flag on local copies of files added to VSS. Defaults to false.
-     *
-     * @param   writable The boolean value for writable.
-     */
-    public final void setWritable(boolean writable) {
-        super.setInternalWritable(writable);
-    }
-
-    /**
-     * Autoresponce behaviour. Valid options are Y and N.
-     *
-     * @param response The auto response value.
-     */
-    public void setAutoresponse(String response) {
-        super.setInternalAutoResponse(response);
-    }
-
-    /**
-     * Comment to apply to files added to SourceSafe.
-     *
-     * @param comment The comment to apply in SourceSafe
-     */
-    public void setComment(String comment) {
-        super.setInternalComment(comment);
-    }
-
-    /**
-     * Override the project working directory.
-     *
-     * @param   localPath   The path on disk.
-     */
-    public void setLocalpath(Path localPath) {
-        this.localPath = localPath.toString();
-    }
-}
+/*
+ * Copyright  2002-2004, 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.vss;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.Path;
+
+/**
+ * Performs Add commands to Microsoft Visual SourceSafe.
+ *
+ * @ant.task name="vssadd" category="scm"
+ */
+public class MSVSSADD extends MSVSS {
+
+    private String localPath = null;
+
+    /**
+     * Builds a command line to execute ss.
+     * @return     The constructed commandline.
+     */
+    protected Commandline buildCmdLine() {
+        Commandline commandLine = new Commandline();
+
+        // first off, make sure that we've got a command and a localPath ...
+        if (getLocalpath() == null) {
+            String msg = "localPath attribute must be set!";
+            throw new BuildException(msg, getLocation());
+        }
+
+        // build the command line from what we got the format is
+        // ss Add VSS items [-B] [-C] [-D-] [-H] [-I-] [-K] [-N] [-O] [-R] [-W] [-Y] [-?]
+        // as specified in the SS.EXE help
+        commandLine.setExecutable(getSSCommand());
+        commandLine.createArgument().setValue(COMMAND_ADD);
+
+        // VSS items
+        commandLine.createArgument().setValue(getLocalpath());
+        // -I- or -I-Y or -I-N
+        commandLine.createArgument().setValue(getAutoresponse());
+        // -R
+        commandLine.createArgument().setValue(getRecursive());
+        // -W
+        commandLine.createArgument().setValue(getWritable());
+        // -Y
+        commandLine.createArgument().setValue(getLogin());
+        // -C
+        commandLine.createArgument().setValue(getComment());
+
+        return commandLine;
+    }
+
+    /**
+     * Returns the local path without the flag.; required
+     * @todo See why this returns the local path without the flag.
+     * @return The local path value.
+     */
+    protected String getLocalpath() {
+        return localPath;
+    }
+
+    /**
+     * Add files recursively. Defaults to false.
+     *
+     * @param recursive  The boolean value for recursive.
+     */
+    public void setRecursive(boolean recursive) {
+        super.setInternalRecursive(recursive);
+    }
+
+    /**
+     * Unset the READ-ONLY flag on local copies of files added to VSS. Defaults to false.
+     *
+     * @param   writable The boolean value for writable.
+     */
+    public final void setWritable(boolean writable) {
+        super.setInternalWritable(writable);
+    }
+
+    /**
+     * Autoresponce behaviour. Valid options are Y and N.
+     *
+     * @param response The auto response value.
+     */
+    public void setAutoresponse(String response) {
+        super.setInternalAutoResponse(response);
+    }
+
+    /**
+     * Comment to apply to files added to SourceSafe.
+     *
+     * @param comment The comment to apply in SourceSafe
+     */
+    public void setComment(String comment) {
+        super.setInternalComment(comment);
+    }
+
+    /**
+     * Override the project working directory.
+     *
+     * @param   localPath   The path on disk.
+     */
+    public void setLocalpath(Path localPath) {
+        this.localPath = localPath.toString();
+    }
+}

Propchange: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSADD.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKIN.java
URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKIN.java?rev=397075&r1=397074&r2=397075&view=diff
==============================================================================
--- ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKIN.java (original)
+++ ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKIN.java Tue Apr 25 21:01:19 2006
@@ -1,113 +1,113 @@
-/*
- * Copyright  2001-2004, 2006 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.ant.vss;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.Path;
-
-/**
- * Performs CheckIn commands to Microsoft Visual SourceSafe.
- *
- * @ant.task name="vsscheckin" category="scm"
- */
-public class MSVSSCHECKIN extends MSVSS {
-
-    /**
-     * Builds a command line to execute ss.
-     * @return     The constructed commandline.
-     */
-    protected Commandline buildCmdLine() {
-        Commandline commandLine = new Commandline();
-
-        // first off, make sure that we've got a command and a vssdir ...
-        if (getVsspath() == null) {
-            String msg = "vsspath attribute must be set!";
-            throw new BuildException(msg, getLocation());
-        }
-
-        // build the command line from what we got the format is
-        // ss Checkin VSS items [-H] [-C] [-I-] [-N] [-O] [-R] [-W] [-Y] [-?]
-        // as specified in the SS.EXE help
-        commandLine.setExecutable(getSSCommand());
-        commandLine.createArgument().setValue(COMMAND_CHECKIN);
-
-        // VSS items
-        commandLine.createArgument().setValue(getVsspath());
-        // -GL
-        commandLine.createArgument().setValue(getLocalpath());
-        // -I- or -I-Y or -I-N
-        commandLine.createArgument().setValue(getAutoresponse());
-        // -R
-        commandLine.createArgument().setValue(getRecursive());
-        // -W
-        commandLine.createArgument().setValue(getWritable());
-        // -Y
-        commandLine.createArgument().setValue(getLogin());
-        // -C
-        commandLine.createArgument().setValue(getComment());
-
-        return commandLine;
-    }
-
-    /**
-     * Override the project working directory.
-     *
-     * @param   localPath   The path on disk.
-     */
-    public void setLocalpath(Path localPath) {
-        super.setInternalLocalPath(localPath.toString());
-    }
-
-    /**
-     * Check-in files recursively. Defaults to false.
-     *
-     * @param recursive  The boolean value for recursive.
-     */
-    public void setRecursive(boolean recursive) {
-        super.setInternalRecursive(recursive);
-    }
-
-    /**
-     * Unset the READ-ONLY flag on local copies of files checked-in to VSS.
-     * Defaults to false.
-     *
-     * @param   writable The boolean value for writable.
-     */
-    public final void setWritable(boolean writable) {
-        super.setInternalWritable(writable);
-    }
-
-    /**
-     * Autoresponce behaviour. Valid options are Y and N.
-     *
-     * @param response The auto response value.
-     */
-    public void setAutoresponse(String response) {
-        super.setInternalAutoResponse(response);
-    }
-
-    /**
-     * Comment to apply to files checked-in to SourceSafe.
-     *
-     * @param comment The comment to apply in SourceSafe
-     */
-    public void setComment(String comment) {
-        super.setInternalComment(comment);
-    }
-}
+/*
+ * Copyright  2001-2004, 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.vss;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.Path;
+
+/**
+ * Performs CheckIn commands to Microsoft Visual SourceSafe.
+ *
+ * @ant.task name="vsscheckin" category="scm"
+ */
+public class MSVSSCHECKIN extends MSVSS {
+
+    /**
+     * Builds a command line to execute ss.
+     * @return     The constructed commandline.
+     */
+    protected Commandline buildCmdLine() {
+        Commandline commandLine = new Commandline();
+
+        // first off, make sure that we've got a command and a vssdir ...
+        if (getVsspath() == null) {
+            String msg = "vsspath attribute must be set!";
+            throw new BuildException(msg, getLocation());
+        }
+
+        // build the command line from what we got the format is
+        // ss Checkin VSS items [-H] [-C] [-I-] [-N] [-O] [-R] [-W] [-Y] [-?]
+        // as specified in the SS.EXE help
+        commandLine.setExecutable(getSSCommand());
+        commandLine.createArgument().setValue(COMMAND_CHECKIN);
+
+        // VSS items
+        commandLine.createArgument().setValue(getVsspath());
+        // -GL
+        commandLine.createArgument().setValue(getLocalpath());
+        // -I- or -I-Y or -I-N
+        commandLine.createArgument().setValue(getAutoresponse());
+        // -R
+        commandLine.createArgument().setValue(getRecursive());
+        // -W
+        commandLine.createArgument().setValue(getWritable());
+        // -Y
+        commandLine.createArgument().setValue(getLogin());
+        // -C
+        commandLine.createArgument().setValue(getComment());
+
+        return commandLine;
+    }
+
+    /**
+     * Override the project working directory.
+     *
+     * @param   localPath   The path on disk.
+     */
+    public void setLocalpath(Path localPath) {
+        super.setInternalLocalPath(localPath.toString());
+    }
+
+    /**
+     * Check-in files recursively. Defaults to false.
+     *
+     * @param recursive  The boolean value for recursive.
+     */
+    public void setRecursive(boolean recursive) {
+        super.setInternalRecursive(recursive);
+    }
+
+    /**
+     * Unset the READ-ONLY flag on local copies of files checked-in to VSS.
+     * Defaults to false.
+     *
+     * @param   writable The boolean value for writable.
+     */
+    public final void setWritable(boolean writable) {
+        super.setInternalWritable(writable);
+    }
+
+    /**
+     * Autoresponce behaviour. Valid options are Y and N.
+     *
+     * @param response The auto response value.
+     */
+    public void setAutoresponse(String response) {
+        super.setInternalAutoResponse(response);
+    }
+
+    /**
+     * Comment to apply to files checked-in to SourceSafe.
+     *
+     * @param comment The comment to apply in SourceSafe
+     */
+    public void setComment(String comment) {
+        super.setInternalComment(comment);
+    }
+}

Propchange: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKIN.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKOUT.java
URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKOUT.java?rev=397075&r1=397074&r2=397075&view=diff
==============================================================================
--- ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKOUT.java (original)
+++ ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKOUT.java Tue Apr 25 21:01:19 2006
@@ -1,164 +1,164 @@
-/*
- * Copyright  2001-2004, 2006 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.ant.vss;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.Path;
-
-/**
- * Performs CheckOut commands to Microsoft Visual SourceSafe.
- *
- * @ant.task name="vsscheckout" category="scm"
- * @ant.attribute.group name="vdl" description="Only one of version, date or label"
- */
-public class MSVSSCHECKOUT extends MSVSS {
-
-    /**
-     * Builds a command line to execute ss.
-     * @return     The constructed commandline.
-     */
-    protected Commandline buildCmdLine() {
-        Commandline commandLine = new Commandline();
-
-        // first off, make sure that we've got a command and a vssdir ...
-        if (getVsspath() == null) {
-            String msg = "vsspath attribute must be set!";
-            throw new BuildException(msg, getLocation());
-        }
-
-        // build the command line from what we got the format is
-        // ss Checkout VSS items [-G] [-C] [-H] [-I-] [-N] [-O] [-R] [-V] [-Y] [-?]
-        // as specified in the SS.EXE help
-        commandLine.setExecutable(getSSCommand());
-        commandLine.createArgument().setValue(COMMAND_CHECKOUT);
-
-        // VSS items
-        commandLine.createArgument().setValue(getVsspath());
-        // -GL
-        commandLine.createArgument().setValue(getLocalpath());
-        // -I- or -I-Y or -I-N
-        commandLine.createArgument().setValue(getAutoresponse());
-        // -R
-        commandLine.createArgument().setValue(getRecursive());
-        // -V
-        commandLine.createArgument().setValue(getVersionDateLabel());
-        // -Y
-        commandLine.createArgument().setValue(getLogin());
-        // -G
-        commandLine.createArgument().setValue(getFileTimeStamp());
-        // -GWS or -GWR
-        commandLine.createArgument().setValue(getWritableFiles());
-        // -G-
-        commandLine.createArgument().setValue(getGetLocalCopy());
-
-        return commandLine;
-    }
-
-    /**
-     * Override the project working directory.
-     *
-     * @param   localPath   The path on disk.
-     */
-    public void setLocalpath(Path localPath) {
-        super.setInternalLocalPath(localPath.toString());
-    }
-
-    /**
-     * Check-out files recursively. Defaults to false.
-     *
-     * @param recursive  The boolean value for recursive.
-     */
-    public void setRecursive(boolean recursive) {
-        super.setInternalRecursive(recursive);
-    }
-
-    /**
-     * Version to check-out.
-     *
-     * @param  version The version to check-out.
-     *
-     * @ant.attribute group="vdl"
-     */
-    public void setVersion(String version) {
-        super.setInternalVersion(version);
-    }
-
-    /**
-     * Date to check-out.
-     *
-     * @param  date The date to check-out.
-     *
-     * @ant.attribute group="vdl"
-     */
-    public void setDate(String date) {
-        super.setInternalDate(date);
-    }
-
-    /**
-     * Label to check-out.
-     *
-     * @param  label The label to check-out.
-     *
-     * @ant.attribute group="vdl"
-     */
-    public void setLabel(String label) {
-        super.setInternalLabel(label);
-    }
-
-    /**
-     * Autoresponce behaviour. Valid options are Y and N.
-     *
-     * @param response The auto response value.
-     */
-    public void setAutoresponse(String response) {
-        super.setInternalAutoResponse(response);
-    }
-
-    /**
-     * Date and time stamp given to the local copy. Defaults to <code>current</code>.
-     *
-     * @param timestamp     The file time stamping behaviour.
-     */
-    public void setFileTimeStamp(CurrentModUpdated timestamp) {
-        super.setInternalFileTimeStamp(timestamp);
-    }
-
-    /**
-     * Action taken when local files are writable. Defaults to <code>fail</code>.
-     * <p>
-     * Due to ss.exe returning with an exit code of '100' for both errors and when
-     * a file has been skipped, <code>failonerror</code> is set to false when using
-     * the <code>skip</code> option.
-     * </p>
-     *
-     * @param files     The writable files behaviour
-     */
-    public void setWritableFiles(WritableFiles files) {
-        super.setInternalWritableFiles(files);
-    }
-
-    /**
-     * Retrieve a local copy during a checkout. Defaults to true.
-     *
-     * @param get   The get local copy behaviour
-     */
-    public void setGetLocalCopy(boolean get) {
-        super.setInternalGetLocalCopy(get);
-    }
-}
+/*
+ * Copyright  2001-2004, 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.vss;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.Path;
+
+/**
+ * Performs CheckOut commands to Microsoft Visual SourceSafe.
+ *
+ * @ant.task name="vsscheckout" category="scm"
+ * @ant.attribute.group name="vdl" description="Only one of version, date or label"
+ */
+public class MSVSSCHECKOUT extends MSVSS {
+
+    /**
+     * Builds a command line to execute ss.
+     * @return     The constructed commandline.
+     */
+    protected Commandline buildCmdLine() {
+        Commandline commandLine = new Commandline();
+
+        // first off, make sure that we've got a command and a vssdir ...
+        if (getVsspath() == null) {
+            String msg = "vsspath attribute must be set!";
+            throw new BuildException(msg, getLocation());
+        }
+
+        // build the command line from what we got the format is
+        // ss Checkout VSS items [-G] [-C] [-H] [-I-] [-N] [-O] [-R] [-V] [-Y] [-?]
+        // as specified in the SS.EXE help
+        commandLine.setExecutable(getSSCommand());
+        commandLine.createArgument().setValue(COMMAND_CHECKOUT);
+
+        // VSS items
+        commandLine.createArgument().setValue(getVsspath());
+        // -GL
+        commandLine.createArgument().setValue(getLocalpath());
+        // -I- or -I-Y or -I-N
+        commandLine.createArgument().setValue(getAutoresponse());
+        // -R
+        commandLine.createArgument().setValue(getRecursive());
+        // -V
+        commandLine.createArgument().setValue(getVersionDateLabel());
+        // -Y
+        commandLine.createArgument().setValue(getLogin());
+        // -G
+        commandLine.createArgument().setValue(getFileTimeStamp());
+        // -GWS or -GWR
+        commandLine.createArgument().setValue(getWritableFiles());
+        // -G-
+        commandLine.createArgument().setValue(getGetLocalCopy());
+
+        return commandLine;
+    }
+
+    /**
+     * Override the project working directory.
+     *
+     * @param   localPath   The path on disk.
+     */
+    public void setLocalpath(Path localPath) {
+        super.setInternalLocalPath(localPath.toString());
+    }
+
+    /**
+     * Check-out files recursively. Defaults to false.
+     *
+     * @param recursive  The boolean value for recursive.
+     */
+    public void setRecursive(boolean recursive) {
+        super.setInternalRecursive(recursive);
+    }
+
+    /**
+     * Version to check-out.
+     *
+     * @param  version The version to check-out.
+     *
+     * @ant.attribute group="vdl"
+     */
+    public void setVersion(String version) {
+        super.setInternalVersion(version);
+    }
+
+    /**
+     * Date to check-out.
+     *
+     * @param  date The date to check-out.
+     *
+     * @ant.attribute group="vdl"
+     */
+    public void setDate(String date) {
+        super.setInternalDate(date);
+    }
+
+    /**
+     * Label to check-out.
+     *
+     * @param  label The label to check-out.
+     *
+     * @ant.attribute group="vdl"
+     */
+    public void setLabel(String label) {
+        super.setInternalLabel(label);
+    }
+
+    /**
+     * Autoresponce behaviour. Valid options are Y and N.
+     *
+     * @param response The auto response value.
+     */
+    public void setAutoresponse(String response) {
+        super.setInternalAutoResponse(response);
+    }
+
+    /**
+     * Date and time stamp given to the local copy. Defaults to <code>current</code>.
+     *
+     * @param timestamp     The file time stamping behaviour.
+     */
+    public void setFileTimeStamp(CurrentModUpdated timestamp) {
+        super.setInternalFileTimeStamp(timestamp);
+    }
+
+    /**
+     * Action taken when local files are writable. Defaults to <code>fail</code>.
+     * <p>
+     * Due to ss.exe returning with an exit code of '100' for both errors and when
+     * a file has been skipped, <code>failonerror</code> is set to false when using
+     * the <code>skip</code> option.
+     * </p>
+     *
+     * @param files     The writable files behaviour
+     */
+    public void setWritableFiles(WritableFiles files) {
+        super.setInternalWritableFiles(files);
+    }
+
+    /**
+     * Retrieve a local copy during a checkout. Defaults to true.
+     *
+     * @param get   The get local copy behaviour
+     */
+    public void setGetLocalCopy(boolean get) {
+        super.setInternalGetLocalCopy(get);
+    }
+}

Propchange: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCHECKOUT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCLOAK.java
URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCLOAK.java?rev=397075&r1=397074&r2=397075&view=diff
==============================================================================
--- ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCLOAK.java (original)
+++ ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCLOAK.java Tue Apr 25 21:01:19 2006
@@ -1,53 +1,53 @@
-/*
- * Copyright  2006 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.ant.vss;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Commandline;
-
-public class MSVSSCLOAK extends MSVSS {
-
-    /**
-     * Builds a command line to execute ss.
-     * @return     The constructed commandline.
-     */
-    Commandline buildCmdLine() {
-        Commandline commandLine = new Commandline();
-
-        // first off, make sure that we've got a command and a vssdir...
-        if (getVsspath() == null) {
-            String msg = "vsspath attribute must be set!";
-            throw new BuildException(msg, getLocation());
-        }
-        // Cloak always returns 1 - must set failonerror="false" as workaround
-        this.setFailOnError(false);
-        // build the command line from what we got
-        // the format is:
-        // ss Cloak VSS project path
-        // as specified in the SS.EXE help
-        commandLine.setExecutable(getSSCommand());
-        commandLine.createArgument().setValue(COMMAND_CLOAK);
-
-        // VSS items (from)
-        commandLine.createArgument().setValue(getVsspath());
-        // -Y
-        commandLine.createArgument().setValue(getLogin());
-
-        return commandLine;
-    }
-}
+/*
+ * Copyright  2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.vss;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Commandline;
+
+public class MSVSSCLOAK extends MSVSS {
+
+    /**
+     * Builds a command line to execute ss.
+     * @return     The constructed commandline.
+     */
+    Commandline buildCmdLine() {
+        Commandline commandLine = new Commandline();
+
+        // first off, make sure that we've got a command and a vssdir...
+        if (getVsspath() == null) {
+            String msg = "vsspath attribute must be set!";
+            throw new BuildException(msg, getLocation());
+        }
+        // Cloak always returns 1 - must set failonerror="false" as workaround
+        this.setFailOnError(false);
+        // build the command line from what we got
+        // the format is:
+        // ss Cloak VSS project path
+        // as specified in the SS.EXE help
+        commandLine.setExecutable(getSSCommand());
+        commandLine.createArgument().setValue(COMMAND_CLOAK);
+
+        // VSS items (from)
+        commandLine.createArgument().setValue(getVsspath());
+        // -Y
+        commandLine.createArgument().setValue(getLogin());
+
+        return commandLine;
+    }
+}

Propchange: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCLOAK.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCP.java
URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCP.java?rev=397075&r1=397074&r2=397075&view=diff
==============================================================================
--- ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCP.java (original)
+++ ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCP.java Tue Apr 25 21:01:19 2006
@@ -1,68 +1,68 @@
-/*
- * Copyright  2002-2004, 2006 The Apache Software Foundation
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.ant.vss;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Commandline;
-
-/**
- * Performs CP (Change Project) commands to Microsoft Visual SourceSafe.
- * <p>This task is typically used before a VssAdd in order to set the target project</p>
- *
- * @ant.task name="vsscp" category="scm"
- */
-public class MSVSSCP extends MSVSS {
-
-    /**
-     * Builds a command line to execute ss.
-     * @return     The constructed commandline.
-     */
-    protected Commandline buildCmdLine() {
-        Commandline commandLine = new Commandline();
-
-        // first off, make sure that we've got a command and a vssdir ...
-        if (getVsspath() == null) {
-            String msg = "vsspath attribute must be set!";
-            throw new BuildException(msg, getLocation());
-        }
-
-        // build the command line from what we got the format is
-        // ss CP VSS items [-H] [-I-] [-Y] [-?]
-        // as specified in the SS.EXE help
-        commandLine.setExecutable(getSSCommand());
-        commandLine.createArgument().setValue(COMMAND_CP);
-
-        // VSS items
-        commandLine.createArgument().setValue(getVsspath());
-        // -I- or -I-Y or -I-N
-        commandLine.createArgument().setValue(getAutoresponse());
-        // -Y
-        commandLine.createArgument().setValue(getLogin());
-
-        return commandLine;
-    }
-
-    /**
-     * Autoresponce behaviour. Valid options are Y and N.
-     *
-     * @param response The auto response value.
-     */
-    public void setAutoresponse(String response) {
-        super.setInternalAutoResponse(response);
-    }
-}
+/*
+ * Copyright  2002-2004, 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.vss;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Commandline;
+
+/**
+ * Performs CP (Change Project) commands to Microsoft Visual SourceSafe.
+ * <p>This task is typically used before a VssAdd in order to set the target project</p>
+ *
+ * @ant.task name="vsscp" category="scm"
+ */
+public class MSVSSCP extends MSVSS {
+
+    /**
+     * Builds a command line to execute ss.
+     * @return     The constructed commandline.
+     */
+    protected Commandline buildCmdLine() {
+        Commandline commandLine = new Commandline();
+
+        // first off, make sure that we've got a command and a vssdir ...
+        if (getVsspath() == null) {
+            String msg = "vsspath attribute must be set!";
+            throw new BuildException(msg, getLocation());
+        }
+
+        // build the command line from what we got the format is
+        // ss CP VSS items [-H] [-I-] [-Y] [-?]
+        // as specified in the SS.EXE help
+        commandLine.setExecutable(getSSCommand());
+        commandLine.createArgument().setValue(COMMAND_CP);
+
+        // VSS items
+        commandLine.createArgument().setValue(getVsspath());
+        // -I- or -I-Y or -I-N
+        commandLine.createArgument().setValue(getAutoresponse());
+        // -Y
+        commandLine.createArgument().setValue(getLogin());
+
+        return commandLine;
+    }
+
+    /**
+     * Autoresponce behaviour. Valid options are Y and N.
+     *
+     * @param response The auto response value.
+     */
+    public void setAutoresponse(String response) {
+        super.setInternalAutoResponse(response);
+    }
+}

Propchange: ant/sandbox/antlibs/vss/src/main/org/apache/ant/vss/MSVSSCP.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message