Package org.apache.tools.ant

Examples of org.apache.tools.ant.DirectoryScanner


    List files = new LinkedList();
    for ( Iterator i = fileSets.iterator(); i.hasNext(); ) {

      FileSet fs = (FileSet) i.next();
      DirectoryScanner ds = fs.getDirectoryScanner( getProject() );

      String[] dsFiles = ds.getIncludedFiles();
      for (int j = 0; j < dsFiles.length; j++) {
        File f = new File(dsFiles[j]);
        if ( !f.isFile() ) {
          f = new File( ds.getBasedir(), dsFiles[j] );
        }

        files.add( f.getAbsolutePath() );
      }
    }
View Full Code Here


    List files = new LinkedList();
    for ( Iterator i = fileSets.iterator(); i.hasNext(); ) {

      FileSet fs = (FileSet) i.next();
      DirectoryScanner ds = fs.getDirectoryScanner( getProject() );

      String[] dsFiles = ds.getIncludedFiles();
      for (int j = 0; j < dsFiles.length; j++) {
        File f = new File(dsFiles[j]);
        if ( !f.isFile() ) {
          f = new File( ds.getBasedir(), dsFiles[j] );
        }

        files.add( f.getAbsolutePath() );
      }
    }
View Full Code Here

    List files = new LinkedList();
    for ( Iterator i = fileSets.iterator(); i.hasNext(); ) {

      FileSet fs = (FileSet) i.next();
      DirectoryScanner ds = fs.getDirectoryScanner( getProject() );

      String[] dsFiles = ds.getIncludedFiles();
      for (int j = 0; j < dsFiles.length; j++) {
        File f = new File(dsFiles[j]);
        if ( !f.isFile() ) {
          f = new File( ds.getBasedir(), dsFiles[j] );
        }

        files.add( f.getAbsolutePath() );
      }
    }
View Full Code Here

   }
  
   private void uploadFileSet(FileSet fileSet)
      throws IOException
   {
      DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
      String basedir = scanner.getBasedir().getAbsolutePath();

      // assert that all required collections does exist
      for(Iterator i = determineRequiredDirectories(scanner); i.hasNext();) {
         String dir = (String)i.next();
         if (dir.equals("")) {
            Utils.assureExistingCollection(getHttpClient(),
                                           getUrl(),
                                           this.locktoken);
         } else {
            HttpURL collURL = Utils.createHttpURL(getUrl(), dir + "/");
            Utils.assureExistingCollection(getHttpClient(),
                                           collURL,
                                           this.locktoken);
         }
      }           
     
      // write all files
      String[] files = scanner.getIncludedFiles();
      for (int i = 0; i < files.length; ++i) {
         File file = getProject().resolveFile(basedir + File.separator + files[i]);
         uploadFile(asDavPath(files[i]), file);
      }
   }
View Full Code Here

   }
  
   private void uploadZipFileSet(ZipFileSet fileSet)
      throws IOException
   {
      DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
     
      ZipFile zipFile = new ZipFile(fileSet.getSrc());
  
      // assert that all required collections does exist
      for(Iterator i = determineRequiredDirectories(scanner); i.hasNext();) {
         String dir = (String)i.next();
         if (dir.equals("")) {
            Utils.assureExistingCollection(getHttpClient(),
                                           getUrl(),
                                           this.locktoken);
         } else {
            HttpURL collURL = Utils.createHttpURL(getUrl(), dir + "/");
            Utils.assureExistingCollection(getHttpClient(),
                                           collURL,
                                           this.locktoken);
         }
      }           
     
      // write all files
      String[] files = scanner.getIncludedFiles();
      for (int i = 0; i < files.length; ++i) {
         uploadZipEntry(Utils.createHttpURL(getUrl(), files[i]), files[i], zipFile);
      }
   }
View Full Code Here

     * Builds a list of all files to be analysed. We need to do this when
     * testing thresholds as the Javancss object does not have a constructor
     * that lets us make use of the -recursive option
     */
    private Vector findFilesToAnalyse() {
        DirectoryScanner ds = super.getDirectoryScanner(srcdir);
        String files[] = ds.getIncludedFiles();
        if (files.length == 0) {
            log("No files in specified directory " + srcdir, 3);
        }
        return copyFiles(files);
    }
View Full Code Here

   *
   * @return
   */
  private String[] getFileList() {
    // scan source directory for rule files
    DirectoryScanner directoryScanner = getDirectoryScanner(srcdir);
    String[] fileNames = directoryScanner.getIncludedFiles();

    if (fileNames == null || fileNames.length <= 0) {
      throw new BuildException(
          "No rule files found in include directory.");
    }
View Full Code Here

   *
   * @return
   */
  private String[] getFileList() {
    // scan source directory for rule files
    DirectoryScanner directoryScanner = getDirectoryScanner(srcdir);
    String[] fileNames = directoryScanner.getIncludedFiles();

    if (fileNames == null || fileNames.length <= 0) {
      throw new BuildException(
          "No rule files found in include directory.");
    }
View Full Code Here

    HashSet files = new HashSet();
    Project project = getProject();
    Iterator filesets = filesets();
    while ( filesets.hasNext() ) {
      FileSet fs = ( FileSet ) filesets.next();
      DirectoryScanner ds = fs.getDirectoryScanner( project );
      String[] includedFiles = ds.getIncludedFiles();
      File d = fs.getDir( project );
      for ( int i = 0; i < includedFiles.length; ++i ) {
        files.add( new File( d, includedFiles[i] ) );
      }
    }
View Full Code Here

    List files = new LinkedList();
    for ( Iterator i = fileSets.iterator(); i.hasNext(); ) {

      FileSet fs = (FileSet) i.next();
      DirectoryScanner ds = fs.getDirectoryScanner( getProject() );

      String[] dsFiles = ds.getIncludedFiles();
      for (int j = 0; j < dsFiles.length; j++) {
        File f = new File(dsFiles[j]);
        if ( !f.isFile() ) {
          f = new File( ds.getBasedir(), dsFiles[j] );
        }

        files.add( f.getAbsolutePath() );
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.DirectoryScanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.