mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-19 15:54:52 +01:00
removed wild card pattern matching during scan
Former-commit-id: 183963237c378641467f7277f68ba74156442485
This commit is contained in:
@@ -193,22 +193,8 @@ public class Engine implements Serializable {
|
|||||||
* @return the list of dependencies scanned
|
* @return the list of dependencies scanned
|
||||||
*/
|
*/
|
||||||
public List<Dependency> scan(String path) {
|
public List<Dependency> scan(String path) {
|
||||||
if (path.matches("^.*[\\/]\\*\\.[^\\/:*|?<>\"]+$")) {
|
final File file = new File(path);
|
||||||
final String[] parts = path.split("\\*\\.");
|
return scan(file);
|
||||||
final String[] ext = new String[]{parts[parts.length - 1]};
|
|
||||||
final File dir = new File(path.substring(0, path.length() - ext[0].length() - 2));
|
|
||||||
if (dir.isDirectory()) {
|
|
||||||
final List<File> files = (List<File>) org.apache.commons.io.FileUtils.listFiles(dir, ext, true);
|
|
||||||
return scan(files);
|
|
||||||
} else {
|
|
||||||
final String msg = String.format("Invalid file path provided to scan '%s'", path);
|
|
||||||
LOGGER.log(Level.SEVERE, msg);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
final File file = new File(path);
|
|
||||||
return scan(file);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user