diff --git a/src/main/java/org/owasp/dependencycheck/Engine.java b/src/main/java/org/owasp/dependencycheck/Engine.java index 2b53d101c..7c284fda8 100644 --- a/src/main/java/org/owasp/dependencycheck/Engine.java +++ b/src/main/java/org/owasp/dependencycheck/Engine.java @@ -301,4 +301,24 @@ public class Engine { } return ret; } + + /** + * Checks all analyzers to see if an extension is supported. + * @param ext a file extension + * @return true or false depending on whether or not the file extension is supported + */ + public boolean supportsExtension(String ext) { + if (ext == null) { + return false; + } + for (AnalysisPhase phase : AnalysisPhase.values()) { + final List analyzerList = analyzers.get(phase); + for (Analyzer a : analyzerList) { + if (a.getSupportedExtensions() != null && a.supportsExtension(ext)) { + return true; + } + } + } + return false; + } }