mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-24 18:11:47 +01:00
Made extension file filtering case-insensitive.
Former-commit-id: e7bc80227edcf0d4fb9503eb39d43260b7db028e
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package org.owasp.dependencycheck.utils;
|
package org.owasp.dependencycheck.utils;
|
||||||
|
|
||||||
|
import org.apache.commons.io.IOCase;
|
||||||
import org.apache.commons.io.filefilter.IOFileFilter;
|
import org.apache.commons.io.filefilter.IOFileFilter;
|
||||||
import org.apache.commons.io.filefilter.NameFileFilter;
|
import org.apache.commons.io.filefilter.NameFileFilter;
|
||||||
import org.apache.commons.io.filefilter.OrFileFilter;
|
import org.apache.commons.io.filefilter.OrFileFilter;
|
||||||
@@ -43,7 +44,7 @@ public class FileFilterBuilder {
|
|||||||
private Set<String> filenames = new HashSet<String>();
|
private Set<String> filenames = new HashSet<String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add to the set of filenames to accept for analysis. Case sensitivity is assumed.
|
* Add to the set of filenames to accept for analysis. Case-sensitivity is assumed.
|
||||||
*
|
*
|
||||||
* @param names one or more filenames to accept for analysis
|
* @param names one or more filenames to accept for analysis
|
||||||
*/
|
*/
|
||||||
@@ -55,7 +56,7 @@ public class FileFilterBuilder {
|
|||||||
private Set<String> extensions = new HashSet<String>();
|
private Set<String> extensions = new HashSet<String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add to the set of file extensions to accept for analysis. Case sensitivity is assumed.
|
* Add to the set of file extensions to accept for analysis. Case-insensitivity is assumed.
|
||||||
*
|
*
|
||||||
* @param extensions one or more file extensions to accept for analysis
|
* @param extensions one or more file extensions to accept for analysis
|
||||||
*/
|
*/
|
||||||
@@ -64,7 +65,7 @@ public class FileFilterBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add to the set of file extensions to accept for analysis. Case sensitivity is assumed.
|
* Add to the set of file extensions to accept for analysis. Case-insensitivity is assumed.
|
||||||
*
|
*
|
||||||
* @param extensions one or more file extensions to accept for analysis
|
* @param extensions one or more file extensions to accept for analysis
|
||||||
*/
|
*/
|
||||||
@@ -103,7 +104,7 @@ public class FileFilterBuilder {
|
|||||||
filter.addFileFilter(new NameFileFilter(new ArrayList<String>(filenames)));
|
filter.addFileFilter(new NameFileFilter(new ArrayList<String>(filenames)));
|
||||||
}
|
}
|
||||||
if (!extensions.isEmpty()) {
|
if (!extensions.isEmpty()) {
|
||||||
filter.addFileFilter(new SuffixFileFilter(new ArrayList<String>(extensions)));
|
filter.addFileFilter(new SuffixFileFilter(new ArrayList<String>(extensions), IOCase.INSENSITIVE));
|
||||||
}
|
}
|
||||||
for (IOFileFilter iof : fileFilters) {
|
for (IOFileFilter iof : fileFilters) {
|
||||||
filter.addFileFilter(iof);
|
filter.addFileFilter(iof);
|
||||||
|
|||||||
Reference in New Issue
Block a user