|
Anyframe Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectanyframe.common.util.file.GrepFile
public abstract class GrepFile
Utility class to provide a subset of the grep functionality.
| Method Summary | |
|---|---|
static boolean |
containsPattern(File file,
Pattern pattern)
Check if the given file name contains the pattern |
static File[] |
find(File file,
String searchString)
Find all files below the given file which contain the given search string. |
static File[] |
find(File file,
String searchString,
boolean containsDirectory)
|
static String[] |
findPattern(File file,
Pattern pattern,
int group)
Find all occurences of pattern in a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean containsPattern(File file,
Pattern pattern)
throws IOException
file - the file which is to be searched for the patternpattern - the pattern that is being searched.
IOException
public static String[] findPattern(File file,
Pattern pattern,
int group)
throws IOException
file - the file to search for occurences of patternpattern - the pattern to search forgroup - which group in the pattern to return
array of occurences of pattern (i.e. the
groupth group of the match)
IOException - if the file could not be read.
public static File[] find(File file,
String searchString)
throws IOException
file - the where to start the searchsearchString - the string to search for.
IOException - if any of the files could not be opened.
public static File[] find(File file,
String searchString,
boolean containsDirectory)
throws IOException
IOException
|
Anyframe Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||