net.sourceforge.groboutils.codecoverage.v2.ant.zip
Class ZipScanner

java.lang.Object
  extended byorg.apache.tools.ant.DirectoryScanner
      extended bynet.sourceforge.groboutils.codecoverage.v2.ant.zip.ZipScanner
All Implemented Interfaces:
org.apache.tools.ant.FileScanner, org.apache.tools.ant.types.ResourceFactory, org.apache.tools.ant.types.selectors.SelectorScanner

public class ZipScanner
extends org.apache.tools.ant.DirectoryScanner

ZipScanner accesses the pattern matching algorithm in DirectoryScanner, which are protected methods that can only be accessed by subclassing. This implementation of FileScanner defines getIncludedFiles to return the matching Zip entries.

Author:
Don Ferguson don@bea.com, Antoine Levy-Lambert

Field Summary
protected  java.io.File srcFile
          The zip file which should be scanned.
 
Fields inherited from class org.apache.tools.ant.DirectoryScanner
basedir, DEFAULTEXCLUDES, dirsDeselected, dirsExcluded, dirsIncluded, dirsNotIncluded, everythingIncluded, excludes, filesDeselected, filesExcluded, filesIncluded, filesNotIncluded, haveSlowResults, includes, isCaseSensitive, selectors
 
Constructor Summary
ZipScanner()
           
 
Method Summary
 java.lang.String[] getIncludedDirectories()
          Returns the names of the directories which matched at least one of the include patterns and none of the exclude patterns.
 java.lang.String[] getIncludedFiles()
          Returns the names of the files which matched at least one of the include patterns and none of the exclude patterns.
 void init()
          Initialize DirectoryScanner data structures.
 boolean match(java.lang.String path)
          Matches a jar entry against the includes/excludes list, normalizing the path separator.
 void setEncoding(java.lang.String encoding)
          Sets encoding of file names.
 void setSrc(java.io.File srcFile)
          Sets the srcFile for scanning.
 
Methods inherited from class org.apache.tools.ant.DirectoryScanner
addDefaultExclude, addDefaultExcludes, couldHoldIncluded, getBasedir, getDefaultExcludes, getDeselectedDirectories, getDeselectedFiles, getExcludedDirectories, getExcludedFiles, getNotIncludedDirectories, getNotIncludedFiles, getResource, isCaseSensitive, isEverythingIncluded, isExcluded, isFollowSymlinks, isIncluded, isSelected, match, match, matchPath, matchPath, matchPatternStart, matchPatternStart, removeDefaultExclude, resetDefaultExcludes, scan, scandir, setBasedir, setBasedir, setCaseSensitive, setExcludes, setFollowSymlinks, setIncludes, setSelectors, slowScan
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

srcFile

protected java.io.File srcFile
The zip file which should be scanned.

Constructor Detail

ZipScanner

public ZipScanner()
Method Detail

setSrc

public void setSrc(java.io.File srcFile)
Sets the srcFile for scanning. This is the jar or zip file that is scanned for matching entries.

Parameters:
srcFile - the (non-null) zip file name for scanning

setEncoding

public void setEncoding(java.lang.String encoding)
Sets encoding of file names.

Since:
Ant 1.6

getIncludedFiles

public java.lang.String[] getIncludedFiles()
Returns the names of the files which matched at least one of the include patterns and none of the exclude patterns. The names are relative to the base directory.

Returns:
the names of the files which matched at least one of the include patterns and none of the exclude patterns.

getIncludedDirectories

public java.lang.String[] getIncludedDirectories()
Returns the names of the directories which matched at least one of the include patterns and none of the exclude patterns. The names are relative to the base directory.

Returns:
the names of the directories which matched at least one of the include patterns and none of the exclude patterns.

init

public void init()
Initialize DirectoryScanner data structures.


match

public boolean match(java.lang.String path)
Matches a jar entry against the includes/excludes list, normalizing the path separator.

Parameters:
path - the (non-null) path name to test for inclusion
Returns:
true if the path should be included false otherwise.


Copyright © 2001-2003 by The GroboUtils Project