com.isocra.utils.jarSearch
Class EntryNameVisitor

java.lang.Object
  extended bycom.isocra.utils.jarSearch.EntryVisitor
      extended bycom.isocra.utils.jarSearch.EntryNameVisitor

public class EntryNameVisitor
extends EntryVisitor

Checks to see if the name of the entry matches the pattern we're looking for


Constructor Summary
EntryNameVisitor(java.lang.String patternStr)
          Take in a string pattern that we can use for matching against jar entry names.
 
Method Summary
 java.lang.String getResults()
          Check to see if we've found anything and if not say so, otherwise return our results
 void visit(java.io.File file)
          Look at the name of the file and see if it matches, if so add its name to the output
 void visit(java.util.jar.JarFile jar, java.util.jar.JarEntry entry)
          look at the name of the entry and see if it matches, if so, add its name to the output.
 
Methods inherited from class com.isocra.utils.jarSearch.EntryVisitor
isJar, searchDir, searchJar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntryNameVisitor

public EntryNameVisitor(java.lang.String patternStr)
Take in a string pattern that we can use for matching against jar entry names.

Parameters:
patternStr - The pattern is given to Pattern.compile and is a regular expression.
See Also:
Pattern
Method Detail

visit

public void visit(java.util.jar.JarFile jar,
                  java.util.jar.JarEntry entry)
look at the name of the entry and see if it matches, if so, add its name to the output.

Specified by:
visit in class EntryVisitor
Parameters:
jar - the jar file we're currently searching (we need this so that we can output the name)
entry - the entry that we're trying to match against.

visit

public void visit(java.io.File file)
Look at the name of the file and see if it matches, if so add its name to the output

Specified by:
visit in class EntryVisitor
Parameters:
file - the file we're trying to match against.

getResults

public java.lang.String getResults()
Check to see if we've found anything and if not say so, otherwise return our results

Specified by:
getResults in class EntryVisitor
Returns:
a string containing a list of all the matching entries or files plus the number of entries, or a message saying none found


Copyright © 2004 Isocra Ltd. All Rights Reserved.