com.opensymphony.xwork2.util
Class ClassPathFinder

java.lang.Object
  extended by com.opensymphony.xwork2.util.ClassPathFinder

public class ClassPathFinder
extends Object

This class is an utility class that will search through the classpath for files whose names match the given pattern. The filename is tested using the given implementation of PatternMatcher by default it uses WildcardHelper

Version:
$Rev: $ $Date: $

Field Summary
private  Vector<String> compared
           
private  int[] compiledPattern
           
private  String pattern
          The String pattern to test against.
private  PatternMatcher patternMatcher
          The PatternMatcher implementation to use
 
Constructor Summary
ClassPathFinder()
           
 
Method Summary
private  Vector<String> checkEntries(String[] entries, File parent, String prefix)
           
 Vector<String> findMatches()
          Builds a Vector containing Strings which each name a file who's name matches the pattern set by setPattern(String).
 String getPattern()
          retrieves the pattern in use
private  URLClassLoader getURLClassLoader()
           
 void setPattern(String pattern)
          sets the String pattern for comparing filenames
 void setPatternMatcher(PatternMatcher patternMatcher)
          sets the PatternMatcher implementation to use when comparing filenames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

private String pattern
The String pattern to test against.


compiledPattern

private int[] compiledPattern

patternMatcher

private PatternMatcher patternMatcher
The PatternMatcher implementation to use


compared

private Vector<String> compared
Constructor Detail

ClassPathFinder

public ClassPathFinder()
Method Detail

getPattern

public String getPattern()
retrieves the pattern in use


setPattern

public void setPattern(String pattern)
sets the String pattern for comparing filenames

Parameters:
pattern -

findMatches

public Vector<String> findMatches()
Builds a Vector containing Strings which each name a file who's name matches the pattern set by setPattern(String). The classpath is searched recursively, so use with caution.

Returns:
Vector containing matching filenames

checkEntries

private Vector<String> checkEntries(String[] entries,
                                    File parent,
                                    String prefix)

setPatternMatcher

public void setPatternMatcher(PatternMatcher patternMatcher)
sets the PatternMatcher implementation to use when comparing filenames

Parameters:
patternMatcher -

getURLClassLoader

private URLClassLoader getURLClassLoader()


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.