Class FileContentSearch
- java.lang.Object
-
- org.owasp.dependencycheck.utils.search.FileContentSearch
-
public final class FileContentSearch extends java.lang.ObjectUtility for searching files.- Version:
- $Id: $Id
- Author:
- Jeremy Long
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontains(java.io.File file, java.lang.String pattern)Determines if the given file contains the given regular expression.static booleancontains(java.io.File file, java.lang.String[] patterns)Determines if the given file contains the given regular expressions.
-
-
-
Method Detail
-
contains
public static boolean contains(java.io.File file, java.lang.String pattern) throws java.io.IOExceptionDetermines if the given file contains the given regular expression.- Parameters:
file- the file to testpattern- the pattern used to test the file- Returns:
trueif the regular expression matches the file content; otherwisefalse- Throws:
java.io.IOException- thrown if there is an error reading the file
-
contains
public static boolean contains(java.io.File file, java.lang.String[] patterns) throws java.io.IOExceptionDetermines if the given file contains the given regular expressions.- Parameters:
file- the file to testpatterns- the array of patterns used to test the file- Returns:
trueif one of the regular expressions matches the file content; otherwisefalse- Throws:
java.io.IOException- thrown if there is an error reading the file
-
-