Examples of FileSet


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

          +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

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

    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

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

      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

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

        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

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

    {
        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

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

    File result = new File(filename);
    Zip zip = new Zip();
    zip.setProject(getProject());
    zip.setDestFile(result);
    zip.setTaskName(getTaskName() + " - zip");
    FileSet fileset = new FileSet();
    fileset.setDir(dir);
    zip.addFileset(fileset);
    zip.execute();
    Delete delete = new Delete();
    delete.setProject(getProject());
    delete.setTaskName(getTaskName() + " - delete");
View Full Code Here

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

      if (!LangUtil.isEmpty(paths)) {
        Copy copy = new Copy();
        copy.setProject(project);
        copy.setTodir(destDir);
        for (int i = 0; i < paths.length; i++) {
          FileSet fileSet = new FileSet();
          fileSet.setDir(new File(paths[i]));
          fileSet.setIncludes("**/*");
          fileSet.setExcludes(sourceRootCopyFilter);
          copy.addFileset(fileSet);
        }
        copy.execute();
      }
    }
    if ((null != inpathDirCopyFilter) && (null != inpath)) {
      String[] paths = inpath.list();
      if (!LangUtil.isEmpty(paths)) {
        Copy copy = new Copy();
        copy.setProject(project);
        copy.setTodir(destDir);
        boolean gotDir = false;
        for (int i = 0; i < paths.length; i++) {
          File inpathDir = new File(paths[i]);
          if (inpathDir.isDirectory() && inpathDir.canRead()) {
            if (!gotDir) {
              gotDir = true;
            }
            FileSet fileSet = new FileSet();
            fileSet.setDir(inpathDir);
            fileSet.setIncludes("**/*");
            fileSet.setExcludes(inpathDirCopyFilter);
            copy.addFileset(fileSet);
          }
        }
        if (gotDir) {
          copy.execute();
View Full Code Here

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

    if ((null != sourceRootCopyFilter) && (null != sourceRoots)) {
      String[] paths = sourceRoots.list();
      if (!LangUtil.isEmpty(paths)) {
        for (int i = 0; i < paths.length; i++) {
          File srcRoot = new File(paths[i]);
          FileSet fileset = new FileSet();
          fileset.setProject(project);
          fileset.setDir(srcRoot);
          fileset.setIncludes("**/*");
          fileset.setExcludes(sourceRootCopyFilter);
          zip.addFileset(fileset);
        }
      }
    }
    if ((null != inpathDirCopyFilter) && (null != inpath)) {
      String[] paths = inpath.list();
      if (!LangUtil.isEmpty(paths)) {
        for (int i = 0; i < paths.length; i++) {
          File inpathDir = new File(paths[i]);
          if (inpathDir.isDirectory() && inpathDir.canRead()) {
            FileSet fileset = new FileSet();
            fileset.setProject(project);
            fileset.setDir(inpathDir);
            fileset.setIncludes("**/*");
            fileset.setExcludes(inpathDirCopyFilter);
            zip.addFileset(fileset);
          }
        }
      }
    }
 
View Full Code Here

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

      if(sourcefiles == null)
        sourcefiles = new ArrayList();
     
        Enumeration e = fileSets.elements();
        while (e.hasMoreElements()) {
            FileSet fs = (FileSet) e.nextElement();
            if (!fs.hasPatterns() && !fs.hasSelectors()) {
                fs = (FileSet) fs.clone();
                fs.createInclude().setName("**/*.java");
                fs.createInclude().setName("**/*.aj");
            }
            File baseDir = fs.getDir(getProject());
            DirectoryScanner ds = fs.getDirectoryScanner(getProject());
            String[] files = ds.getIncludedFiles();
            for (int i = 0; i < files.length; i++) {
              sourcefiles.add((new File(baseDir, files[i])).getAbsolutePath());
            }
        }
View Full Code Here

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

    @Override
    public void setUp() throws Exception {
        Project project = new Project();

        IndexTask task = new IndexTask();
        FileSet fs = new FileSet();
        fs.setProject(project);
        fs.setDir(new File(docsDir));
        task.addFileset(fs);
        task.setOverwrite(true);
        task.setDocumentHandler(docHandler);
        task.setIndex(indexDir);
        task.setProject(project);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.