Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 239   Methods: 9
NCLOC: 47   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
MSVSSGET.java 0% 0% 0% 0%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
 5   
  * reserved.
 6   
  *
 7   
  * Redistribution and use in source and binary forms, with or without
 8   
  * modification, are permitted provided that the following conditions
 9   
  * are met:
 10   
  *
 11   
  * 1. Redistributions of source code must retain the above copyright
 12   
  *    notice, this list of conditions and the following disclaimer.
 13   
  *
 14   
  * 2. Redistributions in binary form must reproduce the above copyright
 15   
  *    notice, this list of conditions and the following disclaimer in
 16   
  *    the documentation and/or other materials provided with the
 17   
  *    distribution.
 18   
  *
 19   
  * 3. The end-user documentation included with the redistribution, if
 20   
  *    any, must include the following acknowlegement:
 21   
  *       "This product includes software developed by the
 22   
  *        Apache Software Foundation (http://www.apache.org/)."
 23   
  *    Alternately, this acknowlegement may appear in the software itself,
 24   
  *    if and wherever such third-party acknowlegements normally appear.
 25   
  *
 26   
  * 4. The names "Ant" and "Apache Software
 27   
  *    Foundation" must not be used to endorse or promote products derived
 28   
  *    from this software without prior written permission. For written
 29   
  *    permission, please contact apache@apache.org.
 30   
  *
 31   
  * 5. Products derived from this software may not be called "Apache"
 32   
  *    nor may "Apache" appear in their names without prior written
 33   
  *    permission of the Apache Group.
 34   
  *
 35   
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 36   
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 37   
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 38   
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 39   
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 40   
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 41   
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 42   
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 43   
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 44   
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 45   
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 46   
  * SUCH DAMAGE.
 47   
  * ====================================================================
 48   
  *
 49   
  * This software consists of voluntary contributions made by many
 50   
  * individuals on behalf of the Apache Software Foundation.  For more
 51   
  * information on the Apache Software Foundation, please see
 52   
  * <http://www.apache.org/>.
 53   
  */
 54   
 
 55   
 package org.apache.tools.ant.taskdefs.optional.vss;
 56   
 
 57   
 import org.apache.tools.ant.BuildException;
 58   
 import org.apache.tools.ant.types.Commandline;
 59   
 import org.apache.tools.ant.types.Path;
 60   
 
 61   
 /**
 62   
  * Perform Get commands to Microsoft Visual SourceSafe.
 63   
  * <p>
 64   
  * The following attributes are interpreted:
 65   
  * <table border="1">
 66   
  *   <tr>
 67   
  *     <th>Attribute</th>
 68   
  *     <th>Values</th>
 69   
  *     <th>Required</th>
 70   
  *   </tr>
 71   
  *   <tr>
 72   
  *      <td>login</td>
 73   
  *      <td>username,password</td>
 74   
  *      <td>No</td>
 75   
  *   </tr>
 76   
  *   <tr>
 77   
  *      <td>vsspath</td>
 78   
  *      <td>SourceSafe path</td>
 79   
  *      <td>Yes</td>
 80   
  *   </tr>
 81   
  *   <tr>
 82   
  *      <td>localpath</td>
 83   
  *      <td>Override the working directory and get to the specified path</td>
 84   
  *      <td>No</td>
 85   
  *   </tr>
 86   
  *   <tr>
 87   
  *      <td>writable</td>
 88   
  *      <td>true or false</td>
 89   
  *      <td>No</td>
 90   
  *   </tr>
 91   
  *   <tr>
 92   
  *      <td>recursive</td>
 93   
  *      <td>true or false</td>
 94   
  *      <td>No</td>
 95   
  *   </tr>
 96   
  *   <tr>
 97   
  *      <td>version</td>
 98   
  *      <td>a version number to get</td>
 99   
  *      <td>No</td>
 100   
  *   </tr>
 101   
  *   <tr>
 102   
  *      <td>date</td>
 103   
  *      <td>a date stamp to get at</td>
 104   
  *      <td>No</td>
 105   
  *   </tr>
 106   
  *   <tr>
 107   
  *      <td>label</td>
 108   
  *      <td>a label to get for</td>
 109   
  *      <td>No</td>
 110   
  *   </tr>
 111   
  *   <tr>
 112   
  *      <td>quiet</td>
 113   
  *      <td>suppress output (off by default)</td>
 114   
  *      <td>No</td>
 115   
  *   </tr>
 116   
  *   <tr>
 117   
  *      <td>autoresponse</td>
 118   
  *      <td>What to respond with (sets the -I option). By default, -I- is
 119   
  *      used; values of Y or N will be appended to this.</td>
 120   
  *      <td>No</td>
 121   
  *   </tr>
 122   
  * </table>
 123   
  * <p>Note that only one of version, date or label should be specified</p>
 124   
  *
 125   
  * @author Craig Cottingham
 126   
  * @author Andrew Everitt
 127   
  * @author Jesse Stockall
 128   
  *
 129   
  * @ant.task name="vssget" category="scm"
 130   
  */
 131   
 public class MSVSSGET extends MSVSS {
 132   
 
 133   
     /**
 134   
      * Builds a command line to execute ss.
 135   
      * @return     The constructed commandline.
 136   
      */
 137  0
     Commandline buildCmdLine() {
 138  0
         Commandline commandLine = new Commandline();
 139   
 
 140   
         // build the command line from what we got the format is
 141   
         // ss Get VSS items [-G] [-H] [-I-] [-N] [-O] [-R] [-V] [-W] [-Y] [-?]
 142   
         // as specified in the SS.EXE help
 143  0
         commandLine.setExecutable(getSSCommand());
 144  0
         commandLine.createArgument().setValue(COMMAND_GET);
 145   
 
 146  0
         if (getVsspath() == null) {
 147  0
             throw new BuildException("vsspath attribute must be set!", getLocation());
 148   
         }
 149  0
         commandLine.createArgument().setValue(getVsspath());
 150   
 
 151   
         // -GL
 152  0
         commandLine.createArgument().setValue(getLocalpath());
 153   
         // -I- or -I-Y or -I-N
 154  0
         commandLine.createArgument().setValue(getAutoresponse());
 155   
         // -O-
 156  0
         commandLine.createArgument().setValue(getQuiet());
 157   
         // -R
 158  0
         commandLine.createArgument().setValue(getRecursive());
 159   
         // -V
 160  0
         commandLine.createArgument().setValue(getVersion());
 161   
         // -W
 162  0
         commandLine.createArgument().setValue(getWritable());
 163   
         // -Y
 164  0
         commandLine.createArgument().setValue(getLogin());
 165   
 
 166  0
         return commandLine;
 167   
     }
 168   
 
 169   
     /**
 170   
      * Set the local path; optional.
 171   
      * <p>
 172   
      * This is the path to override the project
 173   
      * working directory.
 174   
      * @param   localPath   The path on disk.
 175   
      */
 176  0
     public void setLocalpath(Path localPath) {
 177  0
         super.setInternalLocalPath(localPath.toString());
 178   
     }
 179   
 
 180   
     /**
 181   
      * Flag to tell the task to recurse down the tree;
 182   
      * optional, default false.
 183   
      * @param recursive  The boolean value for recursive.
 184   
      */
 185  0
     public final void setRecursive(boolean recursive) {
 186  0
         super.setInternalRecursive(recursive);
 187   
     }
 188   
 
 189   
     /**
 190   
      * Sets/clears quiet mode; optional, default false.
 191   
      * @param   quiet The boolean value for quiet.
 192   
      */
 193  0
     public final void setQuiet (boolean quiet) {
 194  0
         super.setInternalQuiet(quiet);
 195   
     }
 196   
 
 197   
     /**
 198   
      * Sets behaviour, unset the READ-ONLY flag on files retrieved from VSS.; optional, default false
 199   
      * @param   writable The boolean value for writable.
 200   
      */
 201  0
     public final void setWritable(boolean writable) {
 202  0
         super.setInternalWritable(writable);
 203   
     }
 204   
 
 205   
     /**
 206   
      * Sets the stored version string.; optional.
 207   
      * @param  version The version to get.
 208   
      */
 209  0
     public void setVersion(String version) {
 210  0
         super.setInternalVersion(version);
 211   
     }
 212   
 
 213   
     /**
 214   
      * Sets the stored date string.; optional.
 215   
      * @param  date The date to checkout.
 216   
      */
 217  0
     public void setDate(String date) {
 218  0
         super.setInternalDate(date);
 219   
     }
 220   
 
 221   
     /**
 222   
      * Sets the label to apply in SourceSafe.; optional.
 223   
      * @param  label The label to apply.
 224   
      */
 225  0
     public void setLabel(String label) {
 226  0
         super.setInternalLabel(label);
 227   
     }
 228   
 
 229   
     /**
 230   
      * Sets the autoresponce behaviour.; optional.
 231   
      * <p>
 232   
      * Valid options are Y and N.
 233   
      * @param response The auto response value.
 234   
      */
 235  0
     public void setAutoresponse(String response){
 236  0
         super.setInternalAutoResponse(response);
 237   
     }
 238   
 }
 239