mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-20 16:24:11 +01:00
added suppertsExtension method to determine if any analyzer supports a specified extension
Former-commit-id: b889407df86d1611fee3e09039a7f0113f3167a2
This commit is contained in:
@@ -301,4 +301,24 @@ public class Engine {
|
|||||||
}
|
}
|
||||||
return ret;
|
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<Analyzer> analyzerList = analyzers.get(phase);
|
||||||
|
for (Analyzer a : analyzerList) {
|
||||||
|
if (a.getSupportedExtensions() != null && a.supportsExtension(ext)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user