| java.lang.Object org.apache.lenya.search.Grep
Grep | public class Grep (Code) | | Utility class to provide a subset of the grep functionality.
|
Method Summary | |
public static boolean | containsPattern(File file, Pattern pattern) Check if the given file contains the pattern
Parameters: file - the file which is to be searched for the pattern Parameters: pattern - the pattern that is being searched. | public static File[] | find(File file, String searchString) Find all files below the given file which contain the given search string.
Parameters: file - the where to start the search Parameters: searchString - the string to search for. | public static String[] | findPattern(File file, Pattern pattern, int group) Find all occurences of pattern in a file.
Parameters: file - the file to search for occurences of pattern Parameters: pattern - the pattern to search for Parameters: group - which group in the pattern to return an array of occurences of pattern (i.e. |
containsPattern | public static boolean containsPattern(File file, Pattern pattern) throws IOException(Code) | | Check if the given file contains the pattern
Parameters: file - the file which is to be searched for the pattern Parameters: pattern - the pattern that is being searched. true if the file contains the string, false otherwise. throws: IOException - |
find | public static File[] find(File file, String searchString) throws IOException(Code) | | Find all files below the given file which contain the given search string.
Parameters: file - the where to start the search Parameters: searchString - the string to search for. an array of files which contain the search string. throws: IOException - if any of the files could not be opened. |
findPattern | public static String[] findPattern(File file, Pattern pattern, int group) throws IOException(Code) | | Find all occurences of pattern in a file.
Parameters: file - the file to search for occurences of pattern Parameters: pattern - the pattern to search for Parameters: group - which group in the pattern to return an array of occurences of pattern (i.e. the groupth group of the match) throws: IOException - if the file could not be read. |
|
|