Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.FileSet


   */
  private List<String> getClassesFromFileSets(List<FileSet> filesets) {
    List<String> class_files = new ArrayList<String>();

    for (Iterator<FileSet> iterator = filesets.iterator(); iterator.hasNext();) {
      FileSet fileset = iterator.next();
      DirectoryScanner ds = fileset.getDirectoryScanner(getProject());

      for (String file : ds.getIncludedFiles()) {
        class_files.add(file);
      }
    }
View Full Code Here


   * @param  reference the reference to convert
   *
   * @return the reference's fileset
   */
  private FileSet createFileSet(Reference reference) {
    FileSet fs = new FileSet();
    fs.setRefid(reference);
    fs.setProject(getProject());

    return fs;
  }
View Full Code Here

            final String path = url.getPath();
            final File dir = new File(path.replace('/', File.separatorChar));
            log("Adding file set with dir '" + dir
                + "' for bundlePath file URL with path '" + path + "'.",
                Project.MSG_VERBOSE);
            FileSet fs = new FileSet();
            fs.setDir(dir);
            fs.setIncludes("**/*.jar");
            fs.setProject(getProject());
            filesets.add(fs);
          }
        } catch (MalformedURLException e) {
          throw new BuildException("Invalid URL, '" + urls[i]
                                   + "' found in bundlePath: '"
View Full Code Here

    log("loading bundle info...", Project.MSG_VERBOSE);

    try {
      for (int i = 0; i < filesets.size(); i++) {
        FileSet          fs      = (FileSet) filesets.elementAt(i);
        DirectoryScanner ds      = fs.getDirectoryScanner(getProject());
        File             projDir = fs.getDir(getProject());

        String[] srcFiles = ds.getIncludedFiles();

        for (int j = 0; j < srcFiles.length ; j++) {
          File file = new File(projDir, srcFiles[j]);
View Full Code Here

      if (entry.startsWith("/")) {
        // Entry is a relative path, must not start with a '/', fix it.
        entry = entry.substring(1);
      }

      FileSet fileSet = null;
      File src= new File(dir, entry);

      // Bundle class path entries are either directories or jar/zip-files!
      if (src.isDirectory()) {
        fileSet = new FileSet();
        fileSet.setDir(src);
        fileSet.setProject(getProject());
      } else if (src.exists()) {
        fileSet = new ZipFileSet();
        ((ZipFileSet) fileSet).setSrc(src);
      } else {
        final StringBuffer msg = new StringBuffer();
        msg.append("The following entry in the Bundle-ClassPath")
          .append(" header doesn't exist in the bundle: ")
          .append(entry)
          .append(".");
        if (failOnClassPath) {
          log(msg.toString(), Project.MSG_ERR);
          throw new BuildException(msg.toString(), getLocation());
        } else {
          log(msg.toString(), Project.MSG_WARN);
          continue;
        }
      }

      fileSet.setProject(proj);
      if (null!=includes) {
        fileSet.setIncludes(includes);
      }
      if (null!=excludes) {
        fileSet.setExcludes(excludes);
      }
      res.add(fileSet);
      log("Added FileSet with root '" +src +"', includes: '" +includes
          +"', excludes: '" +excludes +"'.", Project.MSG_DEBUG);
    }
View Full Code Here

          +sb.toString() +"\"",
          Project.MSG_VERBOSE);
    }

    if (null!=filesetId) {
      final FileSet fileSet = new FileSet();
      fileSet.setProject(proj);
      if (dir.exists()) {
        fileSet.setDir(dir);
        fileSet.setIncludes(sb.toString());
      } else {
        log("Bundle class path root dir '" +dir
            +"' does not exist, returning empty file set.",
            Project.MSG_DEBUG);
        fileSet.setDir(new File("."));
        fileSet.setExcludes("**/*");
      }
      proj.addReference(filesetId, fileSet);
      log("Converted bundle class path \"" +bundleClasspath
          +"\" to file set with id '" +filesetId
          +"' and files \"" +fileSet +"\"",
View Full Code Here

    System.out.println("loading bundle info...");

    try {
      for (int i = 0; i < filesets.size(); i++) {
        FileSet          fs      = (FileSet) filesets.elementAt(i);
        DirectoryScanner ds      = fs.getDirectoryScanner(getProject());
        File             projDir = fs.getDir(getProject());

        String[] srcFiles = ds.getIncludedFiles();

        for (int j = 0; j < srcFiles.length ; j++) {
          File file = new File(projDir, srcFiles[j]);
View Full Code Here

      for (Iterator it = resourceCollections.iterator(); it.hasNext();) {
        final ResourceCollection rc = (ResourceCollection) it.next();

        // Ignore file sets with a non existing root dir.
        if (rc instanceof FileSet) {
          final FileSet fs = (FileSet) rc;
          final File fsRootDir = fs.getDir(task.getProject());
          if (!fsRootDir.exists()) {
            task.log("Skipping nested file set rooted at '" + fsRootDir
                + "' since that directory does not exist.", Project.MSG_WARN);
            continue;
          }
          try {
            if (fs.size()<1) {
              task.log("Skipping nested file set rooted at '" + fsRootDir
                  + "' since that file set is empty.", Project.MSG_VERBOSE);
              continue;
             
            }
View Full Code Here

        List<File> v = new ArrayList<File>();

        Iterator<FileSet> filesetIter = filesets.iterator();
        while (filesetIter.hasNext())
        {
            FileSet fs = filesetIter.next();
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            ds.scan();
            String[] f = ds.getIncludedFiles();
            for (int j = 0; j < f.length; j++)
            {
                String pathname = f[j];
View Full Code Here

    {
        log( "PDFToTextTask executing" );
        Iterator fileSetIter = fileSets.iterator();
        while( fileSetIter.hasNext() )
        {
            FileSet next = (FileSet)fileSetIter.next();
            DirectoryScanner dirScanner = next.getDirectoryScanner( getProject() );
            dirScanner.scan();
            String[] files = dirScanner.getIncludedFiles();
            for( int i=0; i<files.length; i++ )
            {
                File f = new File( dirScanner.getBasedir(), files[i] );
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.FileSet

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.