Class FileContentSearch
- java.lang.Object
-
- org.owasp.dependencycheck.utils.search.FileContentSearch
-
public final class FileContentSearch extends java.lang.Object
Utility for searching files.- Version:
- $Id: $Id
- Author:
- Jeremy Long
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
contains(java.io.File file, java.lang.String pattern)
Determines if the given file contains the given regular expression.static boolean
contains(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.IOException
Determines if the given file contains the given regular expression.- Parameters:
file
- the file to testpattern
- the pattern used to test the file- Returns:
true
if 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.IOException
Determines 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:
true
if one of the regular expressions matches the file content; otherwisefalse
- Throws:
java.io.IOException
- thrown if there is an error reading the file
-
-