Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.FileList$FileName


                    fileNames.removeAllElements();
                    baseDirs.removeAllElements();
                }
            }
            for (int i = 0; i < filelists.size(); i++) {
                FileList list = (FileList) filelists.elementAt(i);
                File base = list.getDir(getProject());
                String[] names = getFilesAndDirs(list);

                for (int j = 0; j < names.length; j++) {
                    File f = new File(base, names[j]);
                    if ((!ignoreMissing) || (f.isFile() && !"dir".equals(type))
                        || (f.isDirectory() && !"file".equals(type))) {

                        if (ignoreMissing || f.isFile()) {
                            totalFiles++;
                        } else {
                            totalDirs++;
                        }
                        fileNames.addElement(names[j]);
                        baseDirs.addElement(base);
                    }
                }
                if (fileNames.size() == 0 && skipEmpty) {
                    DirectoryScanner ds = new DirectoryScanner();
                    ds.setBasedir(base);
                    ds.setIncludes(list.getFiles(getProject()));
                    ds.scan();
                    int includedCount
                        = ds.getIncludedFilesCount() + ds.getIncludedDirsCount();

                    log("Skipping filelist for directory " + base + ". It is "
View Full Code Here


        File additionalMaps[] = new File[1];
        additionalMaps[0] = new File(destDir, "testmap.map.xml");
        ResourceUtil.copyResourceToFile("testmap.map.xml", additionalMaps[0]);

        FileList additionalMapsFilelist = new FileList();
        additionalMapsFilelist.setDir(additionalMaps[0].getParentFile());
        additionalMapsFilelist.setFiles(additionalMaps[0].getName());

        Path additionalMapsPath = new Path(task.getProject());
        additionalMapsPath.addFilelist(additionalMapsFilelist);

        // setup task
View Full Code Here

        File additionalMaps[] = new File[1];
        additionalMaps[0] = new File(destDir, "testmap.map.xml");
        ResourceUtil.copyResourceToFile("testmap.map.xml", additionalMaps[0]);

        FileList additionalMapsFilelist = new FileList();
        additionalMapsFilelist.setDir(additionalMaps[0].getParentFile());
        additionalMapsFilelist.setFiles(additionalMaps[0].getName());

        Path additionalMapsPath = new Path(task.getProject());
        additionalMapsPath.addFilelist(additionalMapsFilelist);

        // setup task
View Full Code Here

  private long getLastModifiedTime(List<?> fileLists) {
    long lastModified = 0;

    for (Object entry : fileLists) {
      if (entry instanceof FileList) {
        FileList list = (FileList) entry;

        for (String fileName : list.getFiles(this.getProject())) {
          File path = list.getDir(this.getProject());
          File file = new File(path, fileName);
          lastModified = Math.max(getLastModifiedTime(file), lastModified);
        }
      } else if (entry instanceof Path) {
        Path path = (Path) entry;
View Full Code Here

                } else if (obj instanceof DirSet) {
                    DirSet ds = (DirSet) obj;

                    path.addDirset(ds);
                } else if (obj instanceof FileList) {
                    FileList fl = (FileList) obj;

                    path.addFilelist(fl);

                } else {
                    throw new BuildException("'refid' does not refer to a "
View Full Code Here

            sNameArray = fset.getDirectoryScanner(getProject()).getIncludedFiles();
            dir = fset.getDir();
         }
         else if (rc instanceof FileList)
         {
            FileList flist = (FileList)rc;
            sNameArray = flist.getFiles(getProject());
            dir = flist.getDir(getProject());
         }
         else if (rc instanceof DirSet)
         {
            DirSet dset = (DirSet)rc;
            dir = dset.getDir(getProject());
View Full Code Here

   * Create child element for list of config files.
   * Task Can have only one such child
   * @return
   */
  public FileList createConfigs() {
    this._configs = new FileList();
    return _configs;
  }
View Full Code Here

        additionalMaps[0] = new File(destDir, "cgen.map.xml");
        ResourceUtil.copyResourceToFile(
                "org/apache/cayenne/tools/cgen.map.xml",
                additionalMaps[0]);

        FileList additionalMapsFilelist = new FileList();
        additionalMapsFilelist.setDir(additionalMaps[0].getParentFile());
        additionalMapsFilelist.setFiles(additionalMaps[0].getName());

        Path additionalMapsPath = new Path(task.getProject());
        additionalMapsPath.addFilelist(additionalMapsFilelist);

        // setup task
View Full Code Here

        }

        Map<FileSet, ResourceCollection> fsList = new LinkedHashMap<FileSet, ResourceCollection>();
        for (ResourceCollection rc : rcs) {
          if (rc instanceof FileList && rc.isFilesystemOnly()) {
            FileList fl = (FileList)rc;

            FileSet fs = new FileSet();
            fs.setDir(fl.getDir(getProject()));
             fs.appendIncludes(fl.getFiles(getProject()));
            fsList.put(fs, rc);
          } else if (rc instanceof FileSet && rc.isFilesystemOnly()) {
            fsList.put((FileSet)rc, rc);
          } else {
            throw new BuildException("Only FileSystem resources are supported.");
View Full Code Here

  }

  private void processJarFileLists() throws BuildException {

    for (Iterator jarIter = mJarFileLists.iterator(); jarIter.hasNext();) {
      FileList fl = (FileList) jarIter.next();
      Project p = fl.getProject();
      File srcDir = fl.getDir(p);
      String[] files = fl.getFiles(p);

      try {

        for (int i = 0; i < files.length; i++) {
          String fileName = files[i];
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.FileList$FileName

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.