Examples of ZipScanner


Examples of com.alibaba.antx.util.scanner.ZipScanner

     *
     * @param istream zip�ļ���������
     */
    protected void scan(InputStream istream) {
        Handler handler = new Handler();
        ZipScanner scanner = new ZipScanner(getConfigEntryResource().getURL(), handler);

        scanner.setInputStream(istream);

        try {
            scanner.scan();
        } catch (ScannerException e) {
            throw new ConfigException(e);
        }

        subEntries = handler.getSubEntries();
View Full Code Here

Examples of com.alibaba.antx.util.scanner.ZipScanner

     * @param istream zip文件的输入流
     */
    @Override
    protected void scan(InputStream istream) {
        Handler handler = new Handler();
        ZipScanner scanner = new ZipScanner(getConfigEntryResource().getURL(), handler);

        scanner.setInputStream(istream);

        try {
            scanner.scan();
        } catch (ScannerException e) {
            throw new ConfigException(e);
        }

        subEntries = handler.getSubEntries();
View Full Code Here

Examples of com.alibaba.antx.util.scanner.ZipScanner

     *
     * @param istream zip�ļ���������
     */
    protected void scan(InputStream istream) {
        Handler handler = new Handler();
        ZipScanner scanner = new ZipScanner(getConfigEntryResource().getURL(), handler);

        scanner.setInputStream(istream);

        try {
            scanner.scan();
        } catch (ScannerException e) {
            throw new ConfigException(e);
        }

        subEntries = handler.getSubEntries();
View Full Code Here

Examples of com.caucho.vfs.ZipScanner

    ArrayList<Path> tldPaths = new ArrayList<Path>();

    boolean isValidScan = false;

    ZipScanner scan = null;
    try {
      if (true)
        scan = new ZipScanner(jarBacking);

      if (scan != null && scan.open()) {
        while (scan.next()) {
          String name = scan.getName();

          if (name.startsWith(prefix)
              && name.endsWith(".tld") || name.endsWith(".ftld")) {
            tldPaths.add(jar.lookup(name));
          }
View Full Code Here

Examples of com.caucho.vfs.ZipScanner

    scan(jar, jarEntry);
  }

  public void scan(Path jar, JarEntry jarEntry)
  {
    ZipScanner scan = null;
     
    try {
      boolean isScan = true;
      boolean isValidScan = false;

      try {
        if (isScan && jar.canRead()) {
          scan = new ZipScanner(jar);
        }

        if (scan != null && scan.open()) {
          while (scan.next()) {
            char []buffer = scan.getNameBuffer();
            int length = scan.getNameLength();
           
            // server/249b, env/009r
            if (length > 0 && buffer[length - 1] == '/') {
              length--;
            }

            add(buffer, length, jarEntry);
          }

          isValidScan = true;
        }
      } catch (Exception e) {
        log.log(Level.FINER, e.toString(), e);

        isScan = false;
      }

      if (! isValidScan && jar.canRead()) {
        ZipFile file = new ZipFile(jar.getNativePath());

        try {
          Enumeration<? extends ZipEntry> e = file.entries();
          while (e.hasMoreElements()) {
            ZipEntry entry = e.nextElement();
            String name = entry.getName();

            add(name, jarEntry);

            // server/249b
            /*
            if (name.endsWith("/"))
            name = name.substring(0, name.length() - 1);
             */
          }
        } finally {
          file.close();
        }
      }
    } catch (IOException e) {
      if (jar.canRead())
        log.log(Level.WARNING, e.toString(), e);
      else
        log.log(Level.FINER, e.toString(), e);
    } finally {
      if (scan != null)
        scan.close();
    }
  }
View Full Code Here

Examples of com.google.gwt.thirdparty.org.apache.tools.ant.types.ZipScanner

    assert ("".equals(prefix) || (!prefix.startsWith("/") && prefix.endsWith("/"))) : "malformed prefix";
  }

  private void createExcludeFilter() {
    if (exclusionScanner == null && !exclusions.isEmpty()) {
      exclusionScanner = new ZipScanner();
      exclusionScanner.setIncludes(exclusions.toArray(new String[exclusions.size()]));
      exclusionScanner.init();
      exclusions.clear();
    }
  }
View Full Code Here

Examples of com.google.gwt.thirdparty.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 || skipList.length > 0) {
      String[] excludeOrSkip = concatenate(excludeList, skipList);
      scanner.setExcludes(excludeOrSkip);
    }
    if (defaultExcludes) {
      scanner.addDefaultExcludes();
    }
    scanner.setCaseSensitive(caseSensitive);
    scanner.init();

    return scanner;
  }
View Full Code Here

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

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

      /*
       * @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

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

    /**
     * @since Ant 1.5.2
     */
    private synchronized ZipScanner getZipScanner() {
        if (zs == null) {
            zs = new ZipScanner();
            zs.setSrc(zipFile);
        }
        return zs;
    }
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.