Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 671   Methods: 34
NCLOC: 357   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Pvcs.java 0% 0% 0% 0%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2001-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   
 package org.apache.tools.ant.taskdefs.optional.pvcs;
 55   
 
 56   
 import java.io.BufferedReader;
 57   
 import java.io.BufferedWriter;
 58   
 import java.io.File;
 59   
 import java.io.FileNotFoundException;
 60   
 import java.io.FileOutputStream;
 61   
 import java.io.FileReader;
 62   
 import java.io.FileWriter;
 63   
 import java.io.IOException;
 64   
 import java.text.MessageFormat;
 65   
 import java.text.ParseException;
 66   
 import java.util.Enumeration;
 67   
 import java.util.Random;
 68   
 import java.util.Vector;
 69   
 import org.apache.tools.ant.BuildException;
 70   
 import org.apache.tools.ant.Project;
 71   
 import org.apache.tools.ant.taskdefs.Execute;
 72   
 import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
 73   
 import org.apache.tools.ant.taskdefs.LogOutputStream;
 74   
 import org.apache.tools.ant.taskdefs.LogStreamHandler;
 75   
 import org.apache.tools.ant.taskdefs.PumpStreamHandler;
 76   
 import org.apache.tools.ant.types.Commandline;
 77   
 
 78   
 /**
 79   
  *
 80   
  * Extracts the latest edition of the source code from a PVCS repository.
 81   
  * PVCS is a version control system
 82   
  * developed by <a href="http://www.merant.com/products/pvcs">Merant</a>.
 83   
  * <br>
 84   
  * Before using this tag, the user running ant must have access to the commands 
 85   
  * of PVCS (get and pcli) and must have access to the repository. Note that the way to specify
 86   
  * the repository is platform dependent so use property to specify location of repository.
 87   
  * <br>
 88   
  * This version has been tested agains PVCS version 6.5 and 6.6 under Windows and Solaris.
 89   
  
 90   
  *
 91   
  * <b>19-04-2001</b> <p>The task now has a more robust
 92   
  * parser. It allows for platform independant file paths
 93   
  * and supports file names with <i>()</i>. Thanks to Erik Husby for
 94   
  * bringing the bug to my attention.
 95   
  *
 96   
  * <b>27-04-2001</b> <p>UNC paths are now handled properly.
 97   
  * Fix provided by Don Jeffery. He also added an <i>UpdateOnly</i> flag
 98   
  * that, when true, conditions the PVCS get using the -U option to only
 99   
  * update those files that have a modification time (in PVCS) that is newer
 100   
  * than the existing workfile.
 101   
  *
 102   
  * <b>25-10-2002</b> <p>Added a revision attribute that currently is a
 103   
  * synonym for label, but in a future release the behavior of the label
 104   
  * attribute will change to use the -v option of GET.  See bug #13847 for
 105   
  * discussion.
 106   
  *
 107   
  * @author <a href="mailto:tchristensen@nordija.com">Thomas Christensen</a>
 108   
  * @author <a href="mailto:donj@apogeenet.com">Don Jeffery</a>
 109   
  * @author <a href="mailto:snewton@standard.com">Steven E. Newton</a>
 110   
  */
 111   
 public class Pvcs extends org.apache.tools.ant.Task {
 112   
     private String pvcsbin;
 113   
     private String repository;
 114   
     private String pvcsProject;
 115   
     private Vector pvcsProjects;
 116   
     private String workspace;
 117   
     private String force;
 118   
     private String promotiongroup;
 119   
     private String label;
 120   
     private String revision;
 121   
     private boolean ignorerc;
 122   
     private boolean updateOnly;
 123   
     private String filenameFormat;
 124   
     private String lineStart;
 125   
     private String userId;
 126   
     /**
 127   
      * Constant for the thing to execute
 128   
      */
 129   
     private static final String PCLI_EXE = "pcli";
 130   
 
 131   
     /*
 132   
      * Constant for the PCLI listversionedfiles recursive i a format "get" understands
 133   
      */
 134   
     // private static final String PCLI_LVF_ARGS = "lvf -z -aw";
 135   
 
 136   
     /**
 137   
      * Constant for the thing to execute
 138   
      */
 139   
     private static final String GET_EXE = "get";
 140   
 
 141   
 
 142  0
     protected int runCmd(Commandline cmd, ExecuteStreamHandler out) {
 143  0
         try {
 144  0
             Project aProj = getProject();
 145  0
             Execute exe = new Execute(out);
 146  0
             exe.setAntRun(aProj);
 147  0
             exe.setWorkingDirectory(aProj.getBaseDir());
 148  0
             exe.setCommandline(cmd.getCommandline());
 149  0
             return exe.execute();
 150   
         } catch (java.io.IOException e) {
 151  0
             String msg = "Failed executing: " + cmd.toString()
 152   
                 + ". Exception: " + e.getMessage();
 153  0
             throw new BuildException(msg, getLocation());
 154   
         }
 155   
     }
 156   
 
 157  0
     private String getExecutable(String exe) {
 158  0
         StringBuffer correctedExe = new StringBuffer();
 159  0
         if (getPvcsbin() != null) {
 160  0
             if (pvcsbin.endsWith(File.separator)) {
 161  0
                 correctedExe.append(pvcsbin);
 162   
             } else {
 163  0
                 correctedExe.append(pvcsbin).append(File.separator);
 164   
             }
 165   
         }
 166  0
         return correctedExe.append(exe).toString();
 167   
     }
 168   
 
 169   
     /**
 170   
      * @exception org.apache.tools.ant.BuildException Something is stopping the build...
 171   
      */
 172  0
     public void execute() throws org.apache.tools.ant.BuildException {
 173  0
         int result = 0;
 174   
 
 175  0
         if (repository == null || repository.trim().equals("")) {
 176  0
             throw new BuildException("Required argument repository not specified");
 177   
         }
 178   
 
 179   
         // Check workspace exists
 180   
         // Launch PCLI listversionedfiles -z -aw
 181   
         // Capture output
 182   
         // build the command line from what we got the format is
 183  0
         Commandline commandLine = new Commandline();
 184  0
         commandLine.setExecutable(getExecutable(PCLI_EXE));
 185   
 
 186  0
         commandLine.createArgument().setValue("lvf");
 187  0
         commandLine.createArgument().setValue("-z");
 188  0
         commandLine.createArgument().setValue("-aw");
 189  0
         if (getWorkspace() != null) {
 190  0
             commandLine.createArgument().setValue("-sp" + getWorkspace());
 191   
         }
 192  0
         commandLine.createArgument().setValue("-pr" + getRepository());
 193   
 
 194  0
         String uid = getUserId();
 195   
 
 196  0
         if (uid != null) {
 197  0
             commandLine.createArgument().setValue("-id" + uid);
 198   
         }
 199   
 
 200   
         // default pvcs project is "/"
 201  0
         if (getPvcsproject() == null && getPvcsprojects().isEmpty()) {
 202  0
             pvcsProject = "/";
 203   
         }
 204   
 
 205  0
         if (getPvcsproject() != null) {
 206  0
             commandLine.createArgument().setValue(getPvcsproject());
 207   
         }
 208  0
         if (!getPvcsprojects().isEmpty()) {
 209  0
             Enumeration e = getPvcsprojects().elements();
 210  0
             while (e.hasMoreElements()) {
 211  0
                 String projectName = ((PvcsProject) e.nextElement()).getName();
 212  0
                 if (projectName == null || (projectName.trim()).equals("")) {
 213  0
                     throw new BuildException("name is a required attribute "
 214   
                         + "of pvcsproject");
 215   
                 }
 216  0
                 commandLine.createArgument().setValue(projectName);
 217   
             }
 218   
         }
 219   
 
 220  0
         File tmp = null;
 221  0
         File tmp2 = null;
 222  0
         try {
 223  0
             Random rand = new Random(System.currentTimeMillis());
 224  0
             tmp = new File("pvcs_ant_" + rand.nextLong() + ".log");
 225  0
             FileOutputStream fos = new FileOutputStream(tmp);
 226  0
             tmp2 = new File("pvcs_ant_" + rand.nextLong() + ".log");
 227  0
             log(commandLine.describeCommand(), Project.MSG_VERBOSE);
 228  0
             try {
 229  0
                 result = runCmd(commandLine, 
 230   
                                 new PumpStreamHandler(fos, 
 231   
                                     new LogOutputStream(this,
 232   
                                                         Project.MSG_WARN)));
 233   
             } finally {
 234  0
                 fos.close();
 235   
             }
 236   
             
 237  0
             if (result != 0 && !ignorerc) {
 238  0
                 String msg = "Failed executing: " + commandLine.toString();
 239  0
                 throw new BuildException(msg, getLocation());
 240   
             }
 241   
 
 242  0
             if (!tmp.exists()) {
 243  0
                 throw new BuildException("Communication between ant and pvcs "
 244   
                     + "failed. No output generated from executing PVCS "
 245   
                     + "commandline interface \"pcli\" and \"get\"");
 246   
             }
 247   
 
 248   
             // Create folders in workspace
 249  0
             log("Creating folders", Project.MSG_INFO);
 250  0
             createFolders(tmp);
 251   
 
 252   
             // Massage PCLI lvf output transforming '\' to '/' so get command works appropriately
 253  0
             massagePCLI(tmp, tmp2);
 254   
 
 255   
             // Launch get on output captured from PCLI lvf
 256  0
             commandLine.clearArgs();
 257  0
             commandLine.setExecutable(getExecutable(GET_EXE));
 258   
 
 259  0
             if (getForce() != null && getForce().equals("yes")) {
 260  0
                 commandLine.createArgument().setValue("-Y");
 261   
             } else {
 262  0
                 commandLine.createArgument().setValue("-N");
 263   
             }
 264   
 
 265  0
             if (getPromotiongroup() != null) {
 266  0
                 commandLine.createArgument().setValue("-G"
 267   
                     + getPromotiongroup());
 268   
             } else {
 269  0
                 if (getLabel() != null) {
 270  0
                     commandLine.createArgument().setValue("-r" + getLabel());
 271   
                 } else {
 272  0
                     if (getRevision() != null) {
 273  0
                         commandLine.createArgument().setValue("-r"
 274   
                             + getRevision());
 275   
                     }
 276   
                 }
 277   
             }
 278   
 
 279  0
             if (updateOnly) {
 280  0
                 commandLine.createArgument().setValue("-U");
 281   
             }
 282   
 
 283  0
             commandLine.createArgument().setValue("@" + tmp2.getAbsolutePath());
 284  0
             log("Getting files", Project.MSG_INFO);
 285  0
             log("Executing " + commandLine.toString(), Project.MSG_VERBOSE);
 286  0
             result = runCmd(commandLine,
 287   
                 new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN));
 288  0
             if (result != 0 && !ignorerc) {
 289  0
                 String msg = "Failed executing: " + commandLine.toString()
 290   
                     + ". Return code was " + result;
 291  0
                 throw new BuildException(msg, getLocation());
 292   
             }
 293   
 
 294   
         } catch (FileNotFoundException e) {
 295  0
             String msg = "Failed executing: " + commandLine.toString()
 296   
                 + ". Exception: " + e.getMessage();
 297  0
             throw new BuildException(msg, getLocation());
 298   
         } catch (IOException e) {
 299  0
             String msg = "Failed executing: " + commandLine.toString()
 300   
                 + ". Exception: " + e.getMessage();
 301  0
             throw new BuildException(msg, getLocation());
 302   
         } catch (ParseException e) {
 303  0
             String msg = "Failed executing: " + commandLine.toString()
 304   
                 + ". Exception: " + e.getMessage();
 305  0
             throw new BuildException(msg, getLocation());
 306   
         } finally {
 307  0
             if (tmp != null) {
 308  0
                 tmp.delete();
 309   
             }
 310  0
             if (tmp2 != null) {
 311  0
                 tmp2.delete();
 312   
             }
 313   
         }
 314   
     }
 315   
 
 316   
     /**
 317   
      * Parses the file and creates the folders specified in the output section
 318   
      */
 319  0
     private void createFolders(File file) throws IOException, ParseException {
 320  0
         BufferedReader in = null;
 321  0
         try {
 322  0
             in = new BufferedReader(new FileReader(file));
 323  0
             MessageFormat mf = new MessageFormat(getFilenameFormat());
 324  0
             String line = in.readLine();
 325  0
             while (line != null) {
 326  0
                 log("Considering \"" + line + "\"", Project.MSG_VERBOSE);
 327  0
                 if (line.startsWith("\"\\") ||
 328   
                     line.startsWith("\"/") ||
 329   
                     (line.length() >3 &&
 330   
                      line.startsWith("\"") &&
 331   
                      Character.isLetter(line.charAt(1)) &&
 332   
                      String.valueOf(line.charAt(2)).equals(":") &&
 333   
                      String.valueOf(line.charAt(3)).equals("\\"))) {
 334  0
                     Object[] objs = mf.parse(line);
 335  0
                     String f = (String) objs[1];
 336   
                     // Extract the name of the directory from the filename
 337  0
                     int index = f.lastIndexOf(File.separator);
 338  0
                     if (index > -1) {
 339  0
                         File dir = new File(f.substring(0, index));
 340  0
                         if (!dir.exists()) {
 341  0
                             log("Creating " + dir.getAbsolutePath(), 
 342   
                                 Project.MSG_VERBOSE);
 343  0
                             if (dir.mkdirs()) {
 344  0
                                 log("Created " + dir.getAbsolutePath(), 
 345   
                                     Project.MSG_INFO);
 346   
                             } else {
 347  0
                                 log("Failed to create " 
 348   
                                     + dir.getAbsolutePath(), 
 349   
                                     Project.MSG_INFO);
 350   
                             }
 351   
                         } else {
 352  0
                             log(dir.getAbsolutePath() + " exists. Skipping", 
 353   
                                 Project.MSG_VERBOSE);
 354   
                         }
 355   
                     } else {
 356  0
                         log("File separator problem with " + line,
 357   
                             Project.MSG_WARN);
 358   
                     }
 359   
                 } else {
 360  0
                     log("Skipped \"" + line + "\"", Project.MSG_VERBOSE);
 361   
                 }
 362  0
                 line = in.readLine();
 363   
             }
 364   
         } finally {
 365  0
             if (in != null) {
 366  0
                 in.close();
 367   
             }
 368   
         }
 369   
     }
 370   
         
 371   
 
 372   
     /**
 373   
      * Simple hack to handle the PVCS command-line tools botch when
 374   
      * handling UNC notation.
 375   
      */
 376  0
     private void massagePCLI(File in, File out)
 377   
         throws FileNotFoundException, IOException {
 378  0
         BufferedReader inReader = null;
 379  0
         BufferedWriter outWriter = null;
 380  0
         try {
 381  0
             inReader = new BufferedReader(new FileReader(in));
 382  0
             outWriter = new BufferedWriter(new FileWriter(out));
 383  0
             String s = null;
 384  0
             while ((s = inReader.readLine()) != null) {
 385  0
                 String sNormal = s.replace('\\', '/');
 386  0
                 outWriter.write(sNormal);
 387  0
                 outWriter.newLine();
 388   
             }
 389   
         } finally {
 390  0
             if (inReader != null) {
 391  0
                 inReader.close();
 392   
             }
 393  0
             if (outWriter != null) {
 394  0
                 outWriter.close();
 395   
             }
 396   
         }
 397   
     }
 398   
 
 399   
     /**
 400   
      * Get network name of the PVCS repository
 401   
      * @return String
 402   
      */
 403  0
     public String getRepository() {
 404  0
         return repository;
 405   
     }
 406   
 
 407   
     /**
 408   
      *  The filenameFormat attribute defines a MessageFormat string used
 409   
      *  to parse the output of the pcli command.  It defaults to
 410   
      *  <code>{0}-arc({1})</code>.  Repositories where the archive
 411   
      *   extension is not  -arc should set this.
 412   
      */
 413  0
     public String getFilenameFormat() {
 414  0
         return filenameFormat;
 415   
     }
 416   
 
 417   
     /**
 418   
      * The format of the folder names; optional.
 419   
      * This must be in a format suitable for 
 420   
      * <code>java.text.MessageFormat</code>.
 421   
      *  Index 1 of the format will be used as the file name.
 422   
      *  Defaults to <code>{0}-arc({1})</code>
 423   
      */
 424  0
     public void setFilenameFormat(String f) {
 425  0
         filenameFormat = f;
 426   
     }
 427   
 
 428   
     /**
 429   
 
 430   
      * The lineStart attribute is used to parse the output of the pcli
 431   
      * command. It defaults to <code>&quot;P:</code>.  The parser already
 432   
      * knows about / and \\, this property is useful in cases where the
 433   
      * repository is accessed on a Windows platform via a drive letter
 434   
      * mapping.
 435   
      */
 436  0
     public String getLineStart() {
 437  0
         return lineStart;
 438   
     }
 439   
 
 440   
     /**
 441   
      * What a valid return value from PVCS looks like
 442   
      *  when it describes a file.  Defaults to <code>&quot;P:</code>.
 443   
      * If you are not using an UNC name for your repository and the
 444   
      * drive letter <code>P</code> is incorrect for your setup, you may
 445   
      * need to change this value, UNC names will always be
 446   
      * accepted.
 447   
      */
 448   
         
 449  0
     public void setLineStart(String l) {
 450  0
         lineStart = l;
 451   
     }
 452   
 
 453   
     /**
 454   
      * The network name of the PVCS repository; required.
 455   
      * @param repo String
 456   
      */
 457  0
     public void setRepository(String repo) {
 458  0
         repository = repo;
 459   
     }
 460   
 
 461   
     /**
 462   
      * Get name of the project in the PVCS repository
 463   
      * @return String
 464   
      */
 465  0
     public String getPvcsproject() {
 466  0
         return pvcsProject;
 467   
     }
 468   
 
 469   
     /**
 470   
      * The project within the PVCS repository to extract files from;
 471   
      * optional, default &quot;/&quot;
 472   
      * @param prj String
 473   
      */
 474  0
     public void setPvcsproject(String prj) {
 475  0
         pvcsProject = prj;
 476   
     }
 477   
 
 478   
     /**
 479   
      * Get name of the project in the PVCS repository
 480   
      * @return Vector
 481   
      */
 482  0
     public Vector getPvcsprojects() {
 483  0
         return pvcsProjects;
 484   
     }
 485   
 
 486   
     /**
 487   
      * Get name of the workspace to store the retrieved files
 488   
      * @return String
 489   
      */
 490  0
     public String getWorkspace() {
 491  0
         return workspace;
 492   
     }
 493   
 
 494   
     /**
 495   
      * Workspace to use; optional.  
 496   
      * By specifying a workspace, the files are extracted to that location.
 497   
      * A PVCS workspace is a name for a location of the workfiles and 
 498   
      * isn't as such the location itself. 
 499   
      * You define the location for a workspace using the PVCS GUI clients.
 500   
      * If this isn't specified the default workspace for the current user is used.
 501   
      * @param ws String
 502   
      */
 503  0
     public void setWorkspace(String ws) {
 504  0
         workspace = ws;
 505   
     }
 506   
 
 507   
     /**
 508   
      * Get name of the PVCS bin directory
 509   
      * @return String
 510   
      */
 511  0
     public String getPvcsbin() {
 512  0
         return pvcsbin;
 513   
     }
 514   
 
 515   
     /**
 516   
      * Specifies the location of the PVCS bin directory; optional if on the PATH.
 517   
      * On some systems the PVCS executables <i>pcli</i>
 518   
      * and <i>get</i> are not found in the PATH. In such cases this attribute
 519   
      * should be set to the bin directory of the PVCS installation containing
 520   
      * the executables mentioned before. If this attribute isn't specified the
 521   
      * tag expects the executables to be found using the PATH environment variable.
 522   
      * @param ws String
 523   
      * @todo use a File setter and resolve paths.
 524   
      */
 525  0
     public void setPvcsbin(String bin) {
 526  0
         pvcsbin = bin;
 527   
     }
 528   
 
 529   
     /**
 530   
      * Get value of force
 531   
      * @return String
 532   
      */
 533  0
     public String getForce() {
 534  0
         return force;
 535   
     }
 536   
 
 537   
     /**
 538   
      * Specifies the value of the force argument; optional.
 539   
      * If set to <i>yes</i> all files that exists and are 
 540   
      * writable are overwritten. Default <i>no</i> causes the files 
 541   
      * that are writable to be ignored. This stops the PVCS command 
 542   
      * <i>get</i> to stop asking questions!
 543   
      * @todo make a boolean setter
 544   
      * @param repo String (yes/no)
 545   
      */
 546  0
     public void setForce(String f) {
 547  0
         if (f != null && f.equalsIgnoreCase("yes")) {
 548  0
             force = "yes";
 549   
         } else {
 550  0
             force = "no";
 551   
         }
 552   
     }
 553   
 
 554   
     /**
 555   
      * Get value of promotiongroup
 556   
      * @return String
 557   
      */
 558  0
     public String getPromotiongroup() {
 559  0
         return promotiongroup;
 560   
     }
 561   
 
 562   
     /**
 563   
      * Specifies the name of the promotiongroup argument
 564   
      * @param repo String
 565   
      */
 566  0
     public void setPromotiongroup(String w) {
 567  0
         promotiongroup = w;
 568   
     }
 569   
 
 570   
     /**
 571   
      * Get value of label
 572   
      * @return String
 573   
      */
 574  0
     public String getLabel() {
 575  0
         return label;
 576   
     }
 577   
 
 578   
     /**
 579   
      * Only files marked with this label are extracted; optional.
 580   
      * @param repo String
 581   
      */
 582  0
     public void setLabel(String l) {
 583  0
         label = l;
 584   
     }
 585   
 
 586   
     /**
 587   
      * Get value of revision
 588   
      * @return String
 589   
      */
 590  0
     public String getRevision() {
 591  0
         return revision;
 592   
     }
 593   
 
 594   
     /**
 595   
      * Only files with this revision are extract; optional.
 596   
      * @param r String
 597   
      */
 598  0
     public void setRevision(String r) {
 599  0
         revision = r;
 600   
     }
 601   
 
 602   
     /**
 603   
      * Get value of ignorereturncode
 604   
      * @return String
 605   
      */
 606  0
     public boolean getIgnoreReturnCode() {
 607  0
         return ignorerc;
 608   
     }
 609   
 
 610   
     /**
 611   
      * If set to true the return value from executing the pvcs
 612   
      * commands are ignored; optional, default false.
 613   
      */
 614  0
     public void setIgnoreReturnCode(boolean b) {
 615  0
         ignorerc = b;
 616   
     }
 617   
 
 618   
     /**
 619   
      * Specify a project within the PVCS repository to extract files from.
 620   
      * @param PvcsProject
 621   
      */
 622  0
     public void addPvcsproject(PvcsProject p) {
 623  0
         pvcsProjects.addElement(p);
 624   
     }
 625   
 
 626  0
     public boolean getUpdateOnly() {
 627  0
         return updateOnly;
 628   
     }
 629   
 
 630   
     /**
 631   
      * If set to <i>true</i> files are fetched only if 
 632   
      * newer than existing local files; optional, default false.
 633   
      */
 634  0
     public void setUpdateOnly(boolean l) {
 635  0
         updateOnly = l;
 636   
     }
 637   
 
 638  0
     public String getUserId() {
 639  0
         return userId;
 640   
     }
 641   
 
 642   
     /**
 643   
      * User ID; unused.
 644   
      * @ant.attribute ignore="true"
 645   
      */
 646   
      
 647  0
     public void setUserId(String u) {
 648  0
         userId = u;
 649   
     }
 650   
 
 651   
     /**
 652   
      * Creates a Pvcs object
 653   
      */
 654  0
     public Pvcs() {
 655  0
         super();
 656  0
         pvcsProject = null;
 657  0
         pvcsProjects = new Vector();
 658  0
         workspace = null;
 659  0
         repository = null;
 660  0
         pvcsbin = null;
 661  0
         force = null;
 662  0
         promotiongroup = null;
 663  0
         label = null;
 664  0
         ignorerc = false;
 665  0
         updateOnly = false;
 666  0
         lineStart = "\"P:";
 667  0
         filenameFormat = "{0}-arc({1})";
 668   
     }
 669   
 }
 670   
 
 671