Package org.apache.tools.ant

Examples of org.apache.tools.ant.FileScanner


    for (Iterator execIter = fileSets.iterator(); execIter.hasNext();) {
      FileSet fs = (FileSet) execIter.next();
      Project p = fs.getProject();
      File srcDir = fs.getDir(p);
      FileScanner ds = fs.getDirectoryScanner(p);
      fs.setupDirectoryScanner(ds, p);
      ds.scan();

      String[] files = ds.getIncludedFiles();

      if (files.length == 0) {
        // this is probably an error -- warn about it
        System.err
            .println("WARNING: fileset for copying from directory "
View Full Code Here


                    }
                  zout.closeEntry();
                  // Now the rest of the main.jar entries
                  while (iter.hasNext()) {
                      FileSet fileset = (FileSet)iter.next();
                      FileScanner scanner = fileset.getDirectoryScanner(getProject());
                      String[] files = scanner.getIncludedFiles();
                      File basedir = scanner.getBasedir();
                      for (int i=0; i<files.length; i++) {
                          String file = files[i].replace('\\', '/');
                          if (entries.contains(file)) {
                              log("Duplicate entry " + target + " (ignored): " + file, Project.MSG_WARN);
                              continue;
View Full Code Here

        if (schema != null)
        {
            if (schema.isDirectory())
            {
                FileScanner scanner = getDirectoryScanner(schema);
                String[] paths = scanner.getIncludedFiles();
                processPaths(paths, scanner.getBasedir());
            }
            else
            {
                theBasedir = schema.getParentFile();
                processPaths(new String[] { schema.getName() }, theBasedir);
            }
        }
       
        if (fileset.getDir(project) != null)
            schemas.add(fileset);
       
        Iterator si = schemas.iterator();
        while (si.hasNext())
        {
            FileSet fs = (FileSet) si.next();
            FileScanner scanner = fs.getDirectoryScanner(project);
            File basedir = scanner.getBasedir();
            String[] paths = scanner.getIncludedFiles();

            processPaths(paths, basedir);
        }

        Set xsdList = (Set) _extRouter.get(XSD);
View Full Code Here

        // Add the files found in groupfileset to fileset
        for (int i = 0; i < groupfilesets.size(); i++) {

            logWhenWriting("Processing groupfileset ", Project.MSG_VERBOSE);
            FileSet fs = (FileSet) groupfilesets.elementAt(i);
            FileScanner scanner = fs.getDirectoryScanner(getProject());
            String[] files = scanner.getIncludedFiles();
            File basedir = scanner.getBasedir();
            for (int j = 0; j < files.length; j++) {

                logWhenWriting("Adding file " + files[j] + " to fileset",
                               Project.MSG_VERBOSE);
                ZipFileSet zf = new ZipFileSet();
View Full Code Here

     * For each file in the fileset, do the appropriate action: send, get,
     * delete, or list.
     */
    protected int transferFiles(FTPClient ftp, FileSet fs)
         throws IOException, BuildException {
        FileScanner ds;

        if (action == SEND_FILES) {
            ds = fs.getDirectoryScanner(project);
        } else {
            ds = new FTPDirectoryScanner(ftp);
            fs.setupDirectoryScanner(ds, project);
            ds.scan();
        }

        String[] dsfiles = ds.getIncludedFiles();
        String dir = null;

        if ((ds.getBasedir() == null)
             && ((action == SEND_FILES) || (action == GET_FILES))) {
            throw new BuildException("the dir attribute must be set for send "
                 + "and get actions");
        } else {
            if ((action == SEND_FILES) || (action == GET_FILES)) {
                dir = ds.getBasedir().getAbsolutePath();
            }
        }

        // If we are doing a listing, we need the output stream created now.
        BufferedWriter bw = null;
View Full Code Here

        // Add the files found in groupfileset to fileset
        for (int i = 0; i < groupfilesets.size(); i++) {

            log("Processing groupfileset ", Project.MSG_VERBOSE);
            FileSet fs = (FileSet) groupfilesets.elementAt(i);
            FileScanner scanner = fs.getDirectoryScanner(getProject());
            String[] files = scanner.getIncludedFiles();
            File basedir = scanner.getBasedir();
            for (int j = 0; j < files.length; j++) {

                log("Adding file " + files[j] + " to fileset",
                    Project.MSG_VERBOSE);
                ZipFileSet zf = new ZipFileSet();
View Full Code Here

        // Add the files found in groupfileset to fileset
        for (int i = 0; i < groupfilesets.size(); i++) {

            log("Processing groupfileset ", Project.MSG_VERBOSE);
            FileSet fs = (FileSet) groupfilesets.elementAt(i);
            FileScanner scanner = fs.getDirectoryScanner(getProject());
            String[] files = scanner.getIncludedFiles();
            File basedir = scanner.getBasedir();
            for (int j = 0; j < files.length; j++) {

                log("Adding file " + files[j] + " to fileset",
                    Project.MSG_VERBOSE);
                ZipFileSet zf = new ZipFileSet();
View Full Code Here

   private void processWsdlFileset( FileSet fileSet )
   {
      if ( fileSet.getDir( getProject(  ) ) != null )
      {
         FileScanner scanner = fileSet.getDirectoryScanner( getProject(  ) );
         File        basedir = scanner.getBasedir(  );
         String[]    files   = scanner.getIncludedFiles(  );

         for ( int i = 0; i < files.length; i++ )
         {
            m_wsdls.add( new File( basedir, files[i] ) );
         }
View Full Code Here

                    }
                  zout.closeEntry();
                  // Now the rest of the main.jar entries
                  while (iter.hasNext()) {
                      FileSet fileset = (FileSet)iter.next();
                      FileScanner scanner = fileset.getDirectoryScanner(getProject());
                      String[] files = scanner.getIncludedFiles();
                      File basedir = scanner.getBasedir();
                      for (int i=0; i<files.length; i++) {
                          String file = files[i].replace('\\', '/');
                          if (entries.contains(file)) {
                              log("Duplicate entry " + target + " (ignored): " + file, Project.MSG_WARN);
                              continue;
View Full Code Here

                    }
                  zout.closeEntry();
                  // Now the rest of the main.jar entries
                  while (iter.hasNext()) {
                      FileSet fileset = (FileSet)iter.next();
                      FileScanner scanner = fileset.getDirectoryScanner(getProject());
                      String[] files = scanner.getIncludedFiles();
                      File basedir = scanner.getBasedir();
                      for (int i=0; i<files.length; i++) {
                          String file = files[i].replace('\\', '/');
                          if (entries.contains(file)) {
                              log("Duplicate entry " + target + " (ignored): " + file, Project.MSG_WARN);
                              continue;
View Full Code Here

TOP

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

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.