コード例 #1
0
 /** returns a reference to the dirscanner object belonging to this fileset
  * @param Project $p
  * @throws BuildException
  * @throws Exception
  * @return \DirectoryScanner
  */
 public function getDirectoryScanner(Project $p)
 {
     if ($this->isReference()) {
         $o = $this->getRef($p);
         return $o->getDirectoryScanner($p);
     }
     if ($this->dir === null) {
         throw new BuildException("No directory specified for fileset.");
     }
     if (!$this->dir->exists()) {
         throw new BuildException("Directory " . $this->dir->getAbsolutePath() . " not found.");
     }
     if (!$this->dir->isLink() || !$this->expandSymbolicLinks) {
         if (!$this->dir->isDirectory()) {
             throw new BuildException($this->dir->getAbsolutePath() . " is not a directory.");
         }
     }
     $ds = new DirectoryScanner();
     $ds->setExpandSymbolicLinks($this->expandSymbolicLinks);
     $this->setupDirectoryScanner($ds, $p);
     $ds->scan();
     return $ds;
 }