Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 648   Methods: 43
NCLOC: 343   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AbstractFileSet.java 62.5% 69.2% 55.8% 65.3%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2002-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.types;
 55   
 
 56   
 import java.io.File;
 57   
 import java.util.Enumeration;
 58   
 import java.util.Hashtable;
 59   
 import java.util.Stack;
 60   
 import java.util.Vector;
 61   
 import org.apache.tools.ant.BuildException;
 62   
 import org.apache.tools.ant.DirectoryScanner;
 63   
 import org.apache.tools.ant.FileScanner;
 64   
 import org.apache.tools.ant.Project;
 65   
 import org.apache.tools.ant.util.FileUtils;
 66   
 import org.apache.tools.ant.types.selectors.AndSelector;
 67   
 import org.apache.tools.ant.types.selectors.ContainsSelector;
 68   
 import org.apache.tools.ant.types.selectors.DateSelector;
 69   
 import org.apache.tools.ant.types.selectors.DependSelector;
 70   
 import org.apache.tools.ant.types.selectors.DepthSelector;
 71   
 import org.apache.tools.ant.types.selectors.ExtendSelector;
 72   
 import org.apache.tools.ant.types.selectors.FileSelector;
 73   
 import org.apache.tools.ant.types.selectors.FilenameSelector;
 74   
 import org.apache.tools.ant.types.selectors.MajoritySelector;
 75   
 import org.apache.tools.ant.types.selectors.NoneSelector;
 76   
 import org.apache.tools.ant.types.selectors.NotSelector;
 77   
 import org.apache.tools.ant.types.selectors.OrSelector;
 78   
 import org.apache.tools.ant.types.selectors.PresentSelector;
 79   
 import org.apache.tools.ant.types.selectors.SelectSelector;
 80   
 import org.apache.tools.ant.types.selectors.SelectorContainer;
 81   
 import org.apache.tools.ant.types.selectors.SelectorScanner;
 82   
 import org.apache.tools.ant.types.selectors.SizeSelector;
 83   
 
 84   
 /**
 85   
  * Class that holds an implicit patternset and supports nested
 86   
  * patternsets and creates a DirectoryScanner using these patterns.
 87   
  *
 88   
  * <p>Common base class for DirSet and FileSet.</p>
 89   
  *
 90   
  * @author <a href="mailto:ajkuiper@wxs.nl">Arnout J. Kuiper</a>
 91   
  * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
 92   
  * @author <a href="mailto:rubys@us.ibm.com">Sam Ruby</a>
 93   
  * @author <a href="mailto:jon@clearink.com">Jon S. Stevens</a>
 94   
  * @author Stefan Bodewig
 95   
  * @author Magesh Umasankar
 96   
  * @author <a href="mailto:bruce@callenish.com">Bruce Atherton</a>
 97   
  */
 98   
 public abstract class AbstractFileSet extends DataType implements Cloneable,
 99   
         SelectorContainer {
 100   
 
 101   
     private PatternSet defaultPatterns = new PatternSet();
 102   
     private Vector additionalPatterns = new Vector();
 103   
     private Vector selectors = new Vector();
 104   
 
 105   
     private File dir;
 106   
     private boolean useDefaultExcludes = true;
 107   
     private boolean isCaseSensitive = true;
 108   
     private boolean followSymlinks = true;
 109   
 
 110  1610
     public AbstractFileSet() {
 111  1610
         super();
 112   
     }
 113   
 
 114  66
     protected AbstractFileSet(AbstractFileSet fileset) {
 115  66
         this.dir = fileset.dir;
 116  66
         this.defaultPatterns = fileset.defaultPatterns;
 117  66
         this.additionalPatterns = fileset.additionalPatterns;
 118  66
         this.selectors = fileset.selectors;
 119  66
         this.useDefaultExcludes = fileset.useDefaultExcludes;
 120  66
         this.isCaseSensitive = fileset.isCaseSensitive;
 121  66
         this.followSymlinks = fileset.followSymlinks;
 122  66
         setProject(fileset.getProject());
 123   
     }
 124   
 
 125   
     /**
 126   
      * Makes this instance in effect a reference to another instance.
 127   
      *
 128   
      * <p>You must not set another attribute or nest elements inside
 129   
      * this element if you make it a reference.</p>
 130   
      */
 131  24
     public void setRefid(Reference r) throws BuildException {
 132  24
         if (dir != null || defaultPatterns.hasPatterns(getProject())) {
 133  4
             throw tooManyAttributes();
 134   
         }
 135  20
         if (!additionalPatterns.isEmpty()) {
 136  2
             throw noChildrenAllowed();
 137   
         }
 138  18
         if (!selectors.isEmpty()) {
 139  0
             throw noChildrenAllowed();
 140   
         }
 141  18
         super.setRefid(r);
 142   
     }
 143   
 
 144   
     /**
 145   
      * Sets the base-directory for this instance.
 146   
      */
 147  255
     public void setDir(File dir) throws BuildException {
 148  255
         if (isReference()) {
 149  2
             throw tooManyAttributes();
 150   
         }
 151   
 
 152  253
         this.dir = dir;
 153   
     }
 154   
 
 155   
     /**
 156   
      * Retrieves the base-directory for this instance.
 157   
      */
 158  628
     public File getDir(Project p) {
 159  628
         if (isReference()) {
 160  11
             return getRef(p).getDir(p);
 161   
         }
 162  617
         return dir;
 163   
     }
 164   
 
 165   
     /**
 166   
      * Creates a nested patternset.
 167   
      */
 168  6
     public PatternSet createPatternSet() {
 169  6
         if (isReference()) {
 170  2
             throw noChildrenAllowed();
 171   
         }
 172  4
         PatternSet patterns = new PatternSet();
 173  4
         additionalPatterns.addElement(patterns);
 174  4
         return patterns;
 175   
     }
 176   
 
 177   
     /**
 178   
      * add a name entry on the include list
 179   
      */
 180  43
     public PatternSet.NameEntry createInclude() {
 181  43
         if (isReference()) {
 182  2
             throw noChildrenAllowed();
 183   
         }
 184  41
         return defaultPatterns.createInclude();
 185   
     }
 186   
 
 187   
     /**
 188   
      * add a name entry on the include files list
 189   
      */
 190  2
     public PatternSet.NameEntry createIncludesFile() {
 191  2
         if (isReference()) {
 192  2
             throw noChildrenAllowed();
 193   
         }
 194  0
         return defaultPatterns.createIncludesFile();
 195   
     }
 196   
 
 197   
     /**
 198   
      * add a name entry on the exclude list
 199   
      */
 200  108
     public PatternSet.NameEntry createExclude() {
 201  108
         if (isReference()) {
 202  2
             throw noChildrenAllowed();
 203   
         }
 204  106
         return defaultPatterns.createExclude();
 205   
     }
 206   
 
 207   
     /**
 208   
      * add a name entry on the include files list
 209   
      */
 210  2
     public PatternSet.NameEntry createExcludesFile() {
 211  2
         if (isReference()) {
 212  2
             throw noChildrenAllowed();
 213   
         }
 214  0
         return defaultPatterns.createExcludesFile();
 215   
     }
 216   
 
 217   
     /**
 218   
      * Creates a single file fileset.
 219   
      */
 220  1
     public void setFile(File file) {
 221  1
         if (isReference()) {
 222  0
             throw tooManyAttributes();
 223   
         }
 224  1
         FileUtils fileUtils = FileUtils.newFileUtils();
 225  1
         setDir(fileUtils.getParentFile(file));
 226   
 
 227  1
         PatternSet.NameEntry include = createInclude();
 228  1
         include.setName(file.getName());
 229   
     }
 230   
 
 231   
     /**
 232   
      * Appends <code>includes</code> to the current list of include
 233   
      * patterns.
 234   
      *
 235   
      * <p>Patterns may be separated by a comma or a space.</p>
 236   
      *
 237   
      * @param includes the string containing the include patterns
 238   
      */
 239  134
     public void setIncludes(String includes) {
 240  134
         if (isReference()) {
 241  2
             throw tooManyAttributes();
 242   
         }
 243   
 
 244  132
         defaultPatterns.setIncludes(includes);
 245   
     }
 246   
 
 247   
     /**
 248   
      * Appends <code>excludes</code> to the current list of exclude
 249   
      * patterns.
 250   
      *
 251   
      * <p>Patterns may be separated by a comma or a space.</p>
 252   
      *
 253   
      * @param excludes the string containing the exclude patterns
 254   
      */
 255  7
     public void setExcludes(String excludes) {
 256  7
         if (isReference()) {
 257  2
             throw tooManyAttributes();
 258   
         }
 259   
 
 260  5
         defaultPatterns.setExcludes(excludes);
 261   
     }
 262   
 
 263   
     /**
 264   
      * Sets the name of the file containing the includes patterns.
 265   
      *
 266   
      * @param incl The file to fetch the include patterns from.
 267   
      */
 268  2
      public void setIncludesfile(File incl) throws BuildException {
 269  2
          if (isReference()) {
 270  2
              throw tooManyAttributes();
 271   
          }
 272   
 
 273  0
          defaultPatterns.setIncludesfile(incl);
 274   
      }
 275   
 
 276   
     /**
 277   
      * Sets the name of the file containing the includes patterns.
 278   
      *
 279   
      * @param excl The file to fetch the exclude patterns from.
 280   
      */
 281  2
      public void setExcludesfile(File excl) throws BuildException {
 282  2
          if (isReference()) {
 283  2
              throw tooManyAttributes();
 284   
          }
 285   
 
 286  0
          defaultPatterns.setExcludesfile(excl);
 287   
      }
 288   
 
 289   
     /**
 290   
      * Sets whether default exclusions should be used or not.
 291   
      *
 292   
      * @param useDefaultExcludes "true"|"on"|"yes" when default exclusions
 293   
      *                           should be used, "false"|"off"|"no" when they
 294   
      *                           shouldn't be used.
 295   
      */
 296  66
     public void setDefaultexcludes(boolean useDefaultExcludes) {
 297  66
         if (isReference()) {
 298  0
             throw tooManyAttributes();
 299   
         }
 300   
 
 301  66
         this.useDefaultExcludes = useDefaultExcludes;
 302   
     }
 303   
 
 304   
     /**
 305   
      * Sets case sensitivity of the file system
 306   
      *
 307   
      * @param isCaseSensitive "true"|"on"|"yes" if file system is case
 308   
      *                           sensitive, "false"|"off"|"no" when not.
 309   
      */
 310  0
     public void setCaseSensitive(boolean isCaseSensitive) {
 311  0
         if (isReference()) {
 312  0
             throw tooManyAttributes();
 313   
         }
 314  0
         this.isCaseSensitive = isCaseSensitive;
 315   
     }
 316   
 
 317   
     /**
 318   
      * Sets whether or not symbolic links should be followed.
 319   
      *
 320   
      * @param followSymlinks whether or not symbolic links should be followed
 321   
      */
 322  0
     public void setFollowSymlinks(boolean followSymlinks) {
 323  0
         if (isReference()) {
 324  0
             throw tooManyAttributes();
 325   
         }
 326  0
         this.followSymlinks = followSymlinks;
 327   
     }
 328   
 
 329   
     /**
 330   
      * sets the name used for this datatype instance.
 331   
      */
 332  415
     protected String getDataTypeName() {
 333   
         // look up the types in project and see if they match this class
 334  415
         Project project = getProject();
 335  415
         if (project != null) {
 336  391
             Hashtable typedefs = project.getDataTypeDefinitions();
 337  391
             for (Enumeration e = typedefs.keys(); e.hasMoreElements();) {
 338  2648
                 String typeName = (String) e.nextElement();
 339  2648
                 Class typeClass = (Class) typedefs.get(typeName);
 340  2648
                 if (typeClass == getClass()) {
 341  361
                     return typeName;
 342   
                 }
 343   
             }
 344   
         }
 345   
 
 346  54
         String classname = getClass().getName();
 347   
 
 348  54
         int dotIndex = classname.lastIndexOf(".");
 349  54
         if (dotIndex == -1) {
 350  0
             return classname;
 351   
         }
 352  54
         return classname.substring(dotIndex + 1);
 353   
     }
 354   
 
 355   
     /**
 356   
      * Returns the directory scanner needed to access the files to process.
 357   
      */
 358  404
     public DirectoryScanner getDirectoryScanner(Project p) {
 359  404
         if (isReference()) {
 360  5
             return getRef(p).getDirectoryScanner(p);
 361   
         }
 362   
 
 363  399
         if (dir == null) {
 364  16
             throw new BuildException("No directory specified for "
 365   
                                      + getDataTypeName() + ".");
 366   
         }
 367   
 
 368  383
         if (!dir.exists()) {
 369  2
             throw new BuildException(dir.getAbsolutePath() + " not found.");
 370   
         }
 371  381
         if (!dir.isDirectory()) {
 372  0
             throw new BuildException(dir.getAbsolutePath()
 373   
                                      + " is not a directory.");
 374   
         }
 375   
 
 376  381
         DirectoryScanner ds = new DirectoryScanner();
 377  381
         setupDirectoryScanner(ds, p);
 378  381
         ds.setFollowSymlinks(followSymlinks);
 379  381
         ds.scan();
 380  381
         return ds;
 381   
     }
 382   
 
 383  397
     public void setupDirectoryScanner(FileScanner ds, Project p) {
 384  397
         if (isReference()) {
 385  0
             getRef(p).setupDirectoryScanner(ds, p);
 386  0
             return;
 387   
         }
 388   
 
 389  397
         if (ds == null) {
 390  0
             throw new IllegalArgumentException("ds cannot be null");
 391   
         }
 392   
 
 393  397
         ds.setBasedir(dir);
 394   
 
 395  397
         final int count = additionalPatterns.size();
 396  397
         for (int i = 0; i < count; i++) {
 397  2
             Object o = additionalPatterns.elementAt(i);
 398  2
             defaultPatterns.append((PatternSet) o, p);
 399   
         }
 400   
 
 401  397
         p.log(getDataTypeName() + ": Setup scanner in dir " + dir +
 402   
             " with " + defaultPatterns, Project.MSG_DEBUG);
 403   
 
 404  397
         ds.setIncludes(defaultPatterns.getIncludePatterns(p));
 405  397
         ds.setExcludes(defaultPatterns.getExcludePatterns(p));
 406  397
         if (ds instanceof SelectorScanner) {
 407  397
             SelectorScanner ss = (SelectorScanner)ds;
 408  397
             ss.setSelectors(getSelectors(p));
 409   
         }
 410   
 
 411  397
         if (useDefaultExcludes) {
 412  397
             ds.addDefaultExcludes();
 413   
         }
 414  397
         ds.setCaseSensitive(isCaseSensitive);
 415   
     }
 416   
 
 417   
     /**
 418   
      * Performs the check for circular references and returns the
 419   
      * referenced FileSet.
 420   
      */
 421  16
     protected AbstractFileSet getRef(Project p) {
 422  16
         if (!isChecked()) {
 423  13
             Stack stk = new Stack();
 424  13
             stk.push(this);
 425  13
             dieOnCircularReference(stk, p);
 426   
         }
 427   
 
 428  8
         Object o = getRefid().getReferencedObject(p);
 429  8
         if (!getClass().isAssignableFrom(o.getClass())) {
 430  2
             String msg = getRefid().getRefId() + " doesn\'t denote a "
 431   
                 + getDataTypeName();
 432  2
             throw new BuildException(msg);
 433   
         } else {
 434  6
             return (AbstractFileSet) o;
 435   
         }
 436   
     }
 437   
 
 438   
     // SelectorContainer methods
 439   
 
 440   
     /**
 441   
      * Indicates whether there are any selectors here.
 442   
      *
 443   
      * @return whether any selectors are in this container
 444   
      */
 445  0
     public boolean hasSelectors() {
 446  0
         if (isReference() && getProject() != null) {
 447  0
             return getRef(getProject()).hasSelectors();
 448   
         }
 449  0
         return !(selectors.isEmpty());
 450   
     }
 451   
 
 452   
     /**
 453   
      * Indicates whether there are any patterns here.
 454   
      *
 455   
      * @return whether any patterns are in this container
 456   
      */
 457  0
     public boolean hasPatterns() {
 458  0
         if (isReference() && getProject() != null) {
 459  0
             return getRef(getProject()).hasPatterns();
 460   
         }
 461   
 
 462  0
         if (defaultPatterns.hasPatterns(getProject())) {
 463  0
             return true;
 464   
         }
 465   
 
 466  0
         Enumeration enum = additionalPatterns.elements();
 467  0
         while (enum.hasMoreElements()) {
 468  0
             PatternSet ps = (PatternSet) enum.nextElement();
 469  0
             if (ps.hasPatterns(getProject())) {
 470  0
                 return true;
 471   
             }
 472   
         }
 473   
 
 474  0
         return false;
 475   
     }
 476   
 
 477   
     /**
 478   
      * Gives the count of the number of selectors in this container
 479   
      *
 480   
      * @return the number of selectors in this container
 481   
      */
 482  0
     public int selectorCount() {
 483  0
         if (isReference() && getProject() != null) {
 484  0
             return getRef(getProject()).selectorCount();
 485   
         }
 486  0
         return selectors.size();
 487   
     }
 488   
 
 489   
     /**
 490   
      * Returns the set of selectors as an array.
 491   
      *
 492   
      * @return an array of selectors in this container
 493   
      */
 494  397
     public FileSelector[] getSelectors(Project p) {
 495  397
         if (isReference()) {
 496  0
             return getRef(p).getSelectors(p);
 497   
         } else {
 498  397
             FileSelector[] result = new FileSelector[selectors.size()];
 499  397
             selectors.copyInto(result);
 500  397
             return result;
 501   
         }
 502   
     }
 503   
 
 504   
     /**
 505   
      * Returns an enumerator for accessing the set of selectors.
 506   
      *
 507   
      * @return an enumerator that goes through each of the selectors
 508   
      */
 509  0
     public Enumeration selectorElements() {
 510  0
         if (isReference() && getProject() != null) {
 511  0
             return getRef(getProject()).selectorElements();
 512   
         }
 513  0
         return selectors.elements();
 514   
     }
 515   
 
 516   
     /**
 517   
      * Add a new selector into this container.
 518   
      *
 519   
      * @param selector the new selector to add
 520   
      */
 521  3
     public void appendSelector(FileSelector selector) {
 522  3
         if (isReference()) {
 523  0
             throw noChildrenAllowed();
 524   
         }
 525  3
         selectors.addElement(selector);
 526   
     }
 527   
 
 528   
     /* Methods below all add specific selectors */
 529   
 
 530   
     /**
 531   
      * add a "Select" selector entry on the selector list
 532   
      */
 533  3
     public void addSelector(SelectSelector selector) {
 534  3
         appendSelector(selector);
 535   
     }
 536   
 
 537   
     /**
 538   
      * add an "And" selector entry on the selector list
 539   
      */
 540  0
     public void addAnd(AndSelector selector) {
 541  0
         appendSelector(selector);
 542   
     }
 543   
 
 544   
     /**
 545   
      * add an "Or" selector entry on the selector list
 546   
      */
 547  0
     public void addOr(OrSelector selector) {
 548  0
         appendSelector(selector);
 549   
     }
 550   
 
 551   
     /**
 552   
      * add a "Not" selector entry on the selector list
 553   
      */
 554  0
     public void addNot(NotSelector selector) {
 555  0
         appendSelector(selector);
 556   
     }
 557   
 
 558   
     /**
 559   
      * add a "None" selector entry on the selector list
 560   
      */
 561  0
     public void addNone(NoneSelector selector) {
 562  0
         appendSelector(selector);
 563   
     }
 564   
 
 565   
     /**
 566   
      * add a majority selector entry on the selector list
 567   
      */
 568  0
     public void addMajority(MajoritySelector selector) {
 569  0
         appendSelector(selector);
 570   
     }
 571   
 
 572   
     /**
 573   
      * add a selector date entry on the selector list
 574   
      */
 575  0
     public void addDate(DateSelector selector) {
 576  0
         appendSelector(selector);
 577   
     }
 578   
 
 579   
     /**
 580   
      * add a selector size entry on the selector list
 581   
      */
 582  0
     public void addSize(SizeSelector selector) {
 583  0
         appendSelector(selector);
 584   
     }
 585   
 
 586   
     /**
 587   
      * add a selector filename entry on the selector list
 588   
      */
 589  0
     public void addFilename(FilenameSelector selector) {
 590  0
         appendSelector(selector);
 591   
     }
 592   
 
 593   
     /**
 594   
      * add an extended selector entry on the selector list
 595   
      */
 596  0
     public void addCustom(ExtendSelector selector) {
 597  0
         appendSelector(selector);
 598   
     }
 599   
 
 600   
     /**
 601   
      * add a contains selector entry on the selector list
 602   
      */
 603  0
     public void addContains(ContainsSelector selector) {
 604  0
         appendSelector(selector);
 605   
     }
 606   
 
 607   
     /**
 608   
      * add a present selector entry on the selector list
 609   
      */
 610  0
     public void addPresent(PresentSelector selector) {
 611  0
         appendSelector(selector);
 612   
     }
 613   
 
 614   
     /**
 615   
      * add a depth selector entry on the selector list
 616   
      */
 617  0
     public void addDepth(DepthSelector selector) {
 618  0
         appendSelector(selector);
 619   
     }
 620   
 
 621   
     /**
 622   
      * add a depends selector entry on the selector list
 623   
      */
 624  0
     public void addDepend(DependSelector selector) {
 625  0
         appendSelector(selector);
 626   
     }
 627   
 
 628   
     /**
 629   
      * Returns included files as a list of semicolon-separated filenames
 630   
      *
 631   
      * @return String object with included filenames
 632   
      */
 633  28
     public String toString() {
 634  28
         DirectoryScanner ds = getDirectoryScanner(getProject());
 635  12
         String[] files = ds.getIncludedFiles();
 636  12
         StringBuffer sb = new StringBuffer();
 637   
 
 638  12
         for (int i = 0; i < files.length; i++) {
 639  22
             if (i>0) {
 640  13
                 sb.append(';');
 641   
             }
 642  22
             sb.append(files[i]);
 643   
         }
 644  12
         return sb.toString();
 645   
     }
 646   
 
 647   
 }
 648