Package org.apache.tools.ant.types

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


    /*
     * Hijack Ant's ZipScanner to handle inclusions/exclusions exactly as Ant
     * does. We're only using its pattern-matching capabilities; the code path
     * I'm using never tries to hit the filesystem in Ant 1.6.5.
     */
    ZipScanner scanner = new ZipScanner();
    if (includeList.length > 0) {
      scanner.setIncludes(includeList);
    }
    if (excludeList.length > 0) {
      scanner.setExcludes(excludeList);
    }
    if (defaultExcludes) {
      scanner.addDefaultExcludes();
    }
    scanner.setCaseSensitive(caseSensitive);
    scanner.init();

    return scanner;
  }
View Full Code Here


      /*
       * @see org.apache.tools.ant.types.AbstractFileSet#getDirectoryScanner(org.apache.tools.ant.Project)
       */
      public DirectoryScanner getDirectoryScanner(Project p)
      {
         ZipScanner zs = new ZipScanner();
         zs.setSrc(getSrc());
         super.setDir(p.getBaseDir());
         setupDirectoryScanner(zs, p);
         zs.init();
         return zs;
      }
View Full Code Here

    /**
     * @since Ant 1.5.2
     */
    private synchronized ZipScanner getZipScanner() {
        if (zs == null) {
            zs = new ZipScanner();
            zs.setSrc(zipFile);
        }
        return zs;
    }
View Full Code Here

        if (prefix.length() > 0 && fullpath.length() > 0) {
            throw new BuildException("Both prefix and fullpath attributes must"
                                     + " not be set on the same fileset.");
        }

        ZipScanner zipScanner = (ZipScanner) ds;
        File zipSrc = fs.getSrc();

        ZipEntry entry;
        java.util.zip.ZipEntry origEntry;
        ZipInputStream in = null;
        try {
            in = new ZipInputStream(new FileInputStream(zipSrc));

            while ((origEntry = in.getNextEntry()) != null) {
                entry = new ZipEntry(origEntry);
                String vPath = entry.getName();
                if (zipScanner.match(vPath)) {
                    if (fullpath.length() > 0) {
                        addParentDirs(null, fullpath, zOut, "");
                        zipFile(in, zOut, fullpath, entry.getTime(), zipSrc);
                    } else {
                        addParentDirs(null, vPath, zOut, prefix);
View Full Code Here

    /**
     * @since Ant 1.5.2
     */
    private synchronized ZipScanner getZipScanner() {
        if (zs == null) {
            zs = new ZipScanner();
            zs.setEncoding(encoding);
            zs.setSrc(zipFile);
        }
        return zs;
    }
View Full Code Here

    /**
     * @since Ant 1.5.2
     */
    private synchronized ZipScanner getZipScanner() {
        if (zs == null) {
            zs = new ZipScanner();
            zs.setEncoding(encoding);
            zs.setSrc(zipFile);
        }
        return zs;
    }
View Full Code Here

    /**
     * @since Ant 1.5.2
     */
    private synchronized ZipScanner getZipScanner() {
        if (zs == null) {
            zs = new ZipScanner();
            zs.setEncoding(encoding);
            zs.setSrc(zipFile);
        }
        return zs;
    }
View Full Code Here

    /**
     * @since Ant 1.5.2
     */
    private synchronized ZipScanner getZipScanner() {
        if (zs == null) {
            zs = new ZipScanner();
            zs.setEncoding(encoding);
            zs.setSrc(zipFile);
        }
        return zs;
    }
View Full Code Here

    if (lazyPublicOracle != null) {
      throw new IllegalStateException("Already normalized");
    }

    final ZipScanner scanner = getScanner(includeList, excludeList,
        defaultExcludes, caseSensitive);

    publicPrefixSet.add(new PathPrefix(publicPackage, new ResourceFilter() {
      public boolean allows(String path) {
        return scanner.match(path);
      }
    }, true));
  }
View Full Code Here

       * If no includes list was provided then, use the default.
       */
      includeList = DEFAULT_SOURCE_FILE_INCLUDES_LIST;
    }

    final ZipScanner scanner = getScanner(includeList, excludeList,
        defaultExcludes, caseSensitive);

    ResourceFilter sourceFileFilter = new ResourceFilter() {
      public boolean allows(String path) {
        return path.endsWith(".java") && scanner.match(path);
      }
    };

    PathPrefix pathPrefix = new PathPrefix(sourcePackage, sourceFileFilter,
        isSuperSource);
View Full Code Here

TOP

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

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.