- org/owasp/dependencycheck/data/lucene/package-info.java
+ org/owasp/dependencycheck/data/update/StandardUpdate.java
0
@@ -71,34 +71,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/update/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/StandardUpdate.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -113,20 +85,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/update/exception/InvalidDataException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -141,20 +99,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/analyzer/JarAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -169,34 +113,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Plugin.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/agent/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -211,6 +127,20 @@ under the License.
0
+
+
+
+ dependency-check-ant/target/generated-classes/cobertura/cobertura.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -222,34 +152,6 @@ under the License.
0
-
- 2
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/PluginExecution.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/BuildBase.java
-
-
- 0
-
-
- 0
-
0
@@ -267,20 +169,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/lucene/AbstractTokenizingFilter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -312,7 +200,7 @@ under the License.
- dependency-check-ant/src/main/resources/log.properties
+ dependency-check-ant/target/generated-classes/cobertura/task.properties
0
@@ -323,20 +211,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/analyzer/CPEAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 2
-
@@ -351,20 +225,6 @@ under the License.
0
-
-
-
- dependency-check-core/src/test/resources/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -379,34 +239,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/src/main/resources/dependencycheck-resources.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -421,20 +253,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ActivationProperty.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -466,7 +284,7 @@ under the License.
- org/owasp/dependencycheck/utils/package-info.java
+ org/owasp/dependencycheck/dependency/EvidenceCollection.java
0
@@ -491,6 +309,1462 @@ under the License.
0
+
+
+
+ dependency-check-ant/target/classes/task.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-maven/target/generated-classes/cobertura/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/RepositoryPolicy.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/NonClosingStream.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cwe/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/CorruptDatabaseException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Exclusion.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Build.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/DBUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Relocation.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-ant/target/generated-classes/cobertura/taskdefs.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Developer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/VulnerableSoftware.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Notifier.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/DependencySimilarity.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/suppression/PropertyType.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cpe/Fields.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/suppression/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-cli/target/maven-archiver/pom.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/VulnerabilityComparator.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/CiManagement.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/exception/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/Identifier.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/src/main/resources/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-ant/target/classes/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/NexusAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/task/DownloadTask.java
+
+
+ 0
+
+
+ 0
+
+
+ 1
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-utils/src/test/resources/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/TokenPairConcatenatingFilter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Reporting.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-cli/target/generated-classes/cobertura/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/src/test/resources/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/target/generated-classes/cobertura/dependencycheck-resources.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/FieldAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/Confidence.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 2
+
+
+
+
+ org/owasp/dependencycheck/dependency/Evidence.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Prerequisites.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/target/test-classes/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/Reference.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-cli/src/main/resources/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/PluginManagement.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/exception/UpdateException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-utils/src/test/resources/test.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-maven/target/generated-classes/cobertura/cobertura.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cwe/CweHandler.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/LuceneUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/Filter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cwe/CweDB.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/ExtractionUtil.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/CveDB.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Profile.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/ActivationFile.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/reporting/VelocityLoggerRedirect.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Organization.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-cli/target/generated-classes/cobertura/cobertura.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-ant/target/generated-classes/cobertura/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nuget/NuspecParseException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/cpe/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/suppression/SuppressionParseException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/target/generated-classes/cobertura/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/SearchFieldAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/exception/ArchiveExtractionException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/VersionTokenizingFilter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/exception/NoDataException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/task/ProcessTask.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/DistributionManagement.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/DriverShim.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/dependency/Vulnerability.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/MailingList.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/JavaScriptAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 2
+
+
+
+
+ dependency-check-maven/src/main/resources/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/xml/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nuget/NugetPackage.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/target/classes/dependencycheck.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/NvdCveUpdater.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-maven/target/classes/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-maven/target/generated-classes/cobertura/mojo.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/update/exception/InvalidDataException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/JarAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/Plugin.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/agent/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/BuildBase.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/PluginExecution.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/lucene/AbstractTokenizingFilter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-ant/src/main/resources/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/analyzer/CPEAnalyzer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-maven/target/maven-archiver/pom.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/src/test/resources/log.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-core/src/main/resources/dependencycheck-resources.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ dependency-check-maven/target/maven-plugin-help.properties
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/jaxb/pom/generated/ActivationProperty.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -508,7 +1782,7 @@ under the License.
- org/owasp/dependencycheck/dependency/EvidenceCollection.java
+ org/owasp/dependencycheck/utils/package-info.java
0
@@ -547,76 +1821,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/utils/NonClosingStream.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/RepositoryPolicy.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cwe/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Exclusion.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/CorruptDatabaseException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -659,20 +1863,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Build.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -704,63 +1894,7 @@ under the License.
- org/owasp/dependencycheck/utils/DBUtils.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Relocation.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Developer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Notifier.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/dependency/VulnerableSoftware.java
+ org/owasp/dependencycheck/data/central/package-info.java
0
@@ -785,20 +1919,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -841,34 +1961,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/suppression/PropertyType.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/DependencySimilarity.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -900,7 +1992,7 @@ under the License.
- org/owasp/dependencycheck/analyzer/AbstractFileTypeAnalyzer.java
+ dependency-check-ant/target/maven-archiver/pom.properties
0
@@ -925,20 +2017,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/cpe/Fields.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1009,20 +2087,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/suppression/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1037,20 +2101,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/DeploymentRepository.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1068,21 +2118,7 @@ under the License.
- org/owasp/dependencycheck/dependency/VulnerabilityComparator.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/CiManagement.java
+ org/owasp/dependencycheck/jaxb/pom/generated/DeploymentRepository.java
0
@@ -1107,20 +2143,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/update/exception/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1135,20 +2157,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/dependency/Identifier.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1160,20 +2168,6 @@ under the License.
0
-
- 4
-
-
-
-
- dependency-check-core/src/main/resources/dependencycheck.properties
-
-
- 0
-
-
- 0
-
0
@@ -1205,34 +2199,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/analyzer/NexusAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/task/DownloadTask.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1247,90 +2213,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-utils/src/test/resources/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/TokenPairConcatenatingFilter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Reporting.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/src/test/resources/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/target/generated-classes/cobertura/dependencycheck-resources.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1345,20 +2227,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/lucene/FieldAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1373,20 +2241,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/dependency/Confidence.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1404,7 +2258,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/Scm.java
+ dependency-check-ant/target/classes/taskdefs.properties
0
@@ -1418,7 +2272,7 @@ under the License.
- org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java
+ org/owasp/dependencycheck/jaxb/pom/generated/Scm.java
0
@@ -1427,7 +2281,7 @@ under the License.
0
- 2
+ 0
@@ -1485,76 +2339,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/dependency/Evidence.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/target/test-classes/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Prerequisites.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-cli/src/main/resources/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1569,20 +2353,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/dependency/Reference.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1597,62 +2367,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/PluginManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/exception/UpdateException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1667,20 +2381,6 @@ under the License.
0
-
-
-
- dependency-check-utils/src/test/resources/test.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1693,7 +2393,7 @@ under the License.
0
- 3
+ 0
@@ -1723,34 +2423,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/lucene/LuceneUtils.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cwe/CweHandler.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1777,7 +2449,7 @@ under the License.
0
- 3
+ 0
@@ -1796,7 +2468,7 @@ under the License.
- org/owasp/dependencycheck/utils/Filter.java
+ org/owasp/dependencycheck/analyzer/CentralAnalyzer.java
0
@@ -1821,20 +2493,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/cwe/CweDB.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1849,20 +2507,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1877,20 +2521,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/utils/ExtractionUtil.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -1908,7 +2538,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/Extension.java
+ org/owasp/dependencycheck/analyzer/VulnerabilitySuppressionAnalyzer.java
0
@@ -1922,7 +2552,7 @@ under the License.
- org/owasp/dependencycheck/analyzer/VulnerabilitySuppressionAnalyzer.java
+ org/owasp/dependencycheck/jaxb/pom/generated/Extension.java
0
@@ -1964,7 +2594,7 @@ under the License.
- org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java
+ org/owasp/dependencycheck/data/central/CentralSearch.java
0
@@ -1978,7 +2608,7 @@ under the License.
- org/owasp/dependencycheck/data/nvdcve/CveDB.java
+ org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java
0
@@ -2003,20 +2633,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Profile.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2031,48 +2647,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/ActivationFile.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/reporting/VelocityLoggerRedirect.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/Organization.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2087,62 +2661,6 @@ under the License.
0
-
-
-
- dependency-check-core/target/generated-classes/cobertura/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/suppression/SuppressionParseException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/cpe/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nuget/NuspecParseException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2174,35 +2692,7 @@ under the License.
- org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/lucene/SearchFieldAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/analyzer/exception/ArchiveExtractionException.java
+ dependency-check-cli/target/classes/log.properties
0
@@ -2227,20 +2717,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/lucene/VersionTokenizingFilter.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2269,20 +2745,6 @@ under the License.
1
-
-
-
- org/owasp/dependencycheck/exception/NoDataException.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2325,20 +2787,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/update/task/ProcessTask.java
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2356,21 +2804,7 @@ under the License.
- org/owasp/dependencycheck/jaxb/pom/generated/DistributionManagement.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/nvdcve/DriverShim.java
+ dependency-check-maven/target/classes/mojo.properties
0
@@ -2395,20 +2829,6 @@ under the License.
0
-
-
-
- dependency-check-core/target/test-classes/test.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2426,35 +2846,7 @@ under the License.
- org/owasp/dependencycheck/dependency/Vulnerability.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/jaxb/pom/generated/MailingList.java
+ dependency-check-core/target/test-classes/test.properties
0
@@ -2479,20 +2871,6 @@ under the License.
0
-
-
-
- dependency-check-maven/src/main/resources/log.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2507,62 +2885,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/analyzer/JavaScriptAnalyzer.java
-
-
- 0
-
-
- 0
-
-
- 2
-
-
-
-
- org/owasp/dependencycheck/data/nuget/NugetPackage.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- org/owasp/dependencycheck/data/update/xml/package-info.java
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- dependency-check-core/target/classes/dependencycheck.properties
-
-
- 0
-
-
- 0
-
-
- 0
-
@@ -2577,20 +2899,6 @@ under the License.
0
-
-
-
- org/owasp/dependencycheck/data/update/NvdCveUpdater.java
-
-
- 0
-
-
- 0
-
-
- 0
-
diff --git a/dependency-check-core/cobertura/frame-packages.html b/dependency-check-core/cobertura/frame-packages.html
index c00b6bb79..7b1496335 100644
--- a/dependency-check-core/cobertura/frame-packages.html
+++ b/dependency-check-core/cobertura/frame-packages.html
@@ -25,6 +25,9 @@
org.owasp.dependencycheck.analyzer.exception
+org.owasp.dependencycheck.data.central
+
+
org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
index cf200ff8d..619c96477 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.analyzer.html
@@ -39,16 +39,19 @@ org.owasp.dependencycheck.analyzer
AssemblyAnalyzer (66%)
-CPEAnalyzer (77%)
+CPEAnalyzer (74%)
+
+
+CentralAnalyzer (73%)
CpeSuppressionAnalyzer (88%)
-DependencyBundlingAnalyzer (34%)
+DependencyBundlingAnalyzer (40%)
-FalsePositiveAnalyzer (49%)
+FalsePositiveAnalyzer (51%)
FileNameAnalyzer (85%)
@@ -60,13 +63,13 @@ org.owasp.dependencycheck.analyzer
HintAnalyzer (76%)
-JarAnalyzer (59%)
+JarAnalyzer (56%)
JavaScriptAnalyzer (26%)
-NexusAnalyzer (12%)
+NexusAnalyzer (28%)
NuspecAnalyzer (20%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.central.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.central.html
new file mode 100644
index 000000000..a3cfebc7b
--- /dev/null
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.central.html
@@ -0,0 +1,23 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.data.central
+
+
+Classes
+
+
+
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html
index 72235246a..1f4659420 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.cwe.html
@@ -15,7 +15,7 @@ org.owasp.dependencycheck.data.cwe
-CweDB (54%)
+CweDB (56%)
CweHandler (0%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nexus.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nexus.html
index 565120dd2..d7d3e2b00 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nexus.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.nexus.html
@@ -15,7 +15,7 @@ org.owasp.dependencycheck.data.nexus
-MavenArtifact (50%)
+MavenArtifact (58%)
NexusSearch (70%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.task.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.task.html
index 9eb9b4e89..3ee5b8425 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.task.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.data.update.task.html
@@ -15,9 +15,6 @@ org.owasp.dependencycheck.data.update.task
-DownloadTask (0%)
-
-
ProcessTask (0%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html
index 0a4463e7e..8859b4b8d 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.html
@@ -15,7 +15,7 @@ org.owasp.dependencycheck
diff --git a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html
index ddd2a7798..7d8cd4093 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles-org.owasp.dependencycheck.utils.html
@@ -15,10 +15,10 @@ org.owasp.dependencycheck.utils
-DBUtils (39%)
+DBUtils (37%)
-DependencyVersion (87%)
+DependencyVersion (90%)
DependencyVersionUtil (95%)
diff --git a/dependency-check-core/cobertura/frame-sourcefiles.html b/dependency-check-core/cobertura/frame-sourcefiles.html
index a71e3f6cc..ef584f612 100644
--- a/dependency-check-core/cobertura/frame-sourcefiles.html
+++ b/dependency-check-core/cobertura/frame-sourcefiles.html
@@ -69,12 +69,18 @@ All Packages
BuildBase (0%)
-CPEAnalyzer (77%)
+CPEAnalyzer (74%)
CachedWebDataSource (N/A)
+CentralAnalyzer (73%)
+
+
+CentralSearch (80%)
+
+
CiManagement (0%)
@@ -96,13 +102,13 @@ All Packages
CpeSuppressionAnalyzer (88%)
-CweDB (54%)
+CweDB (56%)
CweHandler (0%)
-DBUtils (39%)
+DBUtils (37%)
DatabaseException (N/A)
@@ -117,7 +123,7 @@ All Packages
Dependency (0%)
-DependencyBundlingAnalyzer (34%)
+DependencyBundlingAnalyzer (40%)
DependencyCheckScanAgent (0%)
@@ -129,7 +135,7 @@ All Packages
DependencySimilarity (0%)
-DependencyVersion (87%)
+DependencyVersion (90%)
DependencyVersionUtil (95%)
@@ -144,9 +150,6 @@ All Packages
DistributionManagement (N/A)
-DownloadTask (0%)
-
-
DriverLoadException (N/A)
@@ -156,7 +159,7 @@ All Packages
DriverShim (9%)
-Engine (53%)
+Engine (54%)
EscapeTool (0%)
@@ -177,7 +180,7 @@ All Packages
ExtractionUtil (0%)
-FalsePositiveAnalyzer (49%)
+FalsePositiveAnalyzer (51%)
FieldAnalyzer (100%)
@@ -213,7 +216,7 @@ All Packages
IssueManagement (N/A)
-JarAnalyzer (59%)
+JarAnalyzer (56%)
JavaScriptAnalyzer (26%)
@@ -228,7 +231,7 @@ All Packages
MailingList (0%)
-MavenArtifact (50%)
+MavenArtifact (58%)
MavenNamespaceFilter (0%)
@@ -237,7 +240,7 @@ All Packages
Model (0%)
-NexusAnalyzer (12%)
+NexusAnalyzer (28%)
NexusSearch (70%)
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
index 9d2d0e514..17af48359 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.agent.html
@@ -37,6 +37,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
index e420823ff..3a023dd0e 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
index 5099403a3..8fb8b2634 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.analyzer.html
@@ -16,7 +16,7 @@
@@ -41,19 +41,21 @@ packageTable.sort(0);
AnalyzerService 1.0; 1
- ArchiveAnalyzer 6.916666666666667; 6.917
+ ArchiveAnalyzer 7.083333333333333; 7.083
AssemblyAnalyzer 6.875; 6.875
- CPEAnalyzer 4.444444444444445; 4.444
- CPEAnalyzer$IdentifierConfidence 4.444444444444445; 4.444
- CPEAnalyzer$IdentifierMatch 4.444444444444445; 4.444
+ CPEAnalyzer 4.592592592592593; 4.593
+ CPEAnalyzer$IdentifierConfidence 4.592592592592593; 4.593
+ CPEAnalyzer$IdentifierMatch 4.592592592592593; 4.593
+
+ CentralAnalyzer 2.625; 2.625
CpeSuppressionAnalyzer 2.3333333333333335; 2.333
- DependencyBundlingAnalyzer 9.090909090909092; 9.091
+ DependencyBundlingAnalyzer 8.153846153846153; 8.154
- FalsePositiveAnalyzer 9.692307692307692; 9.692
+ FalsePositiveAnalyzer 9.692307692307692; 9.692
FileNameAnalyzer 2.6666666666666665; 2.667
@@ -61,16 +63,16 @@ packageTable.sort(0);
HintAnalyzer 3.3333333333333335; 3.333
- JarAnalyzer 7.470588235294118; 7.471
- JarAnalyzer$ClassNameInformation 7.470588235294118; 7.471
+ JarAnalyzer 7.542857142857143; 7.543
+ JarAnalyzer$ClassNameInformation 7.542857142857143; 7.543
JavaScriptAnalyzer 2.0; 2
- NexusAnalyzer 4.0; 4
+ NexusAnalyzer 2.375; 2.375
NuspecAnalyzer 2.6666666666666665; 2.667
- NvdCveAnalyzer 2.125; 2.125
+ NvdCveAnalyzer 2.125; 2.125
VulnerabilitySuppressionAnalyzer 2.3333333333333335; 2.333
@@ -81,6 +83,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
new file mode 100644
index 000000000..6531fe69e
--- /dev/null
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.central.html
@@ -0,0 +1,42 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.data.central
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
index aeb7d7443..114684532 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cpe.html
@@ -43,6 +43,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
index 19bea5141..43e505b92 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.cwe.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
index c4377deb2..fe12eeb6a 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.lucene.html
@@ -57,6 +57,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
index 608707a0e..9c23050e6 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nexus.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
index 7c5283b42..73e78e6da 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nuget.html
@@ -43,6 +43,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
index 608975787..67b3329b1 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.nvdcve.html
@@ -50,6 +50,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
index 4db3b1007..903803a7b 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
index f84567de5..814b8d980 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.html
@@ -18,7 +18,7 @@
org.owasp.dependencycheck.data.update 6 2.588235294117647; 2.588
org.owasp.dependencycheck.data.update.exception 2 1.0; 1
- org.owasp.dependencycheck.data.update.task 2 2.8823529411764706; 2.882
+ org.owasp.dependencycheck.data.update.task 1 3.5; 3.5
org.owasp.dependencycheck.data.update.xml 4 2.914285714285714; 2.914
@@ -50,6 +50,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html
index 4e6dec3b1..dc70a5853 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.task.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html
index d77bec16e..afe4ee7c8 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.data.update.xml.html
@@ -41,6 +41,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
index 5a88ead8b..9afff2432 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.dependency.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
index 006954f79..2e2664364 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.exception.html
@@ -39,6 +39,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
index 42cf42e2d..c51799ed1 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.html
@@ -16,27 +16,28 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html
index d8b64411d..3e23d6436 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.generated.html
@@ -160,6 +160,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.html
index 48fb4fd95..9c8b727b1 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.jaxb.pom.html
@@ -38,6 +38,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
index 4694a646c..2b60b79d7 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.reporting.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
index 9098c771f..f3f6e5b4f 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.suppression.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
index 735f9e6da..ce4bdc24f 100644
--- a/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
+++ b/dependency-check-core/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-core/cobertura/frame-summary.html b/dependency-check-core/cobertura/frame-summary.html
index 452423c2a..6f3d8b3d6 100644
--- a/dependency-check-core/cobertura/frame-summary.html
+++ b/dependency-check-core/cobertura/frame-summary.html
@@ -16,28 +16,29 @@
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
index bdc810e6c..af0e63af5 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.Engine.html
@@ -12,7 +12,7 @@
@@ -146,7 +146,7 @@
64
65
- private transient final EnumMap<AnalysisPhase, List<Analyzer>> analyzers;
+ private final transient EnumMap<AnalysisPhase, List<Analyzer>> analyzers;
66
67
@@ -154,7 +154,7 @@
68
69
- private transient final Set<FileTypeAnalyzer> fileTypeAnalyzers;
+ private final transient Set<FileTypeAnalyzer> fileTypeAnalyzers;
70
71
@@ -169,7 +169,7 @@
76
- 77 1 private transient static final Logger LOGGER = Logger.getLogger(Engine.class .getName());
+ 77 1 private static final transient Logger LOGGER = Logger.getLogger(Engine.class .getName());
78
79
@@ -255,14 +255,14 @@
130 1 final AnalyzerService service = new AnalyzerService(serviceClassLoader);
131 1 final Iterator<Analyzer> iterator = service.getAnalyzers();
- 132 14 while (iterator.hasNext()) {
- 133 13 final Analyzer a = iterator.next();
- 134 13 analyzers.get(a.getAnalysisPhase()).add(a);
- 135 13 if (a instanceof FileTypeAnalyzer) {
- 136 5 this .fileTypeAnalyzers.add((FileTypeAnalyzer) a);
+ 132 15 while (iterator.hasNext()) {
+ 133 14 final Analyzer a = iterator.next();
+ 134 14 analyzers.get(a.getAnalysisPhase()).add(a);
+ 135 14 if (a instanceof FileTypeAnalyzer) {
+ 136 6 this .fileTypeAnalyzers.add((FileTypeAnalyzer) a);
137
}
- 138 13 }
+ 138 14 }
139 1 }
140
@@ -326,80 +326,86 @@
170
171
-
+
172
-
+
173
-
+
174
-
- 175
- public void scan(String[] paths) {
- 176 0 for (String path : paths) {
- 177 0 final File file = new File(path);
- 178 0 scan(file);
- 179
- }
- 180 0 }
- 181
-
- 182
-
- 183
-
- 184
-
- 185
-
- 186
-
- 187
-
- 188
- public void scan(String path) {
- 189 0 if (path.matches("^.*[\\/]\\*\\.[^\\/:*|?<>\"]+$" )) {
- 190 0 final String[] parts = path.split("\\*\\." );
- 191 0 final String[] ext = new String[]{parts[parts.length - 1]};
- 192 0 final File dir = new File(path.substring(0, path.length() - ext[0].length() - 2));
- 193 0 if (dir.isDirectory()) {
- 194 0 final List<File> files = (List<File>) org.apache.commons.io.FileUtils.listFiles(dir, ext, true );
- 195 0 scan(files);
- 196 0 } else {
- 197 0 final String msg = String.format("Invalid file path provided to scan '%s'" , path);
- 198 0 LOGGER.log(Level.SEVERE, msg);
- 199
- }
- 200 0 } else {
- 201 0 final File file = new File(path);
- 202 0 scan(file);
- 203
- }
- 204 0 }
- 205
-
- 206
-
- 207
-
- 208
-
- 209
-
- 210
- 211
-
- 212
-
- 213
+ 175
- 214
- public void scan(File[] files) {
- 215 0 for (File file : files) {
- 216 0 scan(file);
- 217
+ 176
+ public List<Dependency> scan(String[] paths) {
+ 177 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 178 0 for (String path : paths) {
+ 179 0 final File file = new File(path);
+ 180 0 final List<Dependency> d = scan(file);
+ 181 0 if (d != null ) {
+ 182 0 deps.addAll(d);
+ 183
+ }
+ 184
}
- 218 0 }
+ 185 0 return deps;
+ 186
+ }
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+ public List<Dependency> scan(String path) {
+ 196 0 final File file = new File(path);
+ 197 0 return scan(file);
+ 198
+ }
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+ public List<Dependency> scan(File[] files) {
+ 210 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 211 0 for (File file : files) {
+ 212 0 final List<Dependency> d = scan(file);
+ 213 0 if (d != null ) {
+ 214 0 deps.addAll(d);
+ 215
+ }
+ 216
+ }
+ 217 0 return deps;
+ 218
+ }
219
220
@@ -411,430 +417,471 @@
223
224
-
+
225
-
+
226
-
+
227
-
- 228
- public void scan(Set<File> files) {
- 229 0 for (File file : files) {
- 230 0 scan(file);
- 231 0 }
- 232 0 }
- 233
-
- 234
-
- 235
-
- 236
-
- 237
-
- 238
- 239
-
- 240
-
- 241
+ 228
- 242
- public void scan(List<File> files) {
- 243 0 for (File file : files) {
- 244 0 scan(file);
- 245 0 }
- 246 0 }
- 247
-
- 248
-
- 249
-
- 250
-
- 251
-
- 252
-
- 253
-
- 254
-
- 255
-
- 256
- public void scan(File file) {
- 257 4 if (file.exists()) {
- 258 4 if (file.isDirectory()) {
- 259 2 scanDirectory(file);
- 260
- } else {
- 261 2 scanFile(file);
- 262
+ 229
+ public List<Dependency> scan(Set<File> files) {
+ 230 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 231 0 for (File file : files) {
+ 232 0 final List<Dependency> d = scan(file);
+ 233 0 if (d != null ) {
+ 234 0 deps.addAll(d);
+ 235
}
- 263
- }
- 264 4 }
- 265
+ 236 0 }
+ 237 0 return deps;
+ 238
+ }
+ 239
- 266
+ 240
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+ public List<Dependency> scan(List<File> files) {
+ 250 0 final List<Dependency> deps = new ArrayList<Dependency>();
+ 251 0 for (File file : files) {
+ 252 0 final List<Dependency> d = scan(file);
+ 253 0 if (d != null ) {
+ 254 0 deps.addAll(d);
+ 255
+ }
+ 256 0 }
+ 257 0 return deps;
+ 258
+ }
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+
+ 266
+
267
-
+
268
269
-
+
270
-
- 271
- protected void scanDirectory(File dir) {
- 272 38 final File[] files = dir.listFiles();
- 273 38 if (files != null ) {
- 274 74 for (File f : files) {
- 275 36 if (f.isDirectory()) {
- 276 36 scanDirectory(f);
- 277
- } else {
- 278 0 scanFile(f);
- 279
- }
+ public List<Dependency> scan(File file) {
+ 271 4 if (file.exists()) {
+ 272 4 if (file.isDirectory()) {
+ 273 2 return scanDirectory(file);
+ 274
+ } else {
+ 275 2 final Dependency d = scanFile(file);
+ 276 2 if (d != null ) {
+ 277 2 final List<Dependency> deps = new ArrayList<Dependency>();
+ 278 2 deps.add(d);
+ 279 2 return deps;
280
- }
+ }
281
+ }
+ 282
}
- 282 38 }
- 283
-
+ 283 0 return null ;
284
-
+ }
285
-
+
286
-
+
287
-
+
288
-
+
289
- protected void scanFile(File file) {
- 290 2 if (!file.isFile()) {
- 291 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
- 292 0 LOGGER.log(Level.FINE, msg);
- 293 0 return ;
- 294
- }
- 295 2 final String fileName = file.getName();
- 296 2 final String extension = FileUtils.getFileExtension(fileName);
- 297 2 if (extension != null ) {
- 298 2 if (supportsExtension(extension)) {
- 299 2 final Dependency dependency = new Dependency(file);
- 300 2 dependencies.add(dependency);
- 301 2 }
- 302
- } else {
- 303 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
- 304
- file.toString());
- 305 0 LOGGER.log(Level.FINEST, msg);
+
+ 290
+
+ 291
+
+ 292
+ protected List<Dependency> scanDirectory(File dir) {
+ 293 38 final File[] files = dir.listFiles();
+ 294 38 final List<Dependency> deps = new ArrayList<Dependency>();
+ 295 38 if (files != null ) {
+ 296 74 for (File f : files) {
+ 297 36 if (f.isDirectory()) {
+ 298 36 final List<Dependency> d = scanDirectory(f);
+ 299 36 if (d != null ) {
+ 300 36 deps.addAll(d);
+ 301
+ }
+ 302 36 } else {
+ 303 0 final Dependency d = scanFile(f);
+ 304 0 deps.add(d);
+ 305
+ }
306
+ }
+ 307
}
- 307 2 }
- 308
-
+ 308 38 return deps;
309
-
+ }
310
-
+
311
-
+
312
- public void analyzeDependencies() {
+
313
-
+
314
- try {
- 315 1 ensureDataExists();
- 316 0 } catch (NoDataException ex) {
- 317 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
- 318 0 LOGGER.log(Level.SEVERE, msg);
- 319 0 LOGGER.log(Level.FINE, null , ex);
- 320 0 return ;
- 321 0 } catch (DatabaseException ex) {
- 322 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
- 323 0 LOGGER.log(Level.SEVERE, msg);
- 324 0 LOGGER.log(Level.FINE, null , ex);
- 325 0 return ;
- 326
-
- 327 1 }
- 328
-
- 329 1 final String logHeader = String.format("%n"
+
+ 315
+
+ 316
+
+ 317
+ protected Dependency scanFile(File file) {
+ 318 2 if (!file.isFile()) {
+ 319 0 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
+ 320 0 LOGGER.log(Level.FINE, msg);
+ 321 0 return null ;
+ 322
+ }
+ 323 2 final String fileName = file.getName();
+ 324 2 final String extension = FileUtils.getFileExtension(fileName);
+ 325 2 Dependency dependency = null ;
+ 326 2 if (extension != null ) {
+ 327 2 if (supportsExtension(extension)) {
+ 328 2 dependency = new Dependency(file);
+ 329 2 dependencies.add(dependency);
330
- + "----------------------------------------------------%n"
+ }
331
- + "BEGIN ANALYSIS%n"
- 332
- + "----------------------------------------------------" );
- 333 1 LOGGER.log(Level.FINE, logHeader);
- 334 1 LOGGER.log(Level.INFO, "Analysis Starting" );
- 335
-
+ } else {
+ 332 0 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." , file.toString());
+ 333 0 LOGGER.log(Level.FINEST, msg);
+ 334
+ }
+ 335 2 return dependency;
336
-
- 337 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 338 9 final List<Analyzer> analyzerList = analyzers.get(phase);
+ }
+ 337
+
+ 338
+
339
-
- 340 9 for (Analyzer a : analyzerList) {
- 341 13 initializeAnalyzer(a);
+
+ 340
+
+ 341
+ public void analyzeDependencies() {
342
-
+
343
-
- 344
-
- 345
-
- 346
-
- 347 13 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
- 348 13 LOGGER.log(Level.FINE, msg);
- 349 13 final Set<Dependency> dependencySet = new HashSet<Dependency>();
- 350 13 dependencySet.addAll(dependencies);
- 351 13 for (Dependency d : dependencySet) {
- 352 26 boolean shouldAnalyze = true ;
- 353 26 if (a instanceof FileTypeAnalyzer) {
- 354 10 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
- 355 10 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
- 356
- }
- 357 26 if (shouldAnalyze) {
- 358 20 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
- 359 20 LOGGER.log(Level.FINE, msgFile);
- 360
- try {
- 361 20 a.analyze(d, this );
- 362 0 } catch (AnalysisException ex) {
- 363 0 final String exMsg = String.format("An error occurred while analyzing '%s'." , d.getActualFilePath());
- 364 0 LOGGER.log(Level.WARNING, exMsg);
- 365 0 LOGGER.log(Level.FINE, "" , ex);
- 366 0 } catch (Throwable ex) {
- 367 0 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
- 368
-
- 369 0 LOGGER.log(Level.WARNING, axMsg);
- 370 0 LOGGER.log(Level.FINE, "" , ex);
- 371 20 }
- 372
- }
- 373 26 }
- 374 13 }
- 375
- }
- 376 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 377 9 final List<Analyzer> analyzerList = analyzers.get(phase);
- 378
+ try {
+ 344 1 ensureDataExists();
+ 345 0 } catch (NoDataException ex) {
+ 346 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+ 347 0 LOGGER.log(Level.SEVERE, msg);
+ 348 0 LOGGER.log(Level.FINE, null , ex);
+ 349 0 return ;
+ 350 0 } catch (DatabaseException ex) {
+ 351 0 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+ 352 0 LOGGER.log(Level.SEVERE, msg);
+ 353 0 LOGGER.log(Level.FINE, null , ex);
+ 354 0 return ;
+ 355
- 379 9 for (Analyzer a : analyzerList) {
- 380 13 closeAnalyzer(a);
- 381 13 }
- 382
- }
- 383
+ 356 1 }
+ 357
- 384 1 final String logFooter = String.format("%n"
- 385
+ 358 1 final String logHeader = String.format("%n"
+ 359
+ "----------------------------------------------------%n"
- 386
- + "END ANALYSIS%n"
- 387
+ 360
+ + "BEGIN ANALYSIS%n"
+ 361
+ "----------------------------------------------------" );
- 388 1 LOGGER.log(Level.FINE, logFooter);
- 389 1 LOGGER.log(Level.INFO, "Analysis Complete" );
- 390 1 }
- 391
+ 362 1 LOGGER.log(Level.FINE, logHeader);
+ 363 1 LOGGER.log(Level.INFO, "Analysis Starting" );
+ 364
- 392
-
- 393
-
- 394
-
- 395
-
- 396
-
+ 365
+
+ 366 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 367 9 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 368
+
+ 369 9 for (Analyzer a : analyzerList) {
+ 370 14 initializeAnalyzer(a);
+ 371
+
+ 372
+
+ 373
+
+ 374
+
+ 375
+
+ 376 14 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
+ 377 14 LOGGER.log(Level.FINE, msg);
+ 378 14 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+ 379 14 dependencySet.addAll(dependencies);
+ 380 14 for (Dependency d : dependencySet) {
+ 381 28 boolean shouldAnalyze = true ;
+ 382 28 if (a instanceof FileTypeAnalyzer) {
+ 383 12 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
+ 384 12 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
+ 385
+ }
+ 386 28 if (shouldAnalyze) {
+ 387 22 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
+ 388 22 LOGGER.log(Level.FINE, msgFile);
+ 389
+ try {
+ 390 22 a.analyze(d, this );
+ 391 0 } catch (AnalysisException ex) {
+ 392 0 final String exMsg = String.format("An error occurred while analyzing '%s'." , d.getActualFilePath());
+ 393 0 LOGGER.log(Level.WARNING, exMsg);
+ 394 0 LOGGER.log(Level.FINE, "" , ex);
+ 395 0 } catch (Throwable ex) {
+ 396 0 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
397
- private void initializeAnalyzer(Analyzer analyzer) {
- 398
- try {
- 399 13 final String msg = String.format("Initializing %s" , analyzer.getName());
- 400 13 LOGGER.log(Level.FINE, msg);
- 401 13 analyzer.initialize();
- 402 0 } catch (Throwable ex) {
- 403 0 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
- 404 0 LOGGER.log(Level.SEVERE, msg);
- 405 0 LOGGER.log(Level.FINE, null , ex);
- 406
- try {
- 407 0 analyzer.close();
- 408 0 } catch (Throwable ex1) {
- 409 0 LOGGER.log(Level.FINEST, null , ex1);
- 410 0 }
- 411 13 }
- 412 13 }
- 413
+
+ 398 0 LOGGER.log(Level.WARNING, axMsg);
+ 399 0 LOGGER.log(Level.FINE, "" , ex);
+ 400 22 }
+ 401
+ }
+ 402 28 }
+ 403 14 }
+ 404
+ }
+ 405 10 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 406 9 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 407
+ 408 9 for (Analyzer a : analyzerList) {
+ 409 14 closeAnalyzer(a);
+ 410 14 }
+ 411
+ }
+ 412
+
+ 413 1 final String logFooter = String.format("%n"
414
-
+ + "----------------------------------------------------%n"
415
-
+ + "END ANALYSIS%n"
416
-
- 417
-
- 418
-
- 419
- private void closeAnalyzer(Analyzer analyzer) {
- 420 13 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
- 421 13 LOGGER.log(Level.FINE, msg);
+ + "----------------------------------------------------" );
+ 417 1 LOGGER.log(Level.FINE, logFooter);
+ 418 1 LOGGER.log(Level.INFO, "Analysis Complete" );
+ 419 1 }
+ 420
+
+ 421
+
422
- try {
- 423 13 analyzer.close();
- 424 0 } catch (Throwable ex) {
- 425 0 LOGGER.log(Level.FINEST, null , ex);
- 426 13 }
- 427 13 }
- 428
-
- 429
-
- 430
-
- 431
+
+ 423
+
+ 424
+
+ 425
- 432
- private void doUpdates() {
- 433 0 final UpdateService service = new UpdateService(serviceClassLoader);
- 434 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
- 435 0 while (iterator.hasNext()) {
- 436 0 final CachedWebDataSource source = iterator.next();
- 437
+ 426
+ private void initializeAnalyzer(Analyzer analyzer) {
+ 427
+ try {
+ 428 14 final String msg = String.format("Initializing %s" , analyzer.getName());
+ 429 14 LOGGER.log(Level.FINE, msg);
+ 430 14 analyzer.initialize();
+ 431 0 } catch (Throwable ex) {
+ 432 0 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
+ 433 0 LOGGER.log(Level.SEVERE, msg);
+ 434 0 LOGGER.log(Level.FINE, null , ex);
+ 435
try {
- 438 0 source.update();
- 439 0 } catch (UpdateException ex) {
- 440 0 LOGGER.log(Level.WARNING,
- 441
- "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
- 442 0 LOGGER.log(Level.FINE,
+ 436 0 analyzer.close();
+ 437 0 } catch (Throwable ex1) {
+ 438 0 LOGGER.log(Level.FINEST, null , ex1);
+ 439 0 }
+ 440 14 }
+ 441 14 }
+ 442
+
443
- String.format("Unable to update details for %s" , source.getClass().getName()), ex);
- 444 0 }
- 445 0 }
- 446 0 }
+
+ 444
+
+ 445
+
+ 446
+
447
-
+
448
-
- 449
-
- 450
-
+ private void closeAnalyzer(Analyzer analyzer) {
+ 449 14 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
+ 450 14 LOGGER.log(Level.FINE, msg);
451
-
- 452
-
- 453
- public List<Analyzer> getAnalyzers() {
- 454 0 final List<Analyzer> ret = new ArrayList<Analyzer>();
- 455 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
- 456 0 final List<Analyzer> analyzerList = analyzers.get(phase);
- 457 0 ret.addAll(analyzerList);
- 458
- }
- 459 0 return ret;
- 460
- }
- 461
-
- 462
-
- 463
-
- 464
-
- 465
-
- 466
-
- 467
-
- 468
- public boolean supportsExtension(String ext) {
- 469 851 if (ext == null ) {
- 470 3 return false ;
- 471
- }
- 472 848 boolean scan = false ;
- 473 848 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
- 474
-
- 475
-
- 476 4240 scan |= a.supportsExtension(ext);
- 477 4240 }
- 478 848 return scan;
- 479
- }
- 480
-
- 481
-
- 482
-
- 483
-
- 484
-
- 485
-
- 486
-
- 487
- private void ensureDataExists() throws NoDataException, DatabaseException {
- 488 1 final CpeMemoryIndex cpe = CpeMemoryIndex.getInstance();
- 489 1 final CveDB cve = new CveDB();
- 490
-
- 491
try {
- 492 1 cve.open();
- 493 1 cpe.open(cve);
- 494 0 } catch (IndexException ex) {
- 495 0 throw new NoDataException(ex.getMessage(), ex);
- 496 0 } catch (DatabaseException ex) {
- 497 0 throw new NoDataException(ex.getMessage(), ex);
- 498
- } finally {
- 499 1 cve.close();
- 500 1 }
- 501 1 if (cpe.numDocs() <= 0) {
- 502 0 cpe.close();
- 503 0 throw new NoDataException("No documents exist" );
- 504
+ 452 14 analyzer.close();
+ 453 0 } catch (Throwable ex) {
+ 454 0 LOGGER.log(Level.FINEST, null , ex);
+ 455 14 }
+ 456 14 }
+ 457
+
+ 458
+
+ 459
+
+ 460
+
+ 461
+ private void doUpdates() {
+ 462 0 final UpdateService service = new UpdateService(serviceClassLoader);
+ 463 0 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
+ 464 0 while (iterator.hasNext()) {
+ 465 0 final CachedWebDataSource source = iterator.next();
+ 466
+ try {
+ 467 0 source.update();
+ 468 0 } catch (UpdateException ex) {
+ 469 0 LOGGER.log(Level.WARNING,
+ 470
+ "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
+ 471 0 LOGGER.log(Level.FINE, String.format("Unable to update details for %s" , source.getClass().getName()), ex);
+ 472 0 }
+ 473 0 }
+ 474 0 }
+ 475
+
+ 476
+
+ 477
+
+ 478
+
+ 479
+
+ 480
+
+ 481
+ public List<Analyzer> getAnalyzers() {
+ 482 0 final List<Analyzer> ret = new ArrayList<Analyzer>();
+ 483 0 for (AnalysisPhase phase : AnalysisPhase.values()) {
+ 484 0 final List<Analyzer> analyzerList = analyzers.get(phase);
+ 485 0 ret.addAll(analyzerList);
+ 486
}
- 505 1 }
- 506
+ 487 0 return ret;
+ 488
+ }
+ 489
+
+ 490
+
+ 491
+
+ 492
+
+ 493
+
+ 494
+
+ 495
+
+ 496
+ public boolean supportsExtension(String ext) {
+ 497 851 if (ext == null ) {
+ 498 3 return false ;
+ 499
+ }
+ 500 848 boolean scan = false ;
+ 501 848 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
+ 502
+
+ 503
+
+ 504 5088 scan |= a.supportsExtension(ext);
+ 505 5088 }
+ 506 848 return scan;
+ 507
+ }
+ 508
+
+ 509
+
+ 510
+
+ 511
+
+ 512
+
+ 513
+
+ 514
+
+ 515
+ private void ensureDataExists() throws NoDataException, DatabaseException {
+ 516 1 final CpeMemoryIndex cpe = CpeMemoryIndex.getInstance();
+ 517 1 final CveDB cve = new CveDB();
+ 518
+
+ 519
+ try {
+ 520 1 cve.open();
+ 521 1 cpe.open(cve);
+ 522 0 } catch (IndexException ex) {
+ 523 0 throw new NoDataException(ex.getMessage(), ex);
+ 524 0 } catch (DatabaseException ex) {
+ 525 0 throw new NoDataException(ex.getMessage(), ex);
+ 526
+ } finally {
+ 527 1 cve.close();
+ 528 1 }
+ 529 1 if (cpe.numDocs() <= 0) {
+ 530 0 cpe.close();
+ 531 0 throw new NoDataException("No documents exist" );
+ 532
+ }
+ 533 1 }
+ 534
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
index 1a2ea361d..64f68fe53 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.agent.DependencyCheckScanAgent.html
@@ -1867,6 +1867,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
index e64632f4f..c8a7f376a 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractAnalyzer.html
@@ -102,11 +102,11 @@
public void close() throws Exception {
43
- 44 15 }
+ 44 16 }
45
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
index b78c0cb9e..eb99d2050 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer.html
@@ -101,19 +101,19 @@
42
- 43 29 public AbstractFileTypeAnalyzer() {
- 44 29 final String key = getAnalyzerEnabledSettingKey();
+ 43 31 public AbstractFileTypeAnalyzer() {
+ 44 31 final String key = getAnalyzerEnabledSettingKey();
45
try {
- 46 29 enabled = Settings.getBoolean(key, true );
+ 46 31 enabled = Settings.getBoolean(key, true );
47 0 } catch (InvalidSettingException ex) {
48 0 String msg = String.format("Invalid setting for property '%s'" , key);
49 0 LOGGER.log(Level.WARNING, msg);
50 0 LOGGER.log(Level.FINE, "" , ex);
51 0 msg = String.format("%s has been disabled" , getName());
52 0 LOGGER.log(Level.WARNING, msg);
- 53 29 }
- 54 29 }
+ 53 31 }
+ 54 31 }
55
56
@@ -133,7 +133,7 @@
64
- 65 29 private boolean filesMatched = false ;
+ 65 31 private boolean filesMatched = false ;
66
67
@@ -178,7 +178,7 @@
87
- 88 29 private boolean enabled = true ;
+ 88 31 private boolean enabled = true ;
89
90
@@ -321,14 +321,14 @@
@Override
159
public final void initialize() throws Exception {
- 160 10 if (filesMatched) {
- 161 7 initializeFileTypeAnalyzer();
+ 160 11 if (filesMatched) {
+ 161 8 initializeFileTypeAnalyzer();
162
} else {
163 3 enabled = false ;
164
}
- 165 10 }
+ 165 11 }
166
167
@@ -351,11 +351,11 @@
@Override
176
public final void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 177 10 if (enabled) {
- 178 10 analyzeFileType(dependency, engine);
+ 177 12 if (enabled) {
+ 178 12 analyzeFileType(dependency, engine);
179
}
- 180 9 }
+ 180 11 }
181
182
@@ -374,12 +374,12 @@
@Override
189
public final boolean supportsExtension(String extension) {
- 190 4259 if (!enabled) {
+ 190 5109 if (!enabled) {
191 854 return false ;
192
}
- 193 3405 final Set<String> ext = getSupportedExtensions();
- 194 3405 if (ext == null ) {
+ 193 4255 final Set<String> ext = getSupportedExtensions();
+ 194 4255 if (ext == null ) {
195 0 final String msg = String.format("The '%s' analyzer is misconfigured and does not have any file extensions;"
196
+ " it will be disabled" , getName());
@@ -387,12 +387,12 @@
198 0 return false ;
199
} else {
- 200 3405 final boolean match = ext.contains(extension);
- 201 3405 if (match) {
- 202 16 filesMatched = match;
+ 200 4255 final boolean match = ext.contains(extension);
+ 201 4255 if (match) {
+ 202 20 filesMatched = match;
203
}
- 204 3405 return match;
+ 204 4255 return match;
205
}
206
@@ -429,11 +429,11 @@
222
protected static Set<String> newHashSet(String... strings) {
- 223 11 final Set<String> set = new HashSet<String>();
+ 223 12 final Set<String> set = new HashSet<String>();
224
- 225 11 Collections.addAll(set, strings);
- 226 11 return set;
+ 225 12 Collections.addAll(set, strings);
+ 226 12 return set;
227
}
228
@@ -442,6 +442,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
index 75b8720d0..464b6085e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AbstractSuppressionAnalyzer.html
@@ -319,6 +319,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
index 09ec25094..46d356030 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalysisPhase.html
@@ -135,6 +135,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
index 69b3164e0..91db7417e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.Analyzer.html
@@ -161,6 +161,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
index 0010080a1..d91589454 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AnalyzerService.html
@@ -121,6 +121,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
index 0ac42c1d0..08388fe89 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.html
@@ -12,7 +12,7 @@
@@ -232,7 +232,7 @@
static {
111 1 final String additionalZipExt = Settings.getString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS);
112 1 if (additionalZipExt != null ) {
- 113 0 final HashSet ext = new HashSet<String>(Arrays.asList(additionalZipExt));
+ 113 0 final HashSet<String> ext = new HashSet<String>(Arrays.asList(additionalZipExt));
114 0 ZIPPABLES.addAll(ext);
115
}
@@ -364,7 +364,7 @@
186 1 if (tempFileLocation != null && tempFileLocation.exists()) {
187 1 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
188 1 final boolean success = FileUtils.delete(tempFileLocation);
- 189 1 if (!success && tempFileLocation != null & tempFileLocation.exists()) {
+ 189 1 if (!success && tempFileLocation != null && tempFileLocation.exists() && tempFileLocation.list().length > 0) {
190 0 LOGGER.log(Level.WARNING, "Failed to delete some temporary files, see the log for more details" );
191
}
@@ -419,383 +419,381 @@
dependency.getFilePath(),
223
d.getActualFilePath().substring(tmpDir.getAbsolutePath().length()));
- 224 0 final String displayName = String.format("%s%s%s" ,
+ 224 0 final String displayName = String.format("%s: %s" ,
225
dependency.getFileName(),
226
- File.separator,
- 227
d.getFileName());
- 228 0 d.setFilePath(displayPath);
- 229 0 d.setFileName(displayName);
+ 227 0 d.setFilePath(displayPath);
+ 228 0 d.setFileName(displayName);
+ 229
+
230
-
- 231
- 232
+ 231
- 233 0 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
- 234 0 scanDepth += 1;
- 235 0 analyze(d, engine);
- 236 0 scanDepth -= 1;
- 237
+ 232 0 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
+ 233 0 scanDepth += 1;
+ 234 0 analyze(d, engine);
+ 235 0 scanDepth -= 1;
+ 236
}
- 238 0 }
- 239
+ 237 0 }
+ 238
}
- 240 2 if (this .REMOVE_FROM_ANALYSIS.contains(dependency.getFileExtension())) {
- 241 0 if ("zip" .equals(dependency.getFileExtension()) && isZipFileActuallyJarFile(dependency)) {
- 242 0 final File tdir = getNextTempDirectory();
- 243 0 final String fileName = dependency.getFileName();
- 244
+ 239 2 if (this .REMOVE_FROM_ANALYSIS.contains(dependency.getFileExtension())) {
+ 240 0 if ("zip" .equals(dependency.getFileExtension()) && isZipFileActuallyJarFile(dependency)) {
+ 241 0 final File tdir = getNextTempDirectory();
+ 242 0 final String fileName = dependency.getFileName();
+ 243
- 245 0 LOGGER.info(String.format("The zip file '%s' appears to be a JAR file, making a copy and analyzing it as a JAR." , fileName));
- 246
+ 244 0 LOGGER.info(String.format("The zip file '%s' appears to be a JAR file, making a copy and analyzing it as a JAR." , fileName));
+ 245
- 247 0 final File tmpLoc = new File(tdir, fileName.substring(0, fileName.length() - 3) + "jar" );
- 248
+ 246 0 final File tmpLoc = new File(tdir, fileName.substring(0, fileName.length() - 3) + "jar" );
+ 247
try {
- 249 0 org.apache.commons.io.FileUtils.copyFile(tdir, tmpLoc);
- 250 0 dependencies = new ArrayList<Dependency>(engine.getDependencies());
- 251 0 engine.scan(tmpLoc);
- 252 0 newDependencies = engine.getDependencies();
- 253 0 if (dependencies.size() != newDependencies.size()) {
- 254
+ 248 0 org.apache.commons.io.FileUtils.copyFile(tdir, tmpLoc);
+ 249 0 dependencies = new ArrayList<Dependency>(engine.getDependencies());
+ 250 0 engine.scan(tmpLoc);
+ 251 0 newDependencies = engine.getDependencies();
+ 252 0 if (dependencies.size() != newDependencies.size()) {
+ 253
- 255 0 final Set<Dependency> dependencySet = new HashSet<Dependency>();
- 256 0 dependencySet.addAll(newDependencies);
- 257 0 dependencySet.removeAll(dependencies);
- 258 0 if (dependencySet.size() != 1) {
- 259 0 LOGGER.info("Deep copy of ZIP to JAR file resulted in more then one dependency?" );
- 260
+ 254 0 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+ 255 0 dependencySet.addAll(newDependencies);
+ 256 0 dependencySet.removeAll(dependencies);
+ 257 0 if (dependencySet.size() != 1) {
+ 258 0 LOGGER.info("Deep copy of ZIP to JAR file resulted in more then one dependency?" );
+ 259
}
- 261 0 for (Dependency d : dependencySet) {
- 262
+ 260 0 for (Dependency d : dependencySet) {
+ 261
- 263 0 d.setFilePath(dependency.getFilePath());
- 264 0 d.setDisplayFileName(dependency.getFileName());
- 265 0 }
- 266
+ 262 0 d.setFilePath(dependency.getFilePath());
+ 263 0 d.setDisplayFileName(dependency.getFileName());
+ 264 0 }
+ 265
}
- 267 0 } catch (IOException ex) {
- 268 0 final String msg = String.format("Unable to perform deep copy on '%s'" , dependency.getActualFile().getPath());
- 269 0 LOGGER.log(Level.FINE, msg, ex);
- 270 0 }
- 271
+ 266 0 } catch (IOException ex) {
+ 267 0 final String msg = String.format("Unable to perform deep copy on '%s'" , dependency.getActualFile().getPath());
+ 268 0 LOGGER.log(Level.FINE, msg, ex);
+ 269 0 }
+ 270
}
- 272 0 engine.getDependencies().remove(dependency);
- 273
+ 271 0 engine.getDependencies().remove(dependency);
+ 272
}
- 274 2 Collections.sort(engine.getDependencies());
- 275 2 }
+ 273 2 Collections.sort(engine.getDependencies());
+ 274 2 }
+ 275
+
276
-
+
277
-
- 278
+ 278
+
279
-
- 280
- 281
+ 280
+ 281
+
282
-
- 283
private File getNextTempDirectory() throws AnalysisException {
- 284 2 dirCount += 1;
- 285 2 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
- 286
+ 283 2 dirCount += 1;
+ 284 2 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+ 285
- 287 2 if (directory.exists()) {
- 288 0 return getNextTempDirectory();
- 289
+ 286 2 if (directory.exists()) {
+ 287 0 return getNextTempDirectory();
+ 288
}
- 290 2 if (!directory.mkdirs()) {
- 291 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
- 292 0 throw new AnalysisException(msg);
- 293
+ 289 2 if (!directory.mkdirs()) {
+ 290 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+ 291 0 throw new AnalysisException(msg);
+ 292
}
- 294 2 return directory;
+ 293 2 return directory;
+ 294
+ }
295
- }
+
296
-
+
297
-
- 298
+ 298
+
299
-
- 300
- 301
+ 300
- 302
+ 301
- 303
+ 302
+ 303
+
304
-
- 305
private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
- 306 2 if (archive == null || destination == null ) {
- 307 0 return ;
+ 305 2 if (archive == null || destination == null ) {
+ 306 0 return ;
+ 307
+ }
308
- }
- 309
- 310 2 FileInputStream fis = null ;
- 311
+ 309 2 FileInputStream fis = null ;
+ 310
try {
- 312 2 fis = new FileInputStream(archive);
- 313 0 } catch (FileNotFoundException ex) {
- 314 0 LOGGER.log(Level.FINE, null , ex);
- 315 0 throw new AnalysisException("Archive file was not found." , ex);
- 316 2 }
- 317 2 final String archiveExt = FileUtils.getFileExtension(archive.getName()).toLowerCase();
- 318
+ 311 2 fis = new FileInputStream(archive);
+ 312 0 } catch (FileNotFoundException ex) {
+ 313 0 LOGGER.log(Level.FINE, null , ex);
+ 314 0 throw new AnalysisException("Archive file was not found." , ex);
+ 315 2 }
+ 316 2 final String archiveExt = FileUtils.getFileExtension(archive.getName()).toLowerCase();
+ 317
try {
- 319 2 if (ZIPPABLES.contains(archiveExt)) {
- 320 2 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
- 321 0 } else if ("tar" .equals(archiveExt)) {
- 322 0 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
- 323 0 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
- 324 0 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
- 325 0 final String uncompressedExt = FileUtils.getFileExtension(uncompressedName).toLowerCase();
- 326 0 if (engine.supportsExtension(uncompressedExt)) {
- 327 0 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
- 328
+ 318 2 if (ZIPPABLES.contains(archiveExt)) {
+ 319 2 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+ 320 0 } else if ("tar" .equals(archiveExt)) {
+ 321 0 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+ 322 0 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
+ 323 0 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
+ 324 0 final String uncompressedExt = FileUtils.getFileExtension(uncompressedName).toLowerCase();
+ 325 0 if (engine.supportsExtension(uncompressedExt)) {
+ 326 0 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
+ 327
}
- 329
+ 328
}
- 330 0 } catch (ArchiveExtractionException ex) {
- 331 0 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
- 332 0 LOGGER.log(Level.WARNING, msg);
- 333 0 LOGGER.log(Level.FINE, null , ex);
- 334 0 } catch (IOException ex) {
- 335 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
- 336 0 LOGGER.log(Level.WARNING, msg);
- 337 0 LOGGER.log(Level.FINE, null , ex);
- 338
+ 329 0 } catch (ArchiveExtractionException ex) {
+ 330 0 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
+ 331 0 LOGGER.log(Level.WARNING, msg);
+ 332 0 LOGGER.log(Level.FINE, null , ex);
+ 333 0 } catch (IOException ex) {
+ 334 0 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
+ 335 0 LOGGER.log(Level.WARNING, msg);
+ 336 0 LOGGER.log(Level.FINE, null , ex);
+ 337
} finally {
- 339 0 try {
- 340 2 fis.close();
- 341 0 } catch (IOException ex) {
- 342 0 LOGGER.log(Level.FINEST, null , ex);
- 343 2 }
- 344 0 }
- 345 2 }
+ 338 0 try {
+ 339 2 fis.close();
+ 340 0 } catch (IOException ex) {
+ 341 0 LOGGER.log(Level.FINEST, null , ex);
+ 342 2 }
+ 343 0 }
+ 344 2 }
+ 345
+
346
-
+
347
-
- 348
+ 348
+
349
-
- 350
- 351
+ 350
- 352
+ 351
- 353
+ 352
+ 353
+
354
-
- 355
private void extractArchive(ArchiveInputStream input, File destination, Engine engine) throws ArchiveExtractionException {
- 356
+ 355
ArchiveEntry entry;
- 357
+ 356
try {
- 358 887 while ((entry = input.getNextEntry()) != null ) {
- 359 885 if (entry.isDirectory()) {
- 360 36 final File d = new File(destination, entry.getName());
- 361 36 if (!d.exists()) {
- 362 36 if (!d.mkdirs()) {
- 363 0 final String msg = String.format("Unable to create directory '%s'." , d.getAbsolutePath());
- 364 0 throw new AnalysisException(msg);
+ 357 887 while ((entry = input.getNextEntry()) != null ) {
+ 358 885 if (entry.isDirectory()) {
+ 359 36 final File d = new File(destination, entry.getName());
+ 360 36 if (!d.exists()) {
+ 361 36 if (!d.mkdirs()) {
+ 362 0 final String msg = String.format("Unable to create directory '%s'." , d.getAbsolutePath());
+ 363 0 throw new AnalysisException(msg);
+ 364
+ }
365
- }
- 366
}
- 367 36 } else {
- 368 849 final File file = new File(destination, entry.getName());
- 369 849 final String ext = FileUtils.getFileExtension(file.getName());
- 370 849 if (engine.supportsExtension(ext)) {
- 371 0 BufferedOutputStream bos = null ;
- 372
+ 366 36 } else {
+ 367 849 final File file = new File(destination, entry.getName());
+ 368 849 final String ext = FileUtils.getFileExtension(file.getName());
+ 369 849 if (engine.supportsExtension(ext)) {
+ 370 0 BufferedOutputStream bos = null ;
+ 371
FileOutputStream fos;
- 373
+ 372
try {
- 374 0 final File parent = file.getParentFile();
- 375 0 if (!parent.isDirectory()) {
- 376 0 if (!parent.mkdirs()) {
- 377 0 final String msg = String.format("Unable to build directory '%s'." , parent.getAbsolutePath());
- 378 0 throw new AnalysisException(msg);
- 379
+ 373 0 final File parent = file.getParentFile();
+ 374 0 if (!parent.isDirectory()) {
+ 375 0 if (!parent.mkdirs()) {
+ 376 0 final String msg = String.format("Unable to build directory '%s'." , parent.getAbsolutePath());
+ 377 0 throw new AnalysisException(msg);
+ 378
}
- 380
+ 379
}
- 381 0 fos = new FileOutputStream(file);
- 382 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
- 383
+ 380 0 fos = new FileOutputStream(file);
+ 381 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+ 382
int count;
- 384 0 final byte data[] = new byte [BUFFER_SIZE];
- 385 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
- 386 0 bos.write(data, 0, count);
- 387
+ 383 0 final byte data[] = new byte [BUFFER_SIZE];
+ 384 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+ 385 0 bos.write(data, 0, count);
+ 386
}
- 388 0 bos.flush();
- 389 0 } catch (FileNotFoundException ex) {
- 390 0 LOGGER.log(Level.FINE, null , ex);
- 391 0 final String msg = String.format("Unable to find file '%s'." , file.getName());
- 392 0 throw new AnalysisException(msg, ex);
- 393 0 } catch (IOException ex) {
- 394 0 LOGGER.log(Level.FINE, null , ex);
- 395 0 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
- 396 0 throw new AnalysisException(msg, ex);
- 397
+ 387 0 bos.flush();
+ 388 0 } catch (FileNotFoundException ex) {
+ 389 0 LOGGER.log(Level.FINE, null , ex);
+ 390 0 final String msg = String.format("Unable to find file '%s'." , file.getName());
+ 391 0 throw new AnalysisException(msg, ex);
+ 392 0 } catch (IOException ex) {
+ 393 0 LOGGER.log(Level.FINE, null , ex);
+ 394 0 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
+ 395 0 throw new AnalysisException(msg, ex);
+ 396
} finally {
- 398 0 if (bos != null ) {
- 399
+ 397 0 if (bos != null ) {
+ 398
try {
- 400 0 bos.close();
- 401 0 } catch (IOException ex) {
- 402 0 LOGGER.log(Level.FINEST, null , ex);
- 403 0 }
- 404
+ 399 0 bos.close();
+ 400 0 } catch (IOException ex) {
+ 401 0 LOGGER.log(Level.FINEST, null , ex);
+ 402 0 }
+ 403
}
+ 404
+ }
405
- }
- 406
}
- 407 849 }
- 408
+ 406 849 }
+ 407
}
- 409 0 } catch (IOException ex) {
- 410 0 throw new ArchiveExtractionException(ex);
- 411 0 } catch (Throwable ex) {
- 412 0 throw new ArchiveExtractionException(ex);
- 413
+ 408 0 } catch (IOException ex) {
+ 409 0 throw new ArchiveExtractionException(ex);
+ 410 0 } catch (Throwable ex) {
+ 411 0 throw new ArchiveExtractionException(ex);
+ 412
} finally {
- 414 2 if (input != null ) {
- 415
+ 413 2 if (input != null ) {
+ 414
try {
- 416 2 input.close();
- 417 0 } catch (IOException ex) {
- 418 0 LOGGER.log(Level.FINEST, null , ex);
- 419 2 }
+ 415 2 input.close();
+ 416 0 } catch (IOException ex) {
+ 417 0 LOGGER.log(Level.FINEST, null , ex);
+ 418 2 }
+ 419
+ }
420
- }
- 421
}
- 422 2 }
+ 421 2 }
+ 422
+
423
-
+
424
-
- 425
+ 425
+
426
-
- 427
- 428
+ 427
- 429
+ 428
+ 429
+
430
-
- 431
private void decompressFile(CompressorInputStream inputStream, File outputFile) throws ArchiveExtractionException {
- 432 0 FileOutputStream out = null ;
- 433
+ 431 0 FileOutputStream out = null ;
+ 432
try {
- 434 0 out = new FileOutputStream(outputFile);
- 435 0 final byte [] buffer = new byte [BUFFER_SIZE];
- 436 0 int n = 0;
- 437 0 while (-1 != (n = inputStream.read(buffer))) {
- 438 0 out.write(buffer, 0, n);
- 439
+ 433 0 out = new FileOutputStream(outputFile);
+ 434 0 final byte [] buffer = new byte [BUFFER_SIZE];
+ 435 0 int n = 0;
+ 436 0 while (-1 != (n = inputStream.read(buffer))) {
+ 437 0 out.write(buffer, 0, n);
+ 438
}
- 440 0 } catch (FileNotFoundException ex) {
- 441 0 LOGGER.log(Level.FINE, null , ex);
- 442 0 throw new ArchiveExtractionException(ex);
- 443 0 } catch (IOException ex) {
- 444 0 LOGGER.log(Level.FINE, null , ex);
- 445 0 throw new ArchiveExtractionException(ex);
- 446
+ 439 0 } catch (FileNotFoundException ex) {
+ 440 0 LOGGER.log(Level.FINE, null , ex);
+ 441 0 throw new ArchiveExtractionException(ex);
+ 442 0 } catch (IOException ex) {
+ 443 0 LOGGER.log(Level.FINE, null , ex);
+ 444 0 throw new ArchiveExtractionException(ex);
+ 445
} finally {
- 447 0 if (out != null ) {
- 448
+ 446 0 if (out != null ) {
+ 447
try {
- 449 0 out.close();
- 450 0 } catch (IOException ex) {
- 451 0 LOGGER.log(Level.FINEST, null , ex);
- 452 0 }
+ 448 0 out.close();
+ 449 0 } catch (IOException ex) {
+ 450 0 LOGGER.log(Level.FINEST, null , ex);
+ 451 0 }
+ 452
+ }
453
- }
- 454
}
- 455 0 }
+ 454 0 }
+ 455
+
456
-
- 457
- 458
+ 457
- 459
+ 458
- 460
+ 459
- 461
+ 460
- 462
+ 461
- 463
+ 462
private boolean isZipFileActuallyJarFile(Dependency dependency) {
- 464 0 boolean isJar = false ;
- 465 0 ZipFile zip = null ;
- 466
+ 463 0 boolean isJar = false ;
+ 464 0 ZipFile zip = null ;
+ 465
try {
- 467 0 zip = new ZipFile(dependency.getActualFilePath());
- 468 0 if (zip.getEntry("META-INF/MANIFEST.MF" ) != null
- 469
+ 466 0 zip = new ZipFile(dependency.getActualFilePath());
+ 467 0 if (zip.getEntry("META-INF/MANIFEST.MF" ) != null
+ 468
|| zip.getEntry("META-INF/maven" ) != null ) {
- 470 0 final Enumeration<ZipArchiveEntry> entries = zip.getEntries();
- 471 0 while (entries.hasMoreElements()) {
- 472 0 final ZipArchiveEntry entry = entries.nextElement();
- 473 0 if (!entry.isDirectory()) {
- 474 0 final String name = entry.getName().toLowerCase();
- 475 0 if (name.endsWith(".class" )) {
- 476 0 isJar = true ;
- 477 0 break ;
- 478
+ 469 0 final Enumeration<ZipArchiveEntry> entries = zip.getEntries();
+ 470 0 while (entries.hasMoreElements()) {
+ 471 0 final ZipArchiveEntry entry = entries.nextElement();
+ 472 0 if (!entry.isDirectory()) {
+ 473 0 final String name = entry.getName().toLowerCase();
+ 474 0 if (name.endsWith(".class" )) {
+ 475 0 isJar = true ;
+ 476 0 break ;
+ 477
}
- 479
+ 478
}
- 480 0 }
- 481
+ 479 0 }
+ 480
}
- 482 0 } catch (IOException ex) {
- 483 0 LOGGER.log(Level.FINE, String.format("Unable to unzip zip file '%s'" , dependency.getFilePath()), ex);
- 484
+ 481 0 } catch (IOException ex) {
+ 482 0 LOGGER.log(Level.FINE, String.format("Unable to unzip zip file '%s'" , dependency.getFilePath()), ex);
+ 483
} finally {
- 485 0 ZipFile.closeQuietly(zip);
- 486 0 }
- 487
+ 484 0 ZipFile.closeQuietly(zip);
+ 485 0 }
+ 486
- 488 0 return isJar;
- 489
+ 487 0 return isJar;
+ 488
}
- 490
+ 489
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
index 098d9f500..c3828be90 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.html
@@ -240,304 +240,312 @@
121 3 rdr = new BufferedReader(new InputStreamReader(proc.getErrorStream(), "UTF-8" ));
122 3 String line = null ;
- 123 3 while (rdr.ready() && (line = rdr.readLine()) != null ) {
- 124 0 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.stderr" , line);
- 125
+ 123
+
+ 124 3 while (rdr.ready() && (line = rdr.readLine()) != null ) {
+ 125 0 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.stderr" , line);
+ 126
}
- 126 3 int rc = 0;
- 127 3 doc = builder.parse(proc.getInputStream());
- 128
+ 127
+
+ 128 3 int rc = 0;
+ 129 3 doc = builder.parse(proc.getInputStream());
+ 130
- 129
+ 131
try {
- 130 3 rc = proc.waitFor();
- 131 0 } catch (InterruptedException ie) {
- 132
+ 132 3 rc = proc.waitFor();
+ 133 0 } catch (InterruptedException ie) {
+ 134
return ;
- 133 3 }
- 134 3 if (rc == 3) {
- 135 0 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.notassembly" , dependency.getActualFilePath());
- 136
+ 135 3 }
+ 136 3 if (rc == 3) {
+ 137 0 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.notassembly" , dependency.getActualFilePath());
+ 138
return ;
- 137 3 } else if (rc != 0) {
- 138 1 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.rc" , rc);
- 139
+ 139 3 } else if (rc != 0) {
+ 140 1 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.rc" , rc);
+ 141
}
- 140
-
- 141 3 final XPath xpath = XPathFactory.newInstance().newXPath();
142
- 143
+ 143 3 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 144
+
+ 145
- 144 3 final String error = xpath.evaluate("/assembly/error" , doc);
- 145 3 if (error != null && !"" .equals(error)) {
- 146 1 throw new AnalysisException(error);
- 147
+ 146 3 final String error = xpath.evaluate("/assembly/error" , doc);
+ 147 3 if (error != null && !"" .equals(error)) {
+ 148 1 throw new AnalysisException(error);
+ 149
}
- 148
+ 150
- 149 2 final String version = xpath.evaluate("/assembly/version" , doc);
- 150 2 if (version != null ) {
- 151 2 dependency.getVersionEvidence().addEvidence(new Evidence("grokassembly" , "version" ,
- 152
- version, Confidence.HIGHEST));
- 153
- }
+ 151 2 final String version = xpath.evaluate("/assembly/version" , doc);
+ 152 2 if (version != null ) {
+ 153 2 dependency.getVersionEvidence().addEvidence(new Evidence("grokassembly" , "version" ,
154
-
- 155 2 final String vendor = xpath.evaluate("/assembly/company" , doc);
- 156 2 if (vendor != null ) {
- 157 2 dependency.getVendorEvidence().addEvidence(new Evidence("grokassembly" , "vendor" ,
- 158
- vendor, Confidence.HIGH));
- 159
+ version, Confidence.HIGHEST));
+ 155
}
+ 156
+
+ 157 2 final String vendor = xpath.evaluate("/assembly/company" , doc);
+ 158 2 if (vendor != null ) {
+ 159 2 dependency.getVendorEvidence().addEvidence(new Evidence("grokassembly" , "vendor" ,
160
-
- 161 2 final String product = xpath.evaluate("/assembly/product" , doc);
- 162 2 if (product != null ) {
- 163 2 dependency.getProductEvidence().addEvidence(new Evidence("grokassembly" , "product" ,
- 164
- product, Confidence.HIGH));
- 165
+ vendor, Confidence.HIGH));
+ 161
}
+ 162
+
+ 163 2 final String product = xpath.evaluate("/assembly/product" , doc);
+ 164 2 if (product != null ) {
+ 165 2 dependency.getProductEvidence().addEvidence(new Evidence("grokassembly" , "product" ,
166
+ product, Confidence.HIGH));
+ 167
+ }
+ 168
- 167 0 } catch (IOException ioe) {
- 168 0 throw new AnalysisException(ioe);
- 169 0 } catch (SAXException saxe) {
- 170 0 throw new AnalysisException("Couldn't parse GrokAssembly result" , saxe);
- 171 0 } catch (XPathExpressionException xpe) {
- 172
-
- 173 0 throw new AnalysisException(xpe);
+ 169 0 } catch (IOException ioe) {
+ 170 0 throw new AnalysisException(ioe);
+ 171 0 } catch (SAXException saxe) {
+ 172 0 throw new AnalysisException("Couldn't parse GrokAssembly result" , saxe);
+ 173 0 } catch (XPathExpressionException xpe) {
174
- } finally {
- 175 3 if (rdr != null ) {
+
+ 175 0 throw new AnalysisException(xpe);
176
+ } finally {
+ 177 3 if (rdr != null ) {
+ 178
try {
- 177 3 rdr.close();
- 178 0 } catch (IOException ex) {
- 179 0 LOGGER.log(Level.FINEST, "ignore" , ex);
- 180 4 }
- 181
+ 179 3 rdr.close();
+ 180 0 } catch (IOException ex) {
+ 181 0 LOGGER.log(Level.FINEST, "ignore" , ex);
+ 182 4 }
+ 183
}
- 182
- }
- 183 2 }
184
-
- 185
-
+ }
+ 185 2 }
186
-
+
187
-
+
188
-
+
189
-
+
190
- @Override
+
191
+
+ 192
+ @Override
+ 193
public void initializeFileTypeAnalyzer() throws Exception {
- 192 5 final File tempFile = File.createTempFile("GKA" , ".exe" , Settings.getTempDirectory());
- 193 5 FileOutputStream fos = null ;
- 194 5 InputStream is = null ;
- 195
+ 194 5 final File tempFile = File.createTempFile("GKA" , ".exe" , Settings.getTempDirectory());
+ 195 5 FileOutputStream fos = null ;
+ 196 5 InputStream is = null ;
+ 197
try {
- 196 5 fos = new FileOutputStream(tempFile);
- 197 5 is = AssemblyAnalyzer.class .getClassLoader().getResourceAsStream("GrokAssembly.exe" );
- 198 5 final byte [] buff = new byte [4096];
- 199 5 int bread = -1;
- 200 15 while ((bread = is.read(buff)) >= 0) {
- 201 10 fos.write(buff, 0, bread);
- 202
- }
- 203 5 grokAssemblyExe = tempFile;
+ 198 5 fos = new FileOutputStream(tempFile);
+ 199 5 is = AssemblyAnalyzer.class .getClassLoader().getResourceAsStream("GrokAssembly.exe" );
+ 200 5 final byte [] buff = new byte [4096];
+ 201 5 int bread = -1;
+ 202 15 while ((bread = is.read(buff)) >= 0) {
+ 203 10 fos.write(buff, 0, bread);
204
+ }
+ 205 5 grokAssemblyExe = tempFile;
+ 206
- 205 5 grokAssemblyExe.deleteOnExit();
- 206 5 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.deployed" , grokAssemblyExe.getPath());
- 207 0 } catch (IOException ioe) {
- 208 0 this .setEnabled(false );
- 209 0 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.notdeployed" , ioe.getMessage());
- 210 0 throw new AnalysisException("Could not extract GrokAssembly.exe" , ioe);
- 211
- } finally {
- 212 5 if (fos != null ) {
+ 207 5 grokAssemblyExe.deleteOnExit();
+ 208 5 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.deployed" , grokAssemblyExe.getPath());
+ 209 0 } catch (IOException ioe) {
+ 210 0 this .setEnabled(false );
+ 211 0 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.notdeployed" , ioe.getMessage());
+ 212 0 throw new AnalysisException("Could not extract GrokAssembly.exe" , ioe);
213
- try {
- 214 5 fos.close();
- 215 0 } catch (Throwable e) {
- 216 0 LOGGER.fine("Error closing output stream" );
- 217 5 }
- 218
- }
- 219 5 if (is != null ) {
- 220
- try {
- 221 5 is.close();
- 222 0 } catch (Throwable e) {
- 223 0 LOGGER.fine("Error closing input stream" );
- 224 5 }
- 225
- }
- 226
- }
- 227
-
- 228
-
- 229 5 final List<String> args = buildArgumentList();
- 230 5 BufferedReader rdr = null ;
- 231
- try {
- 232 5 final ProcessBuilder pb = new ProcessBuilder(args);
- 233 5 final Process p = pb.start();
- 234
-
- 235 5 rdr = new BufferedReader(new InputStreamReader(p.getErrorStream(), "UTF-8" ));
- 236 5 while (rdr.ready() && rdr.readLine() != null ) {
- 237
-
- 238
- }
- 239 5 final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
- 240 5 final XPath xpath = XPathFactory.newInstance().newXPath();
- 241 5 final String error = xpath.evaluate("/assembly/error" , doc);
- 242 5 if (p.waitFor() != 1 || error == null || "" .equals(error)) {
- 243 0 LOGGER.warning("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details." );
- 244 0 LOGGER.fine("GrokAssembly.exe is not working properly" );
- 245 0 grokAssemblyExe = null ;
- 246 0 this .setEnabled(false );
- 247 0 throw new AnalysisException("Could not execute .NET AssemblyAnalyzer" );
- 248
- }
- 249 0 } catch (Throwable e) {
- 250 0 if (e instanceof AnalysisException) {
- 251 0 throw (AnalysisException) e;
- 252
- } else {
- 253 0 LOGGER.warning("analyzer.AssemblyAnalyzer.grokassembly.initialization.failed" );
- 254 0 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.initialization.message" , e.getMessage());
- 255 0 this .setEnabled(false );
- 256 0 throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer" , e);
- 257
- }
- 258
} finally {
- 259 5 if (rdr != null ) {
- 260
+ 214 5 if (fos != null ) {
+ 215
try {
- 261 5 rdr.close();
- 262 0 } catch (IOException ex) {
- 263 0 LOGGER.log(Level.FINEST, "ignore" , ex);
- 264 5 }
- 265
+ 216 5 fos.close();
+ 217 0 } catch (Throwable e) {
+ 218 0 LOGGER.fine("Error closing output stream" );
+ 219 5 }
+ 220
}
- 266
+ 221 5 if (is != null ) {
+ 222
+ try {
+ 223 5 is.close();
+ 224 0 } catch (Throwable e) {
+ 225 0 LOGGER.fine("Error closing input stream" );
+ 226 5 }
+ 227
+ }
+ 228
}
- 267 5 builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- 268 5 }
- 269
+ 229
- 270
- @Override
- 271
- public void close() throws Exception {
- 272 6 super .close();
- 273
+ 230
+
+ 231 5 final List<String> args = buildArgumentList();
+ 232 5 BufferedReader rdr = null ;
+ 233
try {
- 274 6 if (grokAssemblyExe != null && !grokAssemblyExe.delete()) {
- 275 0 grokAssemblyExe.deleteOnExit();
- 276
+ 234 5 final ProcessBuilder pb = new ProcessBuilder(args);
+ 235 5 final Process p = pb.start();
+ 236
+
+ 237 5 rdr = new BufferedReader(new InputStreamReader(p.getErrorStream(), "UTF-8" ));
+ 238
+
+ 239 5 while (rdr.ready() && rdr.readLine() != null ) {
+ 240
+
+ 241
}
- 277 0 } catch (SecurityException se) {
- 278 0 LOGGER.fine("analyzer.AssemblyAnalyzer.grokassembly.notdeleted" );
- 279 6 }
- 280 6 }
- 281
+ 242
+
+ 243 5 final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
+ 244 5 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 245 5 final String error = xpath.evaluate("/assembly/error" , doc);
+ 246 5 if (p.waitFor() != 1 || error == null || "" .equals(error)) {
+ 247 0 LOGGER.warning("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details." );
+ 248 0 LOGGER.fine("GrokAssembly.exe is not working properly" );
+ 249 0 grokAssemblyExe = null ;
+ 250 0 this .setEnabled(false );
+ 251 0 throw new AnalysisException("Could not execute .NET AssemblyAnalyzer" );
+ 252
+ }
+ 253 0 } catch (Throwable e) {
+ 254 0 if (e instanceof AnalysisException) {
+ 255 0 throw (AnalysisException) e;
+ 256
+ } else {
+ 257 0 LOGGER.warning("analyzer.AssemblyAnalyzer.grokassembly.initialization.failed" );
+ 258 0 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.initialization.message" , e.getMessage());
+ 259 0 this .setEnabled(false );
+ 260 0 throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer" , e);
+ 261
+ }
+ 262
+ } finally {
+ 263 5 if (rdr != null ) {
+ 264
+ try {
+ 265 5 rdr.close();
+ 266 0 } catch (IOException ex) {
+ 267 0 LOGGER.log(Level.FINEST, "ignore" , ex);
+ 268 5 }
+ 269
+ }
+ 270
+ }
+ 271 5 builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ 272 5 }
+ 273
- 282
-
- 283
-
- 284
-
+ 274
+ @Override
+ 275
+ public void close() throws Exception {
+ 276 6 super .close();
+ 277
+ try {
+ 278 6 if (grokAssemblyExe != null && !grokAssemblyExe.delete()) {
+ 279 0 grokAssemblyExe.deleteOnExit();
+ 280
+ }
+ 281 0 } catch (SecurityException se) {
+ 282 0 LOGGER.fine("analyzer.AssemblyAnalyzer.grokassembly.notdeleted" );
+ 283 6 }
+ 284 6 }
285
-
+
286
-
+
287
- @Override
+
288
- public Set<String> getSupportedExtensions() {
- 289 853 return SUPPORTED_EXTENSIONS;
+
+ 289
+
290
- }
+
291
-
+ @Override
292
-
- 293
-
+ public Set<String> getSupportedExtensions() {
+ 293 853 return SUPPORTED_EXTENSIONS;
294
-
+ }
295
-
+
296
-
+
297
- @Override
+
298
- public String getName() {
- 299 5 return ANALYZER_NAME;
+
+ 299
+
300
- }
+
301
-
+ @Override
302
-
- 303
-
+ public String getName() {
+ 303 5 return ANALYZER_NAME;
304
-
+ }
305
-
- 306
-
- 307
- @Override
- 308
- public AnalysisPhase getAnalysisPhase() {
- 309 1 return ANALYSIS_PHASE;
- 310
- }
- 311
- 312
+ 306
- 313
-
- 314
+ 307
+
+ 308
- 315
-
- 316
+ 309
+
+ 310
- 317
+ 311
@Override
- 318
- protected String getAnalyzerEnabledSettingKey() {
- 319 7 return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED;
- 320
+ 312
+ public AnalysisPhase getAnalysisPhase() {
+ 313 1 return ANALYSIS_PHASE;
+ 314
}
+ 315
+
+ 316
+
+ 317
+
+ 318
+
+ 319
+
+ 320
+
321
+ @Override
+ 322
+ protected String getAnalyzerEnabledSettingKey() {
+ 323 7 return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED;
+ 324
+ }
+ 325
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
index 8a9b7fc3f..b3532fd81 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CPEAnalyzer.html
@@ -12,9 +12,9 @@
@@ -369,947 +369,957 @@
189 6 final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
190
dependency.getVendorEvidence().getWeighting());
- 191
-
- 192 6 boolean identifierAdded = false ;
- 193 6 for (IndexEntry e : entries) {
- 194 23 if (verifyEntry(e, dependency)) {
- 195 2 final String vendor = e.getVendor();
- 196 2 final String product = e.getProduct();
- 197 2 identifierAdded |= determineIdentifiers(dependency, vendor, product, confidence);
- 198
- }
- 199 23 }
- 200 6 if (identifierAdded) {
- 201 1 break ;
- 202
+ 191 6 if (entries == null ) {
+ 192 0 continue ;
+ 193
}
- 203
- }
+ 194 6 boolean identifierAdded = false ;
+ 195 6 for (IndexEntry e : entries) {
+ 196 23 if (verifyEntry(e, dependency)) {
+ 197 2 final String vendor = e.getVendor();
+ 198 2 final String product = e.getProduct();
+ 199 2 identifierAdded |= determineIdentifiers(dependency, vendor, product, confidence);
+ 200
+ }
+ 201 23 }
+ 202 6 if (identifierAdded) {
+ 203 1 break ;
204
- }
- 205 2 }
+ }
+ 205
+ }
206
-
- 207
-
- 208
-
- 209
-
- 210
-
- 211
-
- 212
-
- 213
-
- 214
-
- 215
-
- 216
-
- 217
- private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
- 218 11 final String txt = (text == null ) ? "" : text;
- 219 11 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
- 220 11 sb.append(' ' ).append(txt).append(' ' );
- 221 11 for (Evidence e : ec.iterator(confidenceFilter)) {
- 222 39 String value = e.getValue();
- 223
-
- 224
-
- 225
-
- 226 39 if (value.startsWith("http://" )) {
- 227 2 value = value.substring(7).replaceAll("\\." , " " );
- 228
- }
- 229 39 if (value.startsWith("https://" )) {
- 230 0 value = value.substring(8).replaceAll("\\." , " " );
- 231
- }
- 232 39 if (sb.indexOf(" " + value + " " ) < 0) {
- 233 34 sb.append(value).append(' ' );
- 234
- }
- 235 39 }
- 236 11 return sb.toString().trim();
- 237
- }
- 238
-
- 239
-
- 240
-
- 241
-
- 242
-
- 243
-
- 244
-
- 245
-
- 246
-
- 247
-
- 248
-
- 249
-
- 250
-
- 251
-
- 252
-
- 253
-
- 254
-
- 255
-
- 256
-
- 257
- protected List<IndexEntry> searchCPE(String vendor, String product,
- 258
- Set<String> vendorWeightings, Set<String> productWeightings)
- 259
- throws CorruptIndexException, IOException, ParseException {
- 260 6 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
- 261
-
- 262 6 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
- 263 6 if (searchString == null ) {
- 264 0 return ret;
- 265
}
- 266
+ 207 2 }
+ 208
- 267 6 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
- 268 156 for (ScoreDoc d : docs.scoreDocs) {
- 269 150 if (d.score >= 0.08) {
- 270 23 final Document doc = cpe.getDocument(d.doc);
- 271 23 final IndexEntry entry = new IndexEntry();
- 272 23 entry.setVendor(doc.get(Fields.VENDOR));
- 273 23 entry.setProduct(doc.get(Fields.PRODUCT));
- 274
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+
+ 219
+ private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
+ 220 11 final String txt = (text == null ) ? "" : text;
+ 221 11 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
+ 222 11 sb.append(' ' ).append(txt).append(' ' );
+ 223 11 for (Evidence e : ec.iterator(confidenceFilter)) {
+ 224 43 String value = e.getValue();
+ 225
+
+ 226
+
+ 227
+
+ 228 43 if (value.startsWith("http://" )) {
+ 229 2 value = value.substring(7).replaceAll("\\." , " " );
+ 230
+ }
+ 231 43 if (value.startsWith("https://" )) {
+ 232 0 value = value.substring(8).replaceAll("\\." , " " );
+ 233
+ }
+ 234 43 if (sb.indexOf(" " + value + " " ) < 0) {
+ 235 36 sb.append(value).append(' ' );
+ 236
+ }
+ 237 43 }
+ 238 11 return sb.toString().trim();
+ 239
+ }
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+
+ 251
+
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+ protected List<IndexEntry> searchCPE(String vendor, String product,
+ 257
+ Set<String> vendorWeightings, Set<String> productWeightings) {
+ 258
+
+ 259 6 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
+ 260
+
+ 261 6 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
+ 262 6 if (searchString == null ) {
+ 263 0 return ret;
+ 264
+ }
+ 265
+ try {
+ 266 6 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
+ 267 156 for (ScoreDoc d : docs.scoreDocs) {
+ 268 150 if (d.score >= 0.08) {
+ 269 23 final Document doc = cpe.getDocument(d.doc);
+ 270 23 final IndexEntry entry = new IndexEntry();
+ 271 23 entry.setVendor(doc.get(Fields.VENDOR));
+ 272 23 entry.setProduct(doc.get(Fields.PRODUCT));
+ 273
- 275
+ 274
+ 275
+
276
-
- 277
- 278
+ 277
- 279
+ 278
- 280
+ 279
- 281 23 entry.setSearchScore(d.score);
- 282 23 if (!ret.contains(entry)) {
- 283 23 ret.add(entry);
+ 280 23 entry.setSearchScore(d.score);
+ 281 23 if (!ret.contains(entry)) {
+ 282 23 ret.add(entry);
+ 283
+ }
284
}
285
}
- 286
- }
- 287 6 return ret;
- 288
- }
- 289
-
- 290
-
- 291
-
- 292
-
- 293
-
- 294
-
- 295
-
- 296
-
+ 286 6 return ret;
+ 287 0 } catch (ParseException ex) {
+ 288 0 final String msg = String.format("Unable to parse: %s" , searchString);
+ 289 0 LOGGER.log(Level.WARNING, "An error occured querying the CPE data. See the log for more details." );
+ 290 0 LOGGER.log(Level.INFO, msg, ex);
+ 291 0 } catch (IOException ex) {
+ 292 0 final String msg = String.format("IO Error with search string: %s" , searchString);
+ 293 0 LOGGER.log(Level.WARNING, "An error occured reading CPE data. See the log for more details." );
+ 294 0 LOGGER.log(Level.INFO, msg, ex);
+ 295 0 }
+ 296 0 return null ;
297
-
+ }
298
-
+
299
-
+
300
-
+
301
-
+
302
-
+
303
-
+
304
- protected String buildSearch(String vendor, String product,
+
305
- Set<String> vendorWeighting, Set<String> productWeightings) {
- 306 6 final String v = vendor;
- 307 6 final String p = product;
- 308 6 final StringBuilder sb = new StringBuilder(v.length() + p.length()
+
+ 306
+
+ 307
+
+ 308
+
309
- + Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER);
+
310
-
- 311 6 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
- 312 0 return null ;
+
+ 311
+
+ 312
+
313
- }
- 314 6 sb.append(" AND " );
- 315 6 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
- 316 0 return null ;
- 317
- }
- 318 6 return sb.toString();
+ protected String buildSearch(String vendor, String product,
+ 314
+ Set<String> vendorWeighting, Set<String> productWeightings) {
+ 315 6 final String v = vendor;
+ 316 6 final String p = product;
+ 317 6 final StringBuilder sb = new StringBuilder(v.length() + p.length()
+ 318
+ + Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER);
319
- }
- 320
- 321
-
+ 320 6 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
+ 321 0 return null ;
322
-
- 323
-
- 324
-
- 325
-
+ }
+ 323 6 sb.append(" AND " );
+ 324 6 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
+ 325 0 return null ;
326
-
- 327
-
+ }
+ 327 6 return sb.toString();
328
-
+ }
329
-
+
330
-
+
331
-
+
332
- private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) {
- 333 12 sb.append(" " ).append(field).append(":( " );
+
+ 333
+
334
-
- 335 12 final String cleanText = cleanseText(searchText);
+
+ 335
+
336
-
- 337 12 if ("" .equals(cleanText)) {
- 338 0 return false ;
+
+ 337
+
+ 338
+
339
- }
+
340
-
- 341 12 if (weightedText == null || weightedText.isEmpty()) {
- 342 0 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
+
+ 341
+ private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) {
+ 342 12 sb.append(" " ).append(field).append(":( " );
343
+
+ 344 12 final String cleanText = cleanseText(searchText);
+ 345
+
+ 346 12 if ("" .equals(cleanText)) {
+ 347 0 return false ;
+ 348
+ }
+ 349
+
+ 350 12 if (weightedText == null || weightedText.isEmpty()) {
+ 351 0 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
+ 352
} else {
- 344 12 final StringTokenizer tokens = new StringTokenizer(cleanText);
- 345 108 while (tokens.hasMoreElements()) {
- 346 96 final String word = tokens.nextToken();
- 347 96 String temp = null ;
- 348 96 for (String weighted : weightedText) {
- 349 215 final String weightedStr = cleanseText(weighted);
- 350 215 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
- 351 22 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
- 352 22 if (!word.equalsIgnoreCase(weightedStr)) {
- 353 0 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
- 354
+ 353 12 final StringTokenizer tokens = new StringTokenizer(cleanText);
+ 354 114 while (tokens.hasMoreElements()) {
+ 355 102 final String word = tokens.nextToken();
+ 356 102 String temp = null ;
+ 357 102 for (String weighted : weightedText) {
+ 358 225 final String weightedStr = cleanseText(weighted);
+ 359 225 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
+ 360 22 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
+ 361 22 if (!word.equalsIgnoreCase(weightedStr)) {
+ 362 0 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
+ 363
}
- 355
+ 364
}
- 356 215 }
- 357 96 if (temp == null ) {
- 358 74 temp = LuceneUtils.escapeLuceneQuery(word);
- 359
- }
- 360 96 sb.append(" " ).append(temp);
- 361 96 }
- 362
- }
- 363 12 sb.append(" ) " );
- 364 12 return true ;
- 365
- }
- 366
-
- 367
-
+ 365 225 }
+ 366 102 if (temp == null ) {
+ 367 80 temp = LuceneUtils.escapeLuceneQuery(word);
368
-
- 369
-
- 370
-
+ }
+ 369 102 sb.append(" " ).append(temp);
+ 370 102 }
371
-
- 372
-
- 373
- private String cleanseText(String text) {
- 374 227 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
+ }
+ 372 12 sb.append(" ) " );
+ 373 12 return true ;
+ 374
+ }
375
- }
+
376
-
+
377
-
+
378
-
+
379
-
+
380
-
+
381
-
+
382
-
- 383
-
+ private String cleanseText(String text) {
+ 383 237 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
384
- private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
- 385 215 if (l == null || r == null ) {
- 386 0 return false ;
+ }
+ 385
+
+ 386
+
387
- }
+
388
-
- 389 215 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 390 215 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
- 391 215 return left.equalsIgnoreCase(right);
+
+ 389
+
+ 390
+
+ 391
+
392
- }
+
393
-
- 394
-
- 395
-
+ private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
+ 394 225 if (l == null || r == null ) {
+ 395 0 return false ;
396
-
- 397
-
- 398
-
- 399
-
- 400
-
- 401
-
- 402
- private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
- 403 23 boolean isValid = false ;
- 404
-
- 405 23 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
- 406
- && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
- 407
-
- 408 2 isValid = true ;
- 409
}
- 410 23 return isValid;
- 411
- }
- 412
+ 397
- 413
+ 398 225 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 399 225 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
+ 400 225 return left.equalsIgnoreCase(right);
+ 401
+ }
+ 402
+
+ 403
- 414
-
- 415
+ 404
+
+ 405
+
+ 406
- 416
-
- 417
-
- 418
-
- 419
+ 407
+
+ 408
+
+ 409
+
+ 410
+ 411
+ private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
+ 412 23 boolean isValid = false ;
+ 413
+
+ 414 23 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
+ 415
+ && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
+ 416
+
+ 417 2 isValid = true ;
+ 418
+ }
+ 419 23 return isValid;
420
- private boolean collectionContainsString(EvidenceCollection ec, String text) {
+ }
421
422
-
+
423
-
+
424
-
+
425
-
+
426
-
+
427
-
+
428
-
+
429
-
+ private boolean collectionContainsString(EvidenceCollection ec, String text) {
430
-
+
431
-
+
432
-
- 433 25 if (text == null ) {
- 434 0 return false ;
+
+ 433
+
+ 434
+
435
- }
- 436 25 final String[] words = text.split("[\\s_-]" );
- 437 25 final List<String> list = new ArrayList<String>();
- 438 25 String tempWord = null ;
- 439 83 for (String word : words) {
+
+ 436
+
+ 437
+
+ 438
+
+ 439
+
440
-
- 441
-
- 442
-
- 443
-
- 444 58 if (tempWord != null ) {
- 445 2 list.add(tempWord + word);
- 446 2 tempWord = null ;
- 447 56 } else if (word.length() <= 2) {
- 448 2 tempWord = word;
- 449
- } else {
- 450 54 list.add(word);
- 451
- }
- 452
- }
- 453 25 if (tempWord != null && !list.isEmpty()) {
- 454 0 final String tmp = list.get(list.size() - 1) + tempWord;
- 455 0 list.add(tmp);
- 456
- }
- 457 25 boolean contains = true ;
- 458 25 for (String word : list) {
- 459 56 contains &= ec.containsUsedString(word);
- 460 56 }
- 461 25 return contains;
- 462
- }
- 463
-
- 464
-
- 465
-
- 466
-
- 467
-
- 468
-
- 469
-
- 470
-
- 471
- @Override
- 472
- public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
- 473
- try {
- 474 2 determineCPE(dependency);
- 475 0 } catch (CorruptIndexException ex) {
- 476 0 throw new AnalysisException("CPE Index is corrupt." , ex);
- 477 0 } catch (IOException ex) {
- 478 0 throw new AnalysisException("Failure opening the CPE Index." , ex);
- 479 0 } catch (ParseException ex) {
- 480 0 throw new AnalysisException("Unable to parse the generated Lucene query for this dependency." , ex);
- 481 2 }
- 482 2 }
- 483
-
- 484
-
- 485
-
- 486
-
- 487
-
- 488
-
- 489
-
- 490
-
- 491
-
- 492
-
- 493
-
- 494
-
- 495
- private boolean determineIdentifiers(Dependency dependency, String vendor, String product, Confidence currentConfidence) throws UnsupportedEncodingException {
- 496 2 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
- 497 2 DependencyVersion bestGuess = new DependencyVersion("-" );
- 498 2 Confidence bestGuessConf = null ;
- 499 2 boolean hasBroadMatch = false ;
- 500 2 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
- 501 10 for (Confidence conf : Confidence.values()) {
- 502
-
- 503
-
- 504
-
- 505 8 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
- 506 8 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
- 507 8 if (evVer == null ) {
- 508 0 continue ;
- 509
- }
- 510 8 for (VulnerableSoftware vs : cpes) {
- 511
- DependencyVersion dbVer;
- 512 312 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
- 513 128 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + "." + vs.getRevision());
- 514
- } else {
- 515 184 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
- 516
- }
- 517 312 if (dbVer == null ) {
- 518 0 hasBroadMatch = true ;
- 519 0 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
- 520 0 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.BROAD_MATCH, conf);
- 521 0 collected.add(match);
- 522 0 } else if (evVer.equals(dbVer)) {
- 523 8 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
- 524 8 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
- 525 8 collected.add(match);
- 526 8 } else {
- 527
-
- 528 304 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
- 529
- && evVer.matchesAtLeastThreeLevels(dbVer)) {
- 530 64 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
- 531 2 if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) {
- 532 2 bestGuess = dbVer;
- 533 2 bestGuessConf = conf;
- 534
- }
- 535
- }
- 536
- }
- 537
- }
- 538 312 }
- 539 8 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
- 540 0 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
- 541 0 bestGuess = evVer;
- 542 0 bestGuessConf = conf;
- 543
- }
- 544
- }
- 545 8 }
- 546
- }
- 547 2 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
- 548 2 String url = null ;
- 549 2 if (hasBroadMatch) {
- 550 0 final String cpeUrlName = String.format("cpe:/a:%s:%s" , vendor, product);
- 551 0 url = String.format(NVD_SEARCH_URL, URLEncoder.encode(cpeUrlName, "UTF-8" ));
- 552
- }
- 553 2 if (bestGuessConf == null ) {
- 554 0 bestGuessConf = Confidence.LOW;
- 555
- }
- 556 2 final IdentifierMatch match = new IdentifierMatch("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
- 557 2 collected.add(match);
- 558
-
- 559 2 Collections.sort(collected);
- 560 2 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
- 561 2 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
- 562 2 boolean identifierAdded = false ;
- 563 2 for (IdentifierMatch m : collected) {
- 564 10 if (bestIdentifierQuality.equals(m.getConfidence())
- 565
- && bestEvidenceQuality.equals(m.getEvidenceConfidence())) {
- 566 2 final Identifier i = m.getIdentifier();
- 567 2 if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) {
- 568 0 i.setConfidence(Confidence.LOW);
- 569
- } else {
- 570 2 i.setConfidence(bestEvidenceQuality);
- 571
- }
- 572 2 dependency.addIdentifier(i);
- 573 2 identifierAdded = true ;
- 574
- }
- 575 10 }
- 576 2 return identifierAdded;
- 577
- }
- 578
-
- 579
-
- 580
-
- 581
-
- 582 1 private enum IdentifierConfidence {
- 583
-
- 584
-
- 585
-
- 586
-
- 587 1 EXACT_MATCH,
- 588
-
- 589
-
- 590
-
- 591 1 BEST_GUESS,
- 592
-
- 593
-
- 594
-
- 595
-
- 596 1 BROAD_MATCH
- 597
- }
- 598
-
- 599
-
- 600
-
- 601
-
- 602 8 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
- 603
-
- 604
-
- 605
-
- 606
-
- 607
-
- 608
-
- 609
-
- 610
-
- 611
-
- 612
-
- 613 10 IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
- 614 10 this .identifier = new Identifier(type, value, url);
- 615 10 this .confidence = identifierConfidence;
- 616 10 this .evidenceConfidence = evidenceConfidence;
- 617 10 }
- 618
-
- 619
-
- 620
-
- 621
-
- 622
- private Confidence evidenceConfidence;
- 623
-
- 624
-
- 625
-
- 626
-
- 627
-
- 628
-
- 629
- public Confidence getEvidenceConfidence() {
- 630
- return evidenceConfidence;
- 631
- }
- 632
-
- 633
-
- 634
-
- 635
-
- 636
-
- 637
-
- 638
- public void setEvidenceConfidence(Confidence evidenceConfidence) {
- 639
- this .evidenceConfidence = evidenceConfidence;
- 640
- }
- 641
-
- 642
-
- 643
-
- 644
- private IdentifierConfidence confidence;
- 645
-
- 646
-
- 647
-
- 648
-
- 649
-
- 650
-
- 651
- public IdentifierConfidence getConfidence() {
- 652
- return confidence;
- 653
- }
- 654
-
- 655
-
- 656
-
- 657
-
- 658
-
- 659
-
- 660
- public void setConfidence(IdentifierConfidence confidence) {
- 661
- this .confidence = confidence;
- 662
- }
- 663
-
- 664
-
- 665
-
- 666
- private Identifier identifier;
- 667
-
- 668
-
- 669
-
- 670
-
- 671
-
- 672
-
- 673
- public Identifier getIdentifier() {
- 674
- return identifier;
- 675
- }
- 676
-
- 677
-
- 678
-
- 679
-
- 680
-
- 681
-
- 682
- public void setIdentifier(Identifier identifier) {
- 683
- this .identifier = identifier;
- 684
- }
- 685
+ 441
+
+ 442 25 if (text == null ) {
+ 443 0 return false ;
+ 444
+ }
+ 445 25 final String[] words = text.split("[\\s_-]" );
+ 446 25 final List<String> list = new ArrayList<String>();
+ 447 25 String tempWord = null ;
+ 448 83 for (String word : words) {
+ 449
+
+ 450
+
+ 451
+
+ 452
+
+ 453 58 if (tempWord != null ) {
+ 454 2 list.add(tempWord + word);
+ 455 2 tempWord = null ;
+ 456 56 } else if (word.length() <= 2) {
+ 457 2 tempWord = word;
+ 458
+ } else {
+ 459 54 list.add(word);
+ 460
+ }
+ 461
+ }
+ 462 25 if (tempWord != null && !list.isEmpty()) {
+ 463 0 final String tmp = list.get(list.size() - 1) + tempWord;
+ 464 0 list.add(tmp);
+ 465
+ }
+ 466 25 boolean contains = true ;
+ 467 25 for (String word : list) {
+ 468 56 contains &= ec.containsUsedString(word);
+ 469 56 }
+ 470 25 return contains;
+ 471
+ }
+ 472
+
+ 473
+
+ 474
+
+ 475
+
+ 476
+
+ 477
+
+ 478
+
+ 479
+
+ 480
+ @Override
+ 481
+ public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
+ 482
+ try {
+ 483 2 determineCPE(dependency);
+ 484 0 } catch (CorruptIndexException ex) {
+ 485 0 throw new AnalysisException("CPE Index is corrupt." , ex);
+ 486 0 } catch (IOException ex) {
+ 487 0 throw new AnalysisException("Failure opening the CPE Index." , ex);
+ 488 0 } catch (ParseException ex) {
+ 489 0 throw new AnalysisException("Unable to parse the generated Lucene query for this dependency." , ex);
+ 490 2 }
+ 491 2 }
+ 492
+
+ 493
+
+ 494
+
+ 495
+
+ 496
+
+ 497
+
+ 498
+
+ 499
+
+ 500
+
+ 501
+
+ 502
+
+ 503
+
+ 504
+
+ 505
+ protected boolean determineIdentifiers(Dependency dependency, String vendor, String product,
+ 506
+ Confidence currentConfidence) throws UnsupportedEncodingException {
+ 507 2 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
+ 508 2 DependencyVersion bestGuess = new DependencyVersion("-" );
+ 509 2 Confidence bestGuessConf = null ;
+ 510 2 boolean hasBroadMatch = false ;
+ 511 2 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
+ 512 10 for (Confidence conf : Confidence.values()) {
+ 513
+
+ 514
+
+ 515
+
+ 516 8 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
+ 517 10 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
+ 518 10 if (evVer == null ) {
+ 519 0 continue ;
+ 520
+ }
+ 521 10 for (VulnerableSoftware vs : cpes) {
+ 522
+ DependencyVersion dbVer;
+ 523 390 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
+ 524 160 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + "." + vs.getRevision());
+ 525
+ } else {
+ 526 230 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
+ 527
+ }
+ 528 390 if (dbVer == null ) {
+ 529 0 hasBroadMatch = true ;
+ 530 0 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
+ 531 0 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.BROAD_MATCH, conf);
+ 532 0 collected.add(match);
+ 533 0 } else if (evVer.equals(dbVer)) {
+ 534 10 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
+ 535 10 final IdentifierMatch match = new IdentifierMatch("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
+ 536 10 collected.add(match);
+ 537 10 } else {
+ 538
+
+ 539 380 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
+ 540
+ && evVer.matchesAtLeastThreeLevels(dbVer)) {
+ 541 80 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
+ 542 2 if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) {
+ 543 2 bestGuess = dbVer;
+ 544 2 bestGuessConf = conf;
+ 545
+ }
+ 546
+ }
+ 547
+ }
+ 548
+ }
+ 549 390 }
+ 550 10 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
+ 551 0 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
+ 552 0 bestGuess = evVer;
+ 553 0 bestGuessConf = conf;
+ 554
+ }
+ 555
+ }
+ 556 10 }
+ 557
+ }
+ 558 2 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
+ 559 2 String url = null ;
+ 560 2 if (hasBroadMatch) {
+ 561 0 final String cpeUrlName = String.format("cpe:/a:%s:%s" , vendor, product);
+ 562 0 url = String.format(NVD_SEARCH_URL, URLEncoder.encode(cpeUrlName, "UTF-8" ));
+ 563
+ }
+ 564 2 if (bestGuessConf == null ) {
+ 565 0 bestGuessConf = Confidence.LOW;
+ 566
+ }
+ 567 2 final IdentifierMatch match = new IdentifierMatch("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
+ 568 2 collected.add(match);
+ 569
+
+ 570 2 Collections.sort(collected);
+ 571 2 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
+ 572 2 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
+ 573 2 boolean identifierAdded = false ;
+ 574 2 for (IdentifierMatch m : collected) {
+ 575 12 if (bestIdentifierQuality.equals(m.getConfidence())
+ 576
+ && bestEvidenceQuality.equals(m.getEvidenceConfidence())) {
+ 577 4 final Identifier i = m.getIdentifier();
+ 578 4 if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) {
+ 579 0 i.setConfidence(Confidence.LOW);
+ 580
+ } else {
+ 581 4 i.setConfidence(bestEvidenceQuality);
+ 582
+ }
+ 583 4 dependency.addIdentifier(i);
+ 584 4 identifierAdded = true ;
+ 585
+ }
+ 586 12 }
+ 587 2 return identifierAdded;
+ 588
+ }
+ 589
+
+ 590
+
+ 591
+
+ 592
+
+ 593 1 private enum IdentifierConfidence {
+ 594
+
+ 595
+
+ 596
+
+ 597
+
+ 598 1 EXACT_MATCH,
+ 599
+
+ 600
+
+ 601
+
+ 602 1 BEST_GUESS,
+ 603
+
+ 604
+
+ 605
+
+ 606
+
+ 607 1 BROAD_MATCH
+ 608
+ }
+ 609
+
+ 610
+
+ 611
+
+ 612
+
+ 613 10 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
+ 614
+
+ 615
+
+ 616
+
+ 617
+
+ 618
+
+ 619
+
+ 620
+
+ 621
+
+ 622
+
+ 623
+
+ 624 12 IdentifierMatch(String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
+ 625 12 this .identifier = new Identifier(type, value, url);
+ 626 12 this .confidence = identifierConfidence;
+ 627 12 this .evidenceConfidence = evidenceConfidence;
+ 628 12 }
+ 629
+
+ 630
+
+ 631
+
+ 632
+
+ 633
+ private Confidence evidenceConfidence;
+ 634
+
+ 635
+
+ 636
+
+ 637
+
+ 638
+
+ 639
+
+ 640
+ public Confidence getEvidenceConfidence() {
+ 641
+ return evidenceConfidence;
+ 642
+ }
+ 643
+
+ 644
+
+ 645
+
+ 646
+
+ 647
+
+ 648
+
+ 649
+ public void setEvidenceConfidence(Confidence evidenceConfidence) {
+ 650
+ this .evidenceConfidence = evidenceConfidence;
+ 651
+ }
+ 652
+
+ 653
+
+ 654
+
+ 655
+ private IdentifierConfidence confidence;
+ 656
+
+ 657
+
+ 658
+
+ 659
+
+ 660
+
+ 661
+
+ 662
+ public IdentifierConfidence getConfidence() {
+ 663
+ return confidence;
+ 664
+ }
+ 665
+
+ 666
+
+ 667
+
+ 668
+
+ 669
+
+ 670
+
+ 671
+ public void setConfidence(IdentifierConfidence confidence) {
+ 672
+ this .confidence = confidence;
+ 673
+ }
+ 674
+
+ 675
+
+ 676
+
+ 677
+ private Identifier identifier;
+ 678
+
+ 679
+
+ 680
+
+ 681
+
+ 682
+
+ 683
+
+ 684
+ public Identifier getIdentifier() {
+ 685
+ return identifier;
686
-
+ }
687
688
689
-
+
690
691
-
+
692
693
- @Override
+ public void setIdentifier(Identifier identifier) {
694
- public String toString() {
- 695 0 return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence
- 696
- + ", confidence=" + confidence + ", identifier=" + identifier + '}' ;
- 697
+ this .identifier = identifier;
+ 695
}
+ 696
+
+ 697
+
698
699
700
-
+
701
702
-
+
703
704
@Override
705
- public int hashCode() {
- 706 0 int hash = 5;
- 707 0 hash = 97 * hash + (this .evidenceConfidence != null ? this .evidenceConfidence.hashCode() : 0);
- 708 0 hash = 97 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
- 709 0 hash = 97 * hash + (this .identifier != null ? this .identifier.hashCode() : 0);
- 710 0 return hash;
+ public String toString() {
+ 706 0 return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence
+ 707
+ + ", confidence=" + confidence + ", identifier=" + identifier + '}' ;
+ 708
+ }
+ 709
+
+ 710
+
711
- }
+
712
-
+
713
-
+
714
-
+
715
-
+ @Override
716
-
- 717
-
- 718
-
- 719
- @Override
- 720
- public boolean equals(Object obj) {
- 721 0 if (obj == null ) {
- 722 0 return false ;
+ public int hashCode() {
+ 717 0 int hash = 5;
+ 718 0 hash = 97 * hash + (this .evidenceConfidence != null ? this .evidenceConfidence.hashCode() : 0);
+ 719 0 hash = 97 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
+ 720 0 hash = 97 * hash + (this .identifier != null ? this .identifier.hashCode() : 0);
+ 721 0 return hash;
+ 722
+ }
723
- }
- 724 0 if (getClass() != obj.getClass()) {
- 725 0 return false ;
- 726
- }
- 727 0 final IdentifierMatch other = (IdentifierMatch) obj;
- 728 0 if (this .evidenceConfidence != other.evidenceConfidence) {
- 729 0 return false ;
- 730
- }
- 731 0 if (this .confidence != other.confidence) {
- 732 0 return false ;
- 733
- }
- 734 0 if (this .identifier != other.identifier && (this .identifier == null || !this .identifier.equals(other.identifier))) {
- 735 0 return false ;
- 736
- }
- 737 0 return true ;
- 738
- }
- 739
-
- 740
- 741
+ 724
- 742
-
- 743
-
- 744
+ 725
+
+ 726
- 745
-
- 746
-
- 747
+ 727
+
+ 728
+
+ 729
- 748
+ 730
@Override
- 749
- public int compareTo(IdentifierMatch o) {
- 750 8 int conf = this .confidence.compareTo(o.confidence);
- 751 8 if (conf == 0) {
- 752 6 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
- 753 6 if (conf == 0) {
- 754 2 conf = identifier.compareTo(o.identifier);
- 755
- }
- 756
+ 731
+ public boolean equals(Object obj) {
+ 732 0 if (obj == null ) {
+ 733 0 return false ;
+ 734
}
- 757 8 return conf;
- 758
+ 735 0 if (getClass() != obj.getClass()) {
+ 736 0 return false ;
+ 737
+ }
+ 738 0 final IdentifierMatch other = (IdentifierMatch) obj;
+ 739 0 if (this .evidenceConfidence != other.evidenceConfidence) {
+ 740 0 return false ;
+ 741
+ }
+ 742 0 if (this .confidence != other.confidence) {
+ 743 0 return false ;
+ 744
+ }
+ 745 0 if (this .identifier != other.identifier && (this .identifier == null || !this .identifier.equals(other.identifier))) {
+ 746 0 return false ;
+ 747
+ }
+ 748 0 return true ;
+ 749
}
+ 750
+
+ 751
+
+ 752
+
+ 753
+
+ 754
+
+ 755
+
+ 756
+
+ 757
+
+ 758
+
759
- }
+ @Override
760
+ public int compareTo(IdentifierMatch o) {
+ 761 10 int conf = this .confidence.compareTo(o.confidence);
+ 762 10 if (conf == 0) {
+ 763 8 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
+ 764 8 if (conf == 0) {
+ 765 4 conf = identifier.compareTo(o.identifier);
+ 766
+ }
+ 767
+ }
+ 768 10 return conf;
+ 769
+ }
+ 770
+ }
+ 771
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
new file mode 100644
index 000000000..8b667c4c8
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CentralAnalyzer.html
@@ -0,0 +1,381 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.analyzer.CentralAnalyzer
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.analyzer;
+ 19
+
+ 20
+ import java.io.FileNotFoundException;
+ 21
+ import java.io.IOException;
+ 22
+ import java.net.URL;
+ 23
+ import java.util.List;
+ 24
+ import java.util.Set;
+ 25
+ import java.util.logging.Level;
+ 26
+ import java.util.logging.Logger;
+ 27
+ import org.owasp.dependencycheck.Engine;
+ 28
+ import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
+ 29
+ import org.owasp.dependencycheck.data.central.CentralSearch;
+ 30
+ import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+ 31
+ import org.owasp.dependencycheck.dependency.Confidence;
+ 32
+ import org.owasp.dependencycheck.dependency.Dependency;
+ 33
+ import org.owasp.dependencycheck.utils.InvalidSettingException;
+ 34
+ import org.owasp.dependencycheck.utils.Settings;
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42 2 public class CentralAnalyzer extends AbstractFileTypeAnalyzer {
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47 1 private static final Logger LOGGER = Logger.getLogger(CentralAnalyzer.class .getName());
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+ private static final String ANALYZER_NAME = "Central Analyzer" ;
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62 1 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68 2 private boolean errorFlag = false ;
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+ private CentralSearch searcher;
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78 2 private final boolean enabled = checkEnabled();
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+ @Override
+ 86
+ public boolean isEnabled() {
+ 87
+ return enabled;
+ 88
+ }
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+ private boolean checkEnabled() {
+ 96 2 boolean retval = false ;
+ 97
+
+ 98
+ try {
+ 99 2 if (Settings.getBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED)) {
+ 100 2 if (!Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED)
+ 101
+ || NexusAnalyzer.DEFAULT_URL.equals(Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL))) {
+ 102 2 LOGGER.info("Enabling the Central analyzer" );
+ 103 2 retval = true ;
+ 104
+ } else {
+ 105 0 LOGGER.info("Nexus analyzer is enabled, disabling the Central Analyzer" );
+ 106
+ }
+ 107
+ } else {
+ 108 0 LOGGER.info("Central analyzer disabled" );
+ 109
+ }
+ 110 0 } catch (InvalidSettingException ise) {
+ 111 0 LOGGER.warning("Invalid setting. Disabling the Central analyzer" );
+ 112 2 }
+ 113 2 return retval;
+ 114
+ }
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+ @Override
+ 122
+ public void initializeFileTypeAnalyzer() throws Exception {
+ 123 1 LOGGER.fine("Initializing Central analyzer" );
+ 124 1 LOGGER.fine(String.format("Central analyzer enabled: %s" , isEnabled()));
+ 125 1 if (isEnabled()) {
+ 126 1 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_CENTRAL_URL);
+ 127 1 LOGGER.fine(String.format("Central Analyzer URL: %s" , searchUrl));
+ 128 1 searcher = new CentralSearch(new URL(searchUrl));
+ 129
+ }
+ 130 1 }
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+ @Override
+ 138
+ public String getName() {
+ 139 4 return ANALYZER_NAME;
+ 140
+ }
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+ @Override
+ 148
+ protected String getAnalyzerEnabledSettingKey() {
+ 149 2 return Settings.KEYS.ANALYZER_CENTRAL_ENABLED;
+ 150
+ }
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+ @Override
+ 158
+ public AnalysisPhase getAnalysisPhase() {
+ 159 1 return ANALYSIS_PHASE;
+ 160
+ }
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+ @Override
+ 168
+ public Set<String> getSupportedExtensions() {
+ 169 850 return SUPPORTED_EXTENSIONS;
+ 170
+ }
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+ @Override
+ 180
+ public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
+ 181 2 if (errorFlag || !isEnabled()) {
+ 182 0 return ;
+ 183
+ }
+ 184
+
+ 185
+ try {
+ 186 2 final List<MavenArtifact> mas = searcher.searchSha1(dependency.getSha1sum());
+ 187 2 final Confidence confidence = mas.size() > 1 ? Confidence.HIGH : Confidence.HIGHEST;
+ 188 2 for (MavenArtifact ma : mas) {
+ 189 2 LOGGER.fine(String.format("Central analyzer found artifact (%s) for dependency (%s)" , ma.toString(), dependency.getFileName()));
+ 190 2 dependency.addAsEvidence("central" , ma, confidence);
+ 191 2 }
+ 192 0 } catch (IllegalArgumentException iae) {
+ 193 0 LOGGER.info(String.format("invalid sha1-hash on %s" , dependency.getFileName()));
+ 194 0 } catch (FileNotFoundException fnfe) {
+ 195 0 LOGGER.fine(String.format("Artifact not found in repository: '%s" , dependency.getFileName()));
+ 196 0 } catch (IOException ioe) {
+ 197 0 LOGGER.log(Level.FINE, "Could not connect to Central search" , ioe);
+ 198 0 errorFlag = true ;
+ 199 2 }
+ 200 2 }
+ 201
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
index dfb58a235..ff515e4a5 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.CpeSuppressionAnalyzer.html
@@ -153,13 +153,13 @@
70
71 2 for (final SuppressionRule rule : getRules()) {
- 72 10 rule.process(dependency);
- 73 10 }
+ 72 16 rule.process(dependency);
+ 73 16 }
74 2 }
75
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
index be7714e7d..e144c595d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer.html
@@ -12,7 +12,7 @@
@@ -229,7 +229,7 @@
112 2 while (subIterator.hasNext()) {
113 1 final Dependency nextDependency = subIterator.next();
114 1 if (hashesMatch(dependency, nextDependency)) {
- 115 0 if (isCore(dependency, nextDependency)) {
+ 115 0 if (firstPathIsShortest(dependency.getFilePath(), nextDependency.getFilePath())) {
116 0 mergeDependencies(dependency, nextDependency, dependenciesToRemove);
117
} else {
@@ -449,18 +449,18 @@
255 1 boolean matches = false ;
256 1 int cpeCount1 = 0;
257 1 int cpeCount2 = 0;
- 258 1 for (Identifier i : dependency1.getIdentifiers()) {
- 259 0 if ("cpe" .equals(i.getType())) {
+ 258 1 for (Identifier i : dependency1.getIdentifiers()) {
+ 259 1 if ("cpe" .equals(i.getType())) {
260 0 cpeCount1 += 1;
261
}
- 262 0 }
+ 262 1 }
263 1 for (Identifier i : dependency2.getIdentifiers()) {
- 264 2 if ("cpe" .equals(i.getType())) {
+ 264 3 if ("cpe" .equals(i.getType())) {
265 2 cpeCount2 += 1;
266
}
- 267 2 }
+ 267 3 }
268 1 if (cpeCount1 > 0 && cpeCount1 == cpeCount2) {
269 0 for (Identifier i : dependency1.getIdentifiers()) {
270 0 matches |= dependency2.getIdentifiers().contains(i);
@@ -661,9 +661,74 @@
392
}
393
+
+ 394
+
+ 395
+
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400
+
+ 401
+
+ 402
+ protected boolean firstPathIsShortest(String left, String right) {
+ 403 5 final String leftPath = left.replace('\\' , '/' );
+ 404 5 final String rightPath = right.replace('\\' , '/' );
+ 405
+
+ 406 5 final int leftCount = countChar(leftPath, '/' );
+ 407 5 final int rightCount = countChar(rightPath, '/' );
+ 408 5 if (leftCount == rightCount) {
+ 409 3 return leftPath.compareTo(rightPath) <= 0;
+ 410
+ } else {
+ 411 2 return leftCount < rightCount;
+ 412
+ }
+ 413
+ }
+ 414
+
+ 415
+
+ 416
+
+ 417
+
+ 418
+
+ 419
+
+ 420
+
+ 421
+
+ 422
+ private int countChar(String string, char c) {
+ 423 10 int count = 0;
+ 424 10 final int max = string.length();
+ 425 116 for (int i = 0; i < max; i++) {
+ 426 106 if (c == string.charAt(i)) {
+ 427 28 count++;
+ 428
+ }
+ 429
+ }
+ 430 10 return count;
+ 431
+ }
+ 432
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
index eba8da819..d692035f9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.html
@@ -12,7 +12,7 @@
@@ -196,582 +196,590 @@
95
96
- private void removeBadSpringMatches(Dependency dependency) {
- 97 3 String mustContain = null ;
- 98 3 for (Identifier i : dependency.getIdentifiers()) {
- 99 2 if ("maven" .contains(i.getType())) {
- 100 0 if (i.getValue() != null && i.getValue().startsWith("org.springframework." )) {
- 101 0 int endPoint = i.getValue().indexOf(":" , 19);
- 102 0 if (endPoint >= 0) {
- 103 0 mustContain = i.getValue().substring(19, endPoint).toLowerCase();
- 104 0 break ;
- 105
- }
- 106
- }
- 107
- }
- 108 2 }
- 109 3 if (mustContain != null ) {
- 110 0 Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
- 111 0 while (itr.hasNext()) {
- 112 0 Identifier i = itr.next();
- 113 0 if ("cpe" .contains(i.getType())
- 114
- && i.getValue() != null
- 115
- && i.getValue().startsWith("cpe:/a:springsource:" )
- 116
- && !i.getValue().toLowerCase().contains(mustContain)) {
- 117 0 itr.remove();
- 118
-
- 119
- }
- 120
-
- 121 0 }
- 122
- }
- 123 3 }
- 124
-
- 125
- 126
-
- 127
-
- 128
-
- 129
-
- 130
-
- 131
-
- 132
-
- 133
-
- 134
-
- 135
-
- 136
-
- 137
-
- 138
-
- 139
-
- 140
+ 97
+
+ 98
- 141
-
- 142
+ 99
+
+ 100
- 143
- @SuppressWarnings("null" )
- 144
- private void removeSpuriousCPE(Dependency dependency) {
- 145 3 final List<Identifier> ids = new ArrayList<Identifier>();
- 146 3 ids.addAll(dependency.getIdentifiers());
- 147 3 Collections.sort(ids);
- 148 3 final ListIterator<Identifier> mainItr = ids.listIterator();
- 149 5 while (mainItr.hasNext()) {
- 150 2 final Identifier currentId = mainItr.next();
- 151 2 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
- 152 2 if (currentCpe == null ) {
- 153 0 continue ;
- 154
- }
- 155 2 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
- 156 3 while (subItr.hasNext()) {
- 157 1 final Identifier nextId = subItr.next();
- 158 1 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
- 159 1 if (nextCpe == null ) {
- 160 0 continue ;
- 161
+ 101
+ private void removeBadSpringMatches(Dependency dependency) {
+ 102 3 String mustContain = null ;
+ 103 3 for (Identifier i : dependency.getIdentifiers()) {
+ 104 4 if ("maven" .contains(i.getType())) {
+ 105 2 if (i.getValue() != null && i.getValue().startsWith("org.springframework." )) {
+ 106 0 final int endPoint = i.getValue().indexOf(":" , 19);
+ 107 0 if (endPoint >= 0) {
+ 108 0 mustContain = i.getValue().substring(19, endPoint).toLowerCase();
+ 109 0 break ;
+ 110
+ }
+ 111
}
- 162
-
- 163 1 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
- 164 0 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
+ 112
+ }
+ 113 4 }
+ 114 3 if (mustContain != null ) {
+ 115 0 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+ 116 0 while (itr.hasNext()) {
+ 117 0 final Identifier i = itr.next();
+ 118 0 if ("cpe" .contains(i.getType())
+ 119
+ && i.getValue() != null
+ 120
+ && i.getValue().startsWith("cpe:/a:springsource:" )
+ 121
+ && !i.getValue().toLowerCase().contains(mustContain)) {
+ 122 0 itr.remove();
+ 123
+
+ 124
+ }
+ 125 0 }
+ 126
+ }
+ 127 3 }
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+ @SuppressWarnings("null" )
+ 148
+ private void removeSpuriousCPE(Dependency dependency) {
+ 149 3 final List<Identifier> ids = new ArrayList<Identifier>();
+ 150 3 ids.addAll(dependency.getIdentifiers());
+ 151 3 Collections.sort(ids);
+ 152 3 final ListIterator<Identifier> mainItr = ids.listIterator();
+ 153 7 while (mainItr.hasNext()) {
+ 154 4 final Identifier currentId = mainItr.next();
+ 155 4 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
+ 156 4 if (currentCpe == null ) {
+ 157 2 continue ;
+ 158
+ }
+ 159 2 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
+ 160 5 while (subItr.hasNext()) {
+ 161 3 final Identifier nextId = subItr.next();
+ 162 3 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
+ 163 3 if (nextCpe == null ) {
+ 164 2 continue ;
165
-
- 166 0 final String currentVersion = currentCpe.getVersion();
- 167 0 final String nextVersion = nextCpe.getVersion();
- 168 0 if (currentVersion == null && nextVersion == null ) {
+ }
+ 166
+
+ 167 1 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
+ 168 0 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
169
+
+ 170 0 final String currentVersion = currentCpe.getVersion();
+ 171 0 final String nextVersion = nextCpe.getVersion();
+ 172 0 if (currentVersion == null && nextVersion == null ) {
+ 173
- 170 0 LOGGER.log(Level.FINE, "currentVersion and nextVersion are both null?" );
- 171 0 } else if (currentVersion == null && nextVersion != null ) {
- 172 0 dependency.getIdentifiers().remove(currentId);
- 173 0 } else if (nextVersion == null && currentVersion != null ) {
- 174 0 dependency.getIdentifiers().remove(nextId);
- 175 0 } else if (currentVersion.length() < nextVersion.length()) {
- 176 0 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
- 177 0 dependency.getIdentifiers().remove(currentId);
- 178
- }
- 179
- } else {
- 180 0 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
- 181 0 dependency.getIdentifiers().remove(nextId);
+ 174 0 LOGGER.log(Level.FINE, "currentVersion and nextVersion are both null?" );
+ 175 0 } else if (currentVersion == null && nextVersion != null ) {
+ 176 0 dependency.getIdentifiers().remove(currentId);
+ 177 0 } else if (nextVersion == null && currentVersion != null ) {
+ 178 0 dependency.getIdentifiers().remove(nextId);
+ 179 0 } else if (currentVersion.length() < nextVersion.length()) {
+ 180 0 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
+ 181 0 dependency.getIdentifiers().remove(currentId);
182
}
183
+ } else {
+ 184 0 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
+ 185 0 dependency.getIdentifiers().remove(nextId);
+ 186
+ }
+ 187
}
- 184
+ 188
}
- 185
- }
- 186 1 }
- 187 2 }
- 188 3 }
189
-
- 190
-
- 191
-
- 192 1 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
+ }
+ 190 1 }
+ 191 2 }
+ 192 3 }
193
- + "java(_platform_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
- 194
- + "jdk|jre|jsse)($|:.*)" );
- 195
-
- 196
- 197
-
- 198
+ 194
+
+ 195
- 199 1 public static final Pattern CORE_JAVA_JSF = Pattern.compile("^cpe:/a:(sun|oracle|ibm):jsf($|:.*)" );
+ 196 1 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
+ 197
+ + "java(_platform_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
+ 198
+ + "jdk|jre|jsse)($|:.*)" );
+ 199
+
200
201
-
+
202
- 203 1 public static final Pattern CORE_FILES = Pattern.compile("(^|/)((alt[-])?rt|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
+ 203 1 public static final Pattern CORE_JAVA_JSF = Pattern.compile("^cpe:/a:(sun|oracle|ibm):jsf($|:.*)" );
204
205
-
+
206
- 207 1 public static final Pattern CORE_JSF_FILES = Pattern.compile("(^|/)jsf[-][^/]*\\.jar$" );
+ 207 1 public static final Pattern CORE_FILES = Pattern.compile("(^|/)((alt[-])?rt|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
208
-
+
209
-
+
210
-
- 211
-
+
+ 211 1 public static final Pattern CORE_JSF_FILES = Pattern.compile("(^|/)jsf[-][^/]*\\.jar$" );
212
-
+
213
-
+
214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
private void removeJreEntries(Dependency dependency) {
- 215 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 216 3 final Iterator<Identifier> itr = identifiers.iterator();
- 217 6 while (itr.hasNext()) {
- 218 3 final Identifier i = itr.next();
- 219 3 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
- 220 3 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
- 221 3 if (coreCPE.matches() && !coreFiles.matches()) {
- 222 0 itr.remove();
- 223
+ 219 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 220 3 final Iterator<Identifier> itr = identifiers.iterator();
+ 221 8 while (itr.hasNext()) {
+ 222 5 final Identifier i = itr.next();
+ 223 5 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
+ 224 5 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
+ 225 5 if (coreCPE.matches() && !coreFiles.matches()) {
+ 226 0 itr.remove();
+ 227
}
- 224 3 final Matcher coreJsfCPE = CORE_JAVA_JSF.matcher(i.getValue());
- 225 3 final Matcher coreJsfFiles = CORE_JSF_FILES.matcher(dependency.getFileName());
- 226 3 if (coreJsfCPE.matches() && !coreJsfFiles.matches()) {
- 227 0 itr.remove();
- 228
- }
- 229 3 }
- 230 3 }
- 231
-
+ 228 5 final Matcher coreJsfCPE = CORE_JAVA_JSF.matcher(i.getValue());
+ 229 5 final Matcher coreJsfFiles = CORE_JSF_FILES.matcher(dependency.getFileName());
+ 230 5 if (coreJsfCPE.matches() && !coreJsfFiles.matches()) {
+ 231 0 itr.remove();
232
-
- 233
-
- 234
-
+ }
+ 233 5 }
+ 234 3 }
235
-
+
236
-
+
237
-
+
238
-
+
239
- private VulnerableSoftware parseCpe(String type, String value) {
- 240 3 if (!"cpe" .equals(type)) {
- 241 0 return null ;
+
+ 240
+
+ 241
+
242
+
+ 243
+ private VulnerableSoftware parseCpe(String type, String value) {
+ 244 7 if (!"cpe" .equals(type)) {
+ 245 4 return null ;
+ 246
}
- 243 3 final VulnerableSoftware cpe = new VulnerableSoftware();
- 244
+ 247 3 final VulnerableSoftware cpe = new VulnerableSoftware();
+ 248
try {
- 245 3 cpe.parseName(value);
- 246 0 } catch (UnsupportedEncodingException ex) {
- 247 0 LOGGER.log(Level.FINEST, null , ex);
- 248 0 return null ;
- 249 3 }
- 250 3 return cpe;
- 251
- }
- 252
-
- 253
-
- 254
-
+ 249 3 cpe.parseName(value);
+ 250 0 } catch (UnsupportedEncodingException ex) {
+ 251 0 LOGGER.log(Level.FINEST, null , ex);
+ 252 0 return null ;
+ 253 3 }
+ 254 3 return cpe;
255
-
+ }
256
-
+
257
-
+
258
-
+
259
- private void removeBadMatches(Dependency dependency) {
- 260 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 261 3 final Iterator<Identifier> itr = identifiers.iterator();
- 262
-
- 263
-
- 264
-
- 265
-
- 266
-
- 267
-
- 268
-
- 269
-
- 270 6 while (itr.hasNext()) {
- 271 3 final Identifier i = itr.next();
- 272
-
- 273 3 if ("cpe" .equals(i.getType())) {
- 274 3 if ((i.getValue().matches(".*c\\+\\+.*" )
- 275
- || i.getValue().startsWith("cpe:/a:file:file" )
- 276
- || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
- 277
- || i.getValue().startsWith("cpe:/a:cvs:cvs" )
- 278
- || i.getValue().startsWith("cpe:/a:ftp:ftp" )
- 279
- || i.getValue().startsWith("cpe:/a:tcp:tcp" )
- 280
- || i.getValue().startsWith("cpe:/a:ssh:ssh" )
- 281
- || i.getValue().startsWith("cpe:/a:lookup:lookup" ))
- 282
- && (dependency.getFileName().toLowerCase().endsWith(".jar" )
- 283
- || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
- 284
- || dependency.getFileName().toLowerCase().endsWith(".dll" )
- 285
- || dependency.getFileName().toLowerCase().endsWith(".exe" )
- 286
- || dependency.getFileName().toLowerCase().endsWith(".nuspec" )
- 287
- || dependency.getFileName().toLowerCase().endsWith(".nupkg" ))) {
- 288 1 itr.remove();
- 289 2 } else if ((i.getValue().startsWith("cpe:/a:jquery:jquery" )
- 290
- || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
- 291
- || i.getValue().startsWith("cpe:/a:yahoo:yui" ))
- 292
- && (dependency.getFileName().toLowerCase().endsWith(".jar" )
- 293
- || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
- 294
- || dependency.getFileName().toLowerCase().endsWith(".dll" )
- 295
- || dependency.getFileName().toLowerCase().endsWith(".exe" ))) {
- 296 0 itr.remove();
- 297 2 } else if ((i.getValue().startsWith("cpe:/a:microsoft:excel" )
- 298
- || i.getValue().startsWith("cpe:/a:microsoft:word" )
- 299
- || i.getValue().startsWith("cpe:/a:microsoft:visio" )
- 300
- || i.getValue().startsWith("cpe:/a:microsoft:powerpoint" )
- 301
- || i.getValue().startsWith("cpe:/a:microsoft:office" ))
- 302
- && (dependency.getFileName().toLowerCase().endsWith(".jar" )
- 303
- || dependency.getFileName().toLowerCase().endsWith("pom.xml" ))) {
- 304 0 itr.remove();
- 305 2 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
- 306
- && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
- 307 0 itr.remove();
- 308 2 } else if (i.getValue().startsWith("cpe:/a:m-core:m-core" )
- 309
- && !dependency.getEvidenceUsed().containsUsedString("m-core" )) {
- 310 0 itr.remove();
- 311 2 } else if (i.getValue().startsWith("cpe:/a:jboss:jboss" )
- 312
- && !dependency.getFileName().toLowerCase().matches("jboss-?[\\d\\.-]+(GA)?\\.jar" )) {
- 313 0 itr.remove();
- 314
- }
- 315
- }
- 316 3 }
- 317 3 }
- 318
-
- 319
-
- 320
-
- 321
+
+ 260
- 322
+ 261
+ 262
+
+ 263
+ private void removeBadMatches(Dependency dependency) {
+ 264 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 265 3 final Iterator<Identifier> itr = identifiers.iterator();
+ 266
+
+ 267
+
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272
+
+ 273
+
+ 274 8 while (itr.hasNext()) {
+ 275 5 final Identifier i = itr.next();
+ 276
+
+ 277 5 if ("cpe" .equals(i.getType())) {
+ 278 3 if ((i.getValue().matches(".*c\\+\\+.*" )
+ 279
+ || i.getValue().startsWith("cpe:/a:file:file" )
+ 280
+ || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
+ 281
+ || i.getValue().startsWith("cpe:/a:cvs:cvs" )
+ 282
+ || i.getValue().startsWith("cpe:/a:ftp:ftp" )
+ 283
+ || i.getValue().startsWith("cpe:/a:tcp:tcp" )
+ 284
+ || i.getValue().startsWith("cpe:/a:ssh:ssh" )
+ 285
+ || i.getValue().startsWith("cpe:/a:lookup:lookup" ))
+ 286
+ && (dependency.getFileName().toLowerCase().endsWith(".jar" )
+ 287
+ || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
+ 288
+ || dependency.getFileName().toLowerCase().endsWith(".dll" )
+ 289
+ || dependency.getFileName().toLowerCase().endsWith(".exe" )
+ 290
+ || dependency.getFileName().toLowerCase().endsWith(".nuspec" )
+ 291
+ || dependency.getFileName().toLowerCase().endsWith(".nupkg" ))) {
+ 292 1 itr.remove();
+ 293 2 } else if ((i.getValue().startsWith("cpe:/a:jquery:jquery" )
+ 294
+ || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
+ 295
+ || i.getValue().startsWith("cpe:/a:yahoo:yui" ))
+ 296
+ && (dependency.getFileName().toLowerCase().endsWith(".jar" )
+ 297
+ || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
+ 298
+ || dependency.getFileName().toLowerCase().endsWith(".dll" )
+ 299
+ || dependency.getFileName().toLowerCase().endsWith(".exe" ))) {
+ 300 0 itr.remove();
+ 301 2 } else if ((i.getValue().startsWith("cpe:/a:microsoft:excel" )
+ 302
+ || i.getValue().startsWith("cpe:/a:microsoft:word" )
+ 303
+ || i.getValue().startsWith("cpe:/a:microsoft:visio" )
+ 304
+ || i.getValue().startsWith("cpe:/a:microsoft:powerpoint" )
+ 305
+ || i.getValue().startsWith("cpe:/a:microsoft:office" ))
+ 306
+ && (dependency.getFileName().toLowerCase().endsWith(".jar" )
+ 307
+ || dependency.getFileName().toLowerCase().endsWith("pom.xml" ))) {
+ 308 0 itr.remove();
+ 309 2 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
+ 310
+ && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
+ 311 0 itr.remove();
+ 312 2 } else if (i.getValue().startsWith("cpe:/a:m-core:m-core" )
+ 313
+ && !dependency.getEvidenceUsed().containsUsedString("m-core" )) {
+ 314 0 itr.remove();
+ 315 2 } else if (i.getValue().startsWith("cpe:/a:jboss:jboss" )
+ 316
+ && !dependency.getFileName().toLowerCase().matches("jboss-?[\\d\\.-]+(GA)?\\.jar" )) {
+ 317 0 itr.remove();
+ 318
+ }
+ 319
+ }
+ 320 5 }
+ 321 3 }
+ 322
+
323
-
+
324
- private void removeWrongVersionMatches(Dependency dependency) {
- 325 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
- 326 3 final Iterator<Identifier> itr = identifiers.iterator();
+
+ 325
+
+ 326
+
327
+
+ 328
+ private void removeWrongVersionMatches(Dependency dependency) {
+ 329 3 final Set<Identifier> identifiers = dependency.getIdentifiers();
+ 330 3 final Iterator<Identifier> itr = identifiers.iterator();
+ 331
- 328 3 final String fileName = dependency.getFileName();
- 329 3 if (fileName != null && fileName.contains("axis2" )) {
- 330 0 while (itr.hasNext()) {
- 331 0 final Identifier i = itr.next();
- 332 0 if ("cpe" .equals(i.getType())) {
- 333 0 final String cpe = i.getValue();
- 334 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
- 335 0 itr.remove();
- 336
+ 332 3 final String fileName = dependency.getFileName();
+ 333 3 if (fileName != null && fileName.contains("axis2" )) {
+ 334 0 while (itr.hasNext()) {
+ 335 0 final Identifier i = itr.next();
+ 336 0 if ("cpe" .equals(i.getType())) {
+ 337 0 final String cpe = i.getValue();
+ 338 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
+ 339 0 itr.remove();
+ 340
}
- 337
+ 341
}
- 338 0 }
- 339 3 } else if (fileName != null && fileName.contains("axis" )) {
- 340 0 while (itr.hasNext()) {
- 341 0 final Identifier i = itr.next();
- 342 0 if ("cpe" .equals(i.getType())) {
- 343 0 final String cpe = i.getValue();
- 344 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
- 345 0 itr.remove();
- 346
+ 342 0 }
+ 343 3 } else if (fileName != null && fileName.contains("axis" )) {
+ 344 0 while (itr.hasNext()) {
+ 345 0 final Identifier i = itr.next();
+ 346 0 if ("cpe" .equals(i.getType())) {
+ 347 0 final String cpe = i.getValue();
+ 348 0 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
+ 349 0 itr.remove();
+ 350
}
- 347
- }
- 348 0 }
- 349
- }
- 350 3 }
351
-
- 352
-
- 353
-
- 354
-
- 355
-
- 356
-
- 357
-
- 358
-
- 359
- private void addFalseNegativeCPEs(Dependency dependency) {
- 360
-
- 361 3 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
- 362 5 while (itr.hasNext()) {
- 363 2 final Identifier i = itr.next();
- 364 2 if ("cpe" .equals(i.getType()) && i.getValue() != null
- 365
- && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
- 366
- || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
- 367
- || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
- 368
- || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
- 369 0 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
- 370 0 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
- 371 0 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
- 372 0 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
- 373
- try {
- 374 0 dependency.addIdentifier("cpe" ,
- 375
- newCpe,
- 376
- String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe, "UTF-8" )));
- 377 0 dependency.addIdentifier("cpe" ,
- 378
- newCpe2,
- 379
- String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe2, "UTF-8" )));
- 380 0 dependency.addIdentifier("cpe" ,
- 381
- newCpe3,
- 382
- String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe3, "UTF-8" )));
- 383 0 dependency.addIdentifier("cpe" ,
- 384
- newCpe4,
- 385
- String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe4, "UTF-8" )));
- 386 0 } catch (UnsupportedEncodingException ex) {
- 387 0 LOGGER.log(Level.FINE, null , ex);
- 388 0 }
- 389
- }
- 390 2 }
- 391 3 }
- 392
-
- 393
-
- 394
-
- 395
-
- 396
-
- 397
-
- 398
-
- 399
-
- 400
- private void removeDuplicativeEntriesFromJar(Dependency dependency, Engine engine) {
- 401 3 if (dependency.getFileName().toLowerCase().endsWith("pom.xml" )
- 402
- || "dll" .equals(dependency.getFileExtension())
- 403
- || "exe" .equals(dependency.getFileExtension())) {
- 404 1 String parentPath = dependency.getFilePath().toLowerCase();
- 405 1 if (parentPath.contains(".jar" )) {
- 406 0 parentPath = parentPath.substring(0, parentPath.indexOf(".jar" ) + 4);
- 407 0 final Dependency parent = findDependency(parentPath, engine.getDependencies());
- 408 0 if (parent != null ) {
- 409 0 boolean remove = false ;
- 410 0 for (Identifier i : dependency.getIdentifiers()) {
- 411 0 if ("cpe" .equals(i.getType())) {
- 412 0 final String trimmedCPE = trimCpeToVendor(i.getValue());
- 413 0 for (Identifier parentId : parent.getIdentifiers()) {
- 414 0 if ("cpe" .equals(parentId.getType()) && parentId.getValue().startsWith(trimmedCPE)) {
- 415 0 remove |= true ;
- 416
- }
- 417 0 }
- 418
- }
- 419 0 if (!remove) {
- 420 0 return ;
- 421
- }
- 422 0 }
- 423 0 if (remove) {
- 424 0 engine.getDependencies().remove(dependency);
- 425
- }
- 426
}
- 427
- }
- 428
+ 352 0 }
+ 353
+ }
+ 354 3 }
+ 355
+ 356
+
+ 357
+
+ 358
+
+ 359
+
+ 360
+
+ 361
+
+ 362
+
+ 363
+ private void addFalseNegativeCPEs(Dependency dependency) {
+ 364
+
+ 365 3 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+ 366 7 while (itr.hasNext()) {
+ 367 4 final Identifier i = itr.next();
+ 368 4 if ("cpe" .equals(i.getType()) && i.getValue() != null
+ 369
+ && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
+ 370
+ || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
+ 371
+ || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
+ 372
+ || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
+ 373 0 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
+ 374 0 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
+ 375 0 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
+ 376 0 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
+ 377
+ try {
+ 378 0 dependency.addIdentifier("cpe" ,
+ 379
+ newCpe,
+ 380
+ String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe, "UTF-8" )));
+ 381 0 dependency.addIdentifier("cpe" ,
+ 382
+ newCpe2,
+ 383
+ String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe2, "UTF-8" )));
+ 384 0 dependency.addIdentifier("cpe" ,
+ 385
+ newCpe3,
+ 386
+ String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe3, "UTF-8" )));
+ 387 0 dependency.addIdentifier("cpe" ,
+ 388
+ newCpe4,
+ 389
+ String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe4, "UTF-8" )));
+ 390 0 } catch (UnsupportedEncodingException ex) {
+ 391 0 LOGGER.log(Level.FINE, null , ex);
+ 392 0 }
+ 393
+ }
+ 394 4 }
+ 395 3 }
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400
+
+ 401
+
+ 402
+
+ 403
+
+ 404
+ private void removeDuplicativeEntriesFromJar(Dependency dependency, Engine engine) {
+ 405 3 if (dependency.getFileName().toLowerCase().endsWith("pom.xml" )
+ 406
+ || "dll" .equals(dependency.getFileExtension())
+ 407
+ || "exe" .equals(dependency.getFileExtension())) {
+ 408 1 String parentPath = dependency.getFilePath().toLowerCase();
+ 409 1 if (parentPath.contains(".jar" )) {
+ 410 0 parentPath = parentPath.substring(0, parentPath.indexOf(".jar" ) + 4);
+ 411 0 final Dependency parent = findDependency(parentPath, engine.getDependencies());
+ 412 0 if (parent != null ) {
+ 413 0 boolean remove = false ;
+ 414 0 for (Identifier i : dependency.getIdentifiers()) {
+ 415 0 if ("cpe" .equals(i.getType())) {
+ 416 0 final String trimmedCPE = trimCpeToVendor(i.getValue());
+ 417 0 for (Identifier parentId : parent.getIdentifiers()) {
+ 418 0 if ("cpe" .equals(parentId.getType()) && parentId.getValue().startsWith(trimmedCPE)) {
+ 419 0 remove |= true ;
+ 420
+ }
+ 421 0 }
+ 422
+ }
+ 423 0 if (!remove) {
+ 424 0 return ;
+ 425
+ }
+ 426 0 }
+ 427 0 if (remove) {
+ 428 0 engine.getDependencies().remove(dependency);
429
- }
- 430 3 }
+ }
+ 430
+ }
431
-
- 432
-
- 433
-
- 434
-
- 435
-
- 436
-
- 437
-
- 438
-
- 439
- private Dependency findDependency(String dependencyPath, List<Dependency> dependencies) {
- 440 0 for (Dependency d : dependencies) {
- 441 0 if (d.getFilePath().equalsIgnoreCase(dependencyPath)) {
- 442 0 return d;
- 443
}
- 444 0 }
- 445 0 return null ;
- 446
- }
- 447
+ 432
- 448
-
- 449
-
- 450
-
- 451
-
- 452
-
- 453
-
- 454
- private String trimCpeToVendor(String value) {
- 455
-
- 456 0 final int pos1 = value.indexOf(":" , 7);
- 457 0 final int pos2 = value.indexOf(":" , pos1 + 1);
- 458 0 if (pos2 < 0) {
- 459 0 return value;
- 460
- } else {
- 461 0 return value.substring(0, pos2);
- 462
+ 433
}
- 463
+ 434 3 }
+ 435
+
+ 436
+
+ 437
+
+ 438
+
+ 439
+
+ 440
+
+ 441
+
+ 442
+
+ 443
+ private Dependency findDependency(String dependencyPath, List<Dependency> dependencies) {
+ 444 0 for (Dependency d : dependencies) {
+ 445 0 if (d.getFilePath().equalsIgnoreCase(dependencyPath)) {
+ 446 0 return d;
+ 447
+ }
+ 448 0 }
+ 449 0 return null ;
+ 450
}
+ 451
+
+ 452
+
+ 453
+
+ 454
+
+ 455
+
+ 456
+
+ 457
+
+ 458
+ private String trimCpeToVendor(String value) {
+ 459
+
+ 460 0 final int pos1 = value.indexOf(":" , 7);
+ 461 0 final int pos2 = value.indexOf(":" , pos1 + 1);
+ 462 0 if (pos2 < 0) {
+ 463 0 return value;
464
+ } else {
+ 465 0 return value.substring(0, pos2);
+ 466
+ }
+ 467
+ }
+ 468
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
index b6a078400..674b1e5d9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileNameAnalyzer.html
@@ -164,7 +164,7 @@
75
- 76 4 final File f = new File(dependency.getFileName());
+ 76 4 final File f = dependency.getActualFile();
77 4 String fileName = f.getName();
78
@@ -229,6 +229,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
index 4c76a4635..3976a76bb 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.FileTypeAnalyzer.html
@@ -87,6 +87,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
index f8e4a49c2..422b8f2e4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.HintAnalyzer.html
@@ -208,9 +208,9 @@
}
103 2 final Iterator<Evidence> itr = dependency.getVendorEvidence().iterator();
104 2 final ArrayList<Evidence> newEntries = new ArrayList<Evidence>();
- 105 27 while (itr.hasNext()) {
- 106 25 final Evidence e = itr.next();
- 107 25 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
+ 105 29 while (itr.hasNext()) {
+ 106 27 final Evidence e = itr.next();
+ 107 27 if ("sun" .equalsIgnoreCase(e.getValue(false ))) {
108 0 final Evidence newEvidence = new Evidence(e.getSource() + " (hint)" , e.getName(), "oracle" , e.getConfidence());
109 0 newEntries.add(newEvidence);
110 0 } else if ("oracle" .equalsIgnoreCase(e.getValue(false ))) {
@@ -218,7 +218,7 @@
112 0 newEntries.add(newEvidence);
113
}
- 114 25 }
+ 114 27 }
115 2 for (Evidence e : newEntries) {
116 0 dependency.getVendorEvidence().addEvidence(e);
117 0 }
@@ -229,6 +229,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
index 7d7f8ffcc..0d408a604 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JarAnalyzer.html
@@ -12,8 +12,8 @@
@@ -561,1580 +561,1647 @@
293 0 LOGGER.log(Level.FINE, msg, ex);
294 0 return false ;
295 5 }
- 296 5 if (pomEntries.isEmpty()) {
- 297 4 return false ;
- 298
- }
- 299 1 for (String path : pomEntries) {
- 300 1 Properties pomProperties = null ;
- 301
- try {
- 302 1 pomProperties = retrievePomProperties(path, jar);
- 303 0 } catch (IOException ex) {
- 304 0 LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties" , ex);
- 305 1 }
- 306 1 Model pom = null ;
- 307
- try {
- 308 1 if (pomEntries.size() > 1) {
+ 296 5 File externalPom = null ;
+ 297 5 if (pomEntries.isEmpty()) {
+ 298 4 if (dependency.getActualFilePath().matches(".*\\.m2.repository\\b.*" )) {
+ 299 0 String pomPath = dependency.getActualFilePath();
+ 300 0 pomPath = pomPath.substring(0, pomPath.lastIndexOf('.' )) + ".pom" ;
+ 301 0 externalPom = new File(pomPath);
+ 302 0 if (externalPom.isFile()) {
+ 303 0 pomEntries.add(pomPath);
+ 304
+ } else {
+ 305 0 return false ;
+ 306
+ }
+ 307 0 } else {
+ 308 4 return false ;
309
-
- 310 0 final Dependency newDependency = new Dependency();
- 311 0 pom = extractPom(path, jar, newDependency);
- 312
-
- 313 0 final String displayPath = String.format("%s%s%s" ,
- 314
- dependency.getFilePath(),
- 315
- File.separator,
+ }
+ 310
+ }
+ 311 1 for (String path : pomEntries) {
+ 312 1 Properties pomProperties = null ;
+ 313
+ try {
+ 314 1 if (externalPom == null ) {
+ 315 1 pomProperties = retrievePomProperties(path, jar);
316
- path);
- 317 0 final String displayName = String.format("%s%s%s" ,
- 318
- dependency.getFileName(),
- 319
- File.separator,
- 320
- path);
+ }
+ 317 0 } catch (IOException ex) {
+ 318 0 LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties" , ex);
+ 319 1 }
+ 320 1 Model pom = null ;
321
+ try {
+ 322 1 if (pomEntries.size() > 1) {
+ 323
+
+ 324 0 final Dependency newDependency = new Dependency();
+ 325 0 pom = extractPom(path, jar, newDependency);
+ 326
- 322 0 newDependency.setFileName(displayName);
- 323 0 newDependency.setFilePath(displayPath);
- 324 0 setPomEvidence(newDependency, pom, pomProperties, null );
- 325 0 engine.getDependencies().add(newDependency);
- 326 0 Collections.sort(engine.getDependencies());
- 327 0 } else {
- 328 1 pom = retrievePom(path, jar);
- 329 1 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
+ 327 0 final String displayPath = String.format("%s%s%s" ,
+ 328
+ dependency.getFilePath(),
+ 329
+ File.separator,
330
- }
- 331 0 } catch (AnalysisException ex) {
- 332 0 final String msg = String.format("An error occured while analyzing '%s'." , dependency.getActualFilePath());
- 333 0 LOGGER.log(Level.WARNING, msg);
- 334 0 LOGGER.log(Level.FINE, "" , ex);
- 335 1 }
- 336 1 }
- 337 1 return foundSomething;
- 338
- }
- 339
+ path);
+ 331 0 final String displayName = String.format("%s%s%s" ,
+ 332
+ dependency.getFileName(),
+ 333
+ File.separator,
+ 334
+ path);
+ 335
- 340
-
- 341
-
- 342
-
- 343
-
+ 336 0 newDependency.setFileName(displayName);
+ 337 0 newDependency.setFilePath(displayPath);
+ 338 0 setPomEvidence(newDependency, pom, pomProperties, null );
+ 339 0 engine.getDependencies().add(newDependency);
+ 340 0 Collections.sort(engine.getDependencies());
+ 341 0 } else {
+ 342 1 if (externalPom == null ) {
+ 343 1 pom = retrievePom(path, jar);
344
-
- 345
-
+ } else {
+ 345 0 pom = retrievePom(externalPom);
346
-
- 347
-
+ }
+ 347 1 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
348
- private Properties retrievePomProperties(String path, final JarFile jar) throws IOException {
- 349 1 Properties pomProperties = null ;
- 350 1 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
- 351 1 final ZipEntry propEntry = jar.getEntry(propPath);
- 352 1 if (propEntry != null ) {
- 353 0 Reader reader = null ;
- 354
- try {
- 355 0 reader = new InputStreamReader(jar.getInputStream(propEntry), "UTF-8" );
- 356 0 pomProperties = new Properties();
- 357 0 pomProperties.load(reader);
- 358
- } finally {
- 359 0 if (reader != null ) {
- 360
- try {
- 361 0 reader.close();
- 362 0 } catch (IOException ex) {
- 363 0 LOGGER.log(Level.FINEST, "close error" , ex);
- 364 0 }
- 365
}
+ 349 0 } catch (AnalysisException ex) {
+ 350 0 final String msg = String.format("An error occured while analyzing '%s'." , dependency.getActualFilePath());
+ 351 0 LOGGER.log(Level.WARNING, msg);
+ 352 0 LOGGER.log(Level.FINE, "" , ex);
+ 353 1 }
+ 354 1 }
+ 355 1 return foundSomething;
+ 356
+ }
+ 357
+
+ 358
+
+ 359
+
+ 360
+
+ 361
+
+ 362
+
+ 363
+
+ 364
+
+ 365
+
366
- }
- 367
- }
- 368 1 return pomProperties;
- 369
- }
- 370
-
- 371
-
+ private Properties retrievePomProperties(String path, final JarFile jar) throws IOException {
+ 367 1 Properties pomProperties = null ;
+ 368 1 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
+ 369 1 final ZipEntry propEntry = jar.getEntry(propPath);
+ 370 1 if (propEntry != null ) {
+ 371 0 Reader reader = null ;
372
-
- 373
-
- 374
-
- 375
-
+ try {
+ 373 0 reader = new InputStreamReader(jar.getInputStream(propEntry), "UTF-8" );
+ 374 0 pomProperties = new Properties();
+ 375 0 pomProperties.load(reader);
376
-
- 377
-
+ } finally {
+ 377 0 if (reader != null ) {
378
- private List<String> retrievePomListing(final JarFile jar) throws IOException {
- 379 5 final List<String> pomEntries = new ArrayList<String>();
- 380 5 final Enumeration<JarEntry> entries = jar.entries();
- 381 1848 while (entries.hasMoreElements()) {
- 382 1843 final JarEntry entry = entries.nextElement();
- 383 1843 final String entryName = (new File(entry.getName())).getName().toLowerCase();
- 384 1843 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
- 385 1 pomEntries.add(entry.getName());
- 386
+ try {
+ 379 0 reader.close();
+ 380 0 } catch (IOException ex) {
+ 381 0 LOGGER.log(Level.FINEST, "close error" , ex);
+ 382 0 }
+ 383
+ }
+ 384
}
- 387 1843 }
- 388 5 return pomEntries;
+ 385
+ }
+ 386 1 return pomProperties;
+ 387
+ }
+ 388
+
389
- }
+
390
-
+
391
-
+
392
-
+
393
-
+
394
-
+
395
-
+
396
-
- 397
-
- 398
-
- 399
-
- 400
-
- 401
- private Model extractPom(String path, JarFile jar, Dependency dependency) throws AnalysisException {
- 402 0 InputStream input = null ;
- 403 0 FileOutputStream fos = null ;
- 404 0 BufferedOutputStream bos = null ;
- 405 0 final File tmpDir = getNextTempDirectory();
- 406 0 final File file = new File(tmpDir, "pom.xml" );
+ private List<String> retrievePomListing(final JarFile jar) throws IOException {
+ 397 5 final List<String> pomEntries = new ArrayList<String>();
+ 398 5 final Enumeration<JarEntry> entries = jar.entries();
+ 399 1848 while (entries.hasMoreElements()) {
+ 400 1843 final JarEntry entry = entries.nextElement();
+ 401 1843 final String entryName = (new File(entry.getName())).getName().toLowerCase();
+ 402 1843 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
+ 403 1 pomEntries.add(entry.getName());
+ 404
+ }
+ 405 1843 }
+ 406 5 return pomEntries;
407
- try {
- 408 0 final ZipEntry entry = jar.getEntry(path);
- 409 0 input = jar.getInputStream(entry);
- 410 0 fos = new FileOutputStream(file);
- 411 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+ }
+ 408
+
+ 409
+
+ 410
+
+ 411
+
412
- int count;
- 413 0 final byte data[] = new byte [BUFFER_SIZE];
- 414 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
- 415 0 bos.write(data, 0, count);
- 416
- }
- 417 0 bos.flush();
- 418 0 dependency.setActualFilePath(file.getAbsolutePath());
- 419 0 } catch (IOException ex) {
- 420 0 final String msg = String.format("An error occurred reading '%s' from '%s'." , path, dependency.getFilePath());
- 421 0 LOGGER.warning(msg);
- 422 0 LOGGER.log(Level.SEVERE, "" , ex);
- 423
- } finally {
- 424 0 closeStream(bos);
- 425 0 closeStream(fos);
- 426 0 closeStream(input);
- 427 0 }
- 428 0 Model model = null ;
- 429 0 FileInputStream fis = null ;
- 430
- try {
- 431 0 fis = new FileInputStream(file);
- 432 0 final InputStreamReader reader = new InputStreamReader(fis, "UTF-8" );
- 433 0 final InputSource xml = new InputSource(reader);
- 434 0 final SAXSource source = new SAXSource(xml);
- 435 0 model = readPom(source);
- 436 0 } catch (FileNotFoundException ex) {
- 437 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (File Not Found)" , path, jar.getName());
- 438 0 LOGGER.log(Level.WARNING, msg);
- 439 0 LOGGER.log(Level.FINE, "" , ex);
- 440 0 throw new AnalysisException(ex);
- 441 0 } catch (UnsupportedEncodingException ex) {
- 442 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
- 443 0 LOGGER.log(Level.WARNING, msg);
- 444 0 LOGGER.log(Level.FINE, "" , ex);
- 445 0 throw new AnalysisException(ex);
- 446 0 } catch (AnalysisException ex) {
- 447 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'" , path, jar.getName());
- 448 0 LOGGER.log(Level.WARNING, msg);
- 449 0 LOGGER.log(Level.FINE, "" , ex);
- 450 0 throw ex;
- 451
- } finally {
- 452 0 closeStream(fis);
- 453 0 }
- 454 0 return model;
- 455
- }
- 456
-
- 457
-
- 458
-
- 459
-
- 460
-
- 461
-
- 462
- private void closeStream(InputStream stream) {
- 463 0 if (stream != null ) {
- 464
- try {
- 465 0 stream.close();
- 466 0 } catch (IOException ex) {
- 467 0 LOGGER.log(Level.FINEST, null , ex);
- 468 0 }
- 469
- }
- 470 0 }
- 471
-
- 472
-
- 473
-
- 474
-
- 475
-
- 476
-
- 477
- private void closeStream(OutputStream stream) {
- 478 0 if (stream != null ) {
- 479
- try {
- 480 0 stream.close();
- 481 0 } catch (IOException ex) {
- 482 0 LOGGER.log(Level.FINEST, null , ex);
- 483 0 }
- 484
- }
- 485 0 }
- 486
-
- 487
-
- 488
-
- 489
-
- 490
- 491
+ 413
- 492
-
- 493
-
- 494
-
- 495
-
- 496
- private Model retrievePom(String path, JarFile jar) throws AnalysisException {
- 497 1 final ZipEntry entry = jar.getEntry(path);
- 498 1 Model model = null ;
- 499 1 if (entry != null ) {
- 500
- try {
- 501 1 final NonClosingStream stream = new NonClosingStream(jar.getInputStream(entry));
- 502 1 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
- 503 1 final InputSource xml = new InputSource(reader);
- 504 1 final SAXSource source = new SAXSource(xml);
- 505 1 model = readPom(source);
- 506 0 } catch (SecurityException ex) {
- 507 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'; invalid signature" , path, jar.getName());
- 508 0 LOGGER.log(Level.WARNING, msg);
- 509 0 LOGGER.log(Level.FINE, null , ex);
- 510 0 throw new AnalysisException(ex);
- 511 0 } catch (IOException ex) {
- 512 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
- 513 0 LOGGER.log(Level.WARNING, msg);
- 514 0 LOGGER.log(Level.FINE, "" , ex);
- 515 0 throw new AnalysisException(ex);
- 516 0 } catch (Throwable ex) {
- 517 0 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
- 518 0 LOGGER.log(Level.WARNING, msg);
- 519 0 LOGGER.log(Level.FINE, "" , ex);
- 520 0 throw new AnalysisException(ex);
- 521 1 }
- 522
- }
- 523 1 return model;
- 524
- }
- 525
-
- 526
-
- 527
-
- 528
-
- 529
-
- 530
+ 414
+
+ 415
- 531
+ 416
- 532
+ 417
- 533
+ 418
- 534
- private Model readPom(SAXSource source) throws AnalysisException {
- 535 1 Model model = null ;
- 536
+ 419
+ private Model extractPom(String path, JarFile jar, Dependency dependency) throws AnalysisException {
+ 420 0 InputStream input = null ;
+ 421 0 FileOutputStream fos = null ;
+ 422 0 BufferedOutputStream bos = null ;
+ 423 0 final File tmpDir = getNextTempDirectory();
+ 424 0 final File file = new File(tmpDir, "pom.xml" );
+ 425
try {
- 537 1 final XMLFilter filter = new MavenNamespaceFilter();
- 538 1 final SAXParserFactory spf = SAXParserFactory.newInstance();
- 539 1 final SAXParser sp = spf.newSAXParser();
- 540 1 final XMLReader xr = sp.getXMLReader();
- 541 1 filter.setParent(xr);
- 542 1 final JAXBElement<Model> el = pomUnmarshaller.unmarshal(source, Model.class );
- 543 1 model = el.getValue();
- 544 0 } catch (SecurityException ex) {
- 545 0 throw new AnalysisException(ex);
- 546 0 } catch (ParserConfigurationException ex) {
- 547 0 throw new AnalysisException(ex);
- 548 0 } catch (SAXException ex) {
- 549 0 throw new AnalysisException(ex);
- 550 0 } catch (JAXBException ex) {
- 551 0 throw new AnalysisException(ex);
- 552 0 } catch (Throwable ex) {
- 553 0 throw new AnalysisException(ex);
- 554 1 }
- 555 1 return model;
- 556
+ 426 0 final ZipEntry entry = jar.getEntry(path);
+ 427 0 input = jar.getInputStream(entry);
+ 428 0 fos = new FileOutputStream(file);
+ 429 0 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+ 430
+ int count;
+ 431 0 final byte data[] = new byte [BUFFER_SIZE];
+ 432 0 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+ 433 0 bos.write(data, 0, count);
+ 434
+ }
+ 435 0 bos.flush();
+ 436 0 dependency.setActualFilePath(file.getAbsolutePath());
+ 437 0 } catch (IOException ex) {
+ 438 0 final String msg = String.format("An error occurred reading '%s' from '%s'." , path, dependency.getFilePath());
+ 439 0 LOGGER.warning(msg);
+ 440 0 LOGGER.log(Level.SEVERE, "" , ex);
+ 441
+ } finally {
+ 442 0 closeStream(bos);
+ 443 0 closeStream(fos);
+ 444 0 closeStream(input);
+ 445 0 }
+ 446 0 Model model = null ;
+ 447 0 FileInputStream fis = null ;
+ 448
+ try {
+ 449 0 fis = new FileInputStream(file);
+ 450 0 final InputStreamReader reader = new InputStreamReader(fis, "UTF-8" );
+ 451 0 final InputSource xml = new InputSource(reader);
+ 452 0 final SAXSource source = new SAXSource(xml);
+ 453 0 model = readPom(source);
+ 454 0 } catch (FileNotFoundException ex) {
+ 455 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (File Not Found)" , path, jar.getName());
+ 456 0 LOGGER.log(Level.WARNING, msg);
+ 457 0 LOGGER.log(Level.FINE, "" , ex);
+ 458 0 throw new AnalysisException(ex);
+ 459 0 } catch (UnsupportedEncodingException ex) {
+ 460 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
+ 461 0 LOGGER.log(Level.WARNING, msg);
+ 462 0 LOGGER.log(Level.FINE, "" , ex);
+ 463 0 throw new AnalysisException(ex);
+ 464 0 } catch (AnalysisException ex) {
+ 465 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'" , path, jar.getName());
+ 466 0 LOGGER.log(Level.WARNING, msg);
+ 467 0 LOGGER.log(Level.FINE, "" , ex);
+ 468 0 throw ex;
+ 469
+ } finally {
+ 470 0 closeStream(fis);
+ 471 0 }
+ 472 0 return model;
+ 473
}
- 557
+ 474
- 558
+ 475
- 559
-
- 560
+ 476
+
+ 477
- 561
-
- 562
-
- 563
-
- 564
-
- 565
-
- 566
-
- 567
+ 478
+
+ 479
- 568
- private boolean setPomEvidence(Dependency dependency, Model pom, Properties pomProperties, ArrayList<ClassNameInformation> classes) {
- 569 1 boolean foundSomething = false ;
- 570 1 boolean addAsIdentifier = true ;
- 571 1 if (pom == null ) {
- 572 0 return foundSomething;
- 573
+ 480
+ private void closeStream(InputStream stream) {
+ 481 0 if (stream != null ) {
+ 482
+ try {
+ 483 0 stream.close();
+ 484 0 } catch (IOException ex) {
+ 485 0 LOGGER.log(Level.FINEST, null , ex);
+ 486 0 }
+ 487
}
- 574 1 String groupid = interpolateString(pom.getGroupId(), pomProperties);
- 575 1 String parentGroupId = null ;
- 576
+ 488 0 }
+ 489
- 577 1 if (pom.getParent() != null ) {
- 578 1 parentGroupId = interpolateString(pom.getParent().getGroupId(), pomProperties);
- 579 1 if ((groupid == null || groupid.isEmpty()) && parentGroupId != null && !parentGroupId.isEmpty()) {
- 580 0 groupid = parentGroupId;
+ 490
+
+ 491
+
+ 492
+
+ 493
+
+ 494
+
+ 495
+ private void closeStream(OutputStream stream) {
+ 496 0 if (stream != null ) {
+ 497
+ try {
+ 498 0 stream.close();
+ 499 0 } catch (IOException ex) {
+ 500 0 LOGGER.log(Level.FINEST, null , ex);
+ 501 0 }
+ 502
+ }
+ 503 0 }
+ 504
+
+ 505
+
+ 506
+
+ 507
+
+ 508
+
+ 509
+
+ 510
+
+ 511
+
+ 512
+
+ 513
+
+ 514
+ private Model retrievePom(String path, JarFile jar) throws AnalysisException {
+ 515 1 final ZipEntry entry = jar.getEntry(path);
+ 516 1 Model model = null ;
+ 517 1 if (entry != null ) {
+ 518
+ try {
+ 519 1 final NonClosingStream stream = new NonClosingStream(jar.getInputStream(entry));
+ 520 1 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
+ 521 1 final InputSource xml = new InputSource(reader);
+ 522 1 final SAXSource source = new SAXSource(xml);
+ 523 1 model = readPom(source);
+ 524 0 } catch (SecurityException ex) {
+ 525 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s'; invalid signature" , path, jar.getName());
+ 526 0 LOGGER.log(Level.WARNING, msg);
+ 527 0 LOGGER.log(Level.FINE, null , ex);
+ 528 0 throw new AnalysisException(ex);
+ 529 0 } catch (IOException ex) {
+ 530 0 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
+ 531 0 LOGGER.log(Level.WARNING, msg);
+ 532 0 LOGGER.log(Level.FINE, "" , ex);
+ 533 0 throw new AnalysisException(ex);
+ 534 0 } catch (Throwable ex) {
+ 535 0 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
+ 536 0 LOGGER.log(Level.WARNING, msg);
+ 537 0 LOGGER.log(Level.FINE, "" , ex);
+ 538 0 throw new AnalysisException(ex);
+ 539 1 }
+ 540
+ }
+ 541 1 return model;
+ 542
+ }
+ 543
+
+ 544
+
+ 545
+
+ 546
+
+ 547
+
+ 548
+
+ 549
+
+ 550
+
+ 551
+
+ 552
+ private Model retrievePom(File file) throws AnalysisException {
+ 553 0 Model model = null ;
+ 554
+ try {
+ 555 0 final FileInputStream stream = new FileInputStream(file);
+ 556 0 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
+ 557 0 final InputSource xml = new InputSource(reader);
+ 558 0 final SAXSource source = new SAXSource(xml);
+ 559 0 model = readPom(source);
+ 560 0 } catch (SecurityException ex) {
+ 561 0 final String msg = String.format("Unable to parse pom '%s'; invalid signature" , file.getPath());
+ 562 0 LOGGER.log(Level.WARNING, msg);
+ 563 0 LOGGER.log(Level.FINE, null , ex);
+ 564 0 throw new AnalysisException(ex);
+ 565 0 } catch (IOException ex) {
+ 566 0 final String msg = String.format("Unable to parse pom '%s'(IO Exception)" , file.getPath());
+ 567 0 LOGGER.log(Level.WARNING, msg);
+ 568 0 LOGGER.log(Level.FINE, "" , ex);
+ 569 0 throw new AnalysisException(ex);
+ 570 0 } catch (Throwable ex) {
+ 571 0 final String msg = String.format("Unexpected error during parsing of the pom '%s'" , file.getPath());
+ 572 0 LOGGER.log(Level.WARNING, msg);
+ 573 0 LOGGER.log(Level.FINE, "" , ex);
+ 574 0 throw new AnalysisException(ex);
+ 575 0 }
+ 576 0 return model;
+ 577
+ }
+ 578
+
+ 579
+
+ 580
+
581
- }
+
582
- }
- 583 1 final String originalGroupID = groupid;
+
+ 583
+
584
+
+ 585
+
+ 586
+
+ 587
+ private Model readPom(SAXSource source) throws AnalysisException {
+ 588 1 Model model = null ;
+ 589
+ try {
+ 590 1 final XMLFilter filter = new MavenNamespaceFilter();
+ 591 1 final SAXParserFactory spf = SAXParserFactory.newInstance();
+ 592 1 final SAXParser sp = spf.newSAXParser();
+ 593 1 final XMLReader xr = sp.getXMLReader();
+ 594 1 filter.setParent(xr);
+ 595 1 final JAXBElement<Model> el = pomUnmarshaller.unmarshal(source, Model.class );
+ 596 1 model = el.getValue();
+ 597 0 } catch (SecurityException ex) {
+ 598 0 throw new AnalysisException(ex);
+ 599 0 } catch (ParserConfigurationException ex) {
+ 600 0 throw new AnalysisException(ex);
+ 601 0 } catch (SAXException ex) {
+ 602 0 throw new AnalysisException(ex);
+ 603 0 } catch (JAXBException ex) {
+ 604 0 throw new AnalysisException(ex);
+ 605 0 } catch (Throwable ex) {
+ 606 0 throw new AnalysisException(ex);
+ 607 1 }
+ 608 1 return model;
+ 609
+ }
+ 610
- 585 1 if (groupid != null && !groupid.isEmpty()) {
- 586 1 if (groupid.startsWith("org." ) || groupid.startsWith("com." )) {
- 587 1 groupid = groupid.substring(4);
- 588
- }
- 589 1 foundSomething = true ;
- 590 1 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGHEST);
- 591 1 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
- 592 1 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
- 593 1 addMatchingValues(classes, groupid, dependency.getProductEvidence());
- 594 1 if (parentGroupId != null && !parentGroupId.isEmpty() && !parentGroupId.equals(groupid)) {
- 595 1 dependency.getVendorEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.MEDIUM);
- 596 1 dependency.getProductEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.LOW);
- 597 1 addMatchingValues(classes, parentGroupId, dependency.getVendorEvidence());
- 598 1 addMatchingValues(classes, parentGroupId, dependency.getProductEvidence());
- 599
- }
- 600
- } else {
- 601 0 addAsIdentifier = false ;
- 602
- }
- 603
-
- 604 1 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
- 605 1 String parentArtifactId = null ;
- 606
-
- 607 1 if (pom.getParent() != null ) {
- 608 1 parentArtifactId = interpolateString(pom.getParent().getArtifactId(), pomProperties);
- 609 1 if ((artifactid == null || artifactid.isEmpty()) && parentArtifactId != null && !parentArtifactId.isEmpty()) {
- 610 0 artifactid = parentArtifactId;
611
- }
+
612
- }
- 613 1 final String originalArtifactID = artifactid;
- 614 1 if (artifactid != null && !artifactid.isEmpty()) {
- 615 1 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
- 616 0 artifactid = artifactid.substring(4);
+
+ 613
+
+ 614
+
+ 615
+
+ 616
+
617
- }
- 618 1 foundSomething = true ;
- 619 1 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGHEST);
- 620 1 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
- 621 1 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
- 622 1 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
- 623 1 if (parentArtifactId != null && !parentArtifactId.isEmpty() && !parentArtifactId.equals(artifactid)) {
- 624 1 dependency.getProductEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.MEDIUM);
- 625 1 dependency.getVendorEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.LOW);
- 626 1 addMatchingValues(classes, parentArtifactId, dependency.getVendorEvidence());
- 627 1 addMatchingValues(classes, parentArtifactId, dependency.getProductEvidence());
- 628
- }
+
+ 618
+
+ 619
+
+ 620
+
+ 621
+ private boolean setPomEvidence(Dependency dependency, Model pom, Properties pomProperties, ArrayList<ClassNameInformation> classes) {
+ 622 1 boolean foundSomething = false ;
+ 623 1 boolean addAsIdentifier = true ;
+ 624 1 if (pom == null ) {
+ 625 0 return foundSomething;
+ 626
+ }
+ 627 1 String groupid = interpolateString(pom.getGroupId(), pomProperties);
+ 628 1 String parentGroupId = null ;
629
- } else {
- 630 0 addAsIdentifier = false ;
- 631
- }
- 632
-
- 633 1 String version = interpolateString(pom.getVersion(), pomProperties);
- 634 1 String parentVersion = null ;
+
+ 630 1 if (pom.getParent() != null ) {
+ 631 1 parentGroupId = interpolateString(pom.getParent().getGroupId(), pomProperties);
+ 632 1 if ((groupid == null || groupid.isEmpty()) && parentGroupId != null && !parentGroupId.isEmpty()) {
+ 633 0 groupid = parentGroupId;
+ 634
+ }
635
-
- 636 1 if (pom.getParent() != null ) {
- 637 1 parentVersion = interpolateString(pom.getParent().getVersion(), pomProperties);
- 638 1 if ((version == null || version.isEmpty()) && parentVersion != null && !parentVersion.isEmpty()) {
- 639 1 version = parentVersion;
- 640
- }
- 641
}
- 642
+ 636 1 final String originalGroupID = groupid;
+ 637
- 643 1 if (version != null && !version.isEmpty()) {
- 644 1 foundSomething = true ;
- 645 1 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
- 646 1 if (parentVersion != null && !parentVersion.isEmpty() && !parentVersion.equals(version)) {
- 647 0 dependency.getVersionEvidence().addEvidence("pom" , "parent-version" , version, Confidence.LOW);
- 648
- }
+ 638 1 if (groupid != null && !groupid.isEmpty()) {
+ 639 1 foundSomething = true ;
+ 640 1 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGHEST);
+ 641 1 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
+ 642 1 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
+ 643 1 addMatchingValues(classes, groupid, dependency.getProductEvidence());
+ 644 1 if (parentGroupId != null && !parentGroupId.isEmpty() && !parentGroupId.equals(groupid)) {
+ 645 0 dependency.getVendorEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.MEDIUM);
+ 646 0 dependency.getProductEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.LOW);
+ 647 0 addMatchingValues(classes, parentGroupId, dependency.getVendorEvidence());
+ 648 0 addMatchingValues(classes, parentGroupId, dependency.getProductEvidence());
649
+ }
+ 650
} else {
- 650 0 addAsIdentifier = false ;
- 651
- }
+ 651 0 addAsIdentifier = false ;
652
-
- 653 1 if (addAsIdentifier) {
- 654 1 dependency.addIdentifier("maven" , String.format("%s:%s:%s" , originalGroupID, originalArtifactID, version), null , Confidence.LOW);
- 655
}
+ 653
+
+ 654 1 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
+ 655 1 String parentArtifactId = null ;
656
- 657
-
- 658 1 final Organization org = pom.getOrganization();
- 659 1 if (org != null && org.getName() != null ) {
- 660 0 foundSomething = true ;
- 661 0 final String orgName = interpolateString(org.getName(), pomProperties);
- 662 0 if (orgName != null && !orgName.isEmpty()) {
- 663 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
- 664 0 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
- 665
+ 657 1 if (pom.getParent() != null ) {
+ 658 1 parentArtifactId = interpolateString(pom.getParent().getArtifactId(), pomProperties);
+ 659 1 if ((artifactid == null || artifactid.isEmpty()) && parentArtifactId != null && !parentArtifactId.isEmpty()) {
+ 660 0 artifactid = parentArtifactId;
+ 661
}
- 666
+ 662
}
+ 663 1 final String originalArtifactID = artifactid;
+ 664 1 if (artifactid != null && !artifactid.isEmpty()) {
+ 665 1 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
+ 666 0 artifactid = artifactid.substring(4);
667
-
- 668 1 final String pomName = interpolateString(pom.getName(), pomProperties);
- 669 1 if (pomName != null && !pomName.isEmpty()) {
- 670 1 foundSomething = true ;
- 671 1 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 672 1 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
- 673 1 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
- 674 1 addMatchingValues(classes, pomName, dependency.getProductEvidence());
- 675
- }
- 676
-
- 677
-
- 678 1 if (pom.getDescription() != null ) {
- 679 0 foundSomething = true ;
- 680 0 final String description = interpolateString(pom.getDescription(), pomProperties);
- 681 0 if (description != null && !description.isEmpty()) {
- 682 0 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
- 683 0 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
- 684 0 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
- 685
}
- 686
- }
- 687 1 extractLicense(pom, pomProperties, dependency);
- 688 1 return foundSomething;
- 689
- }
- 690
-
- 691
-
- 692
-
- 693
-
- 694
-
- 695
-
- 696
-
- 697
-
- 698
-
- 699
- protected void analyzePackageNames(ArrayList<ClassNameInformation> classNames,
- 700
- Dependency dependency, boolean addPackagesAsEvidence) {
- 701 5 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
- 702 5 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
- 703 5 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
- 704
-
- 705 5 final int classCount = classNames.size();
- 706 5 final EvidenceCollection vendor = dependency.getVendorEvidence();
- 707 5 final EvidenceCollection product = dependency.getProductEvidence();
- 708
-
- 709 5 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
- 710 48 final float ratio = entry.getValue() / (float ) classCount;
- 711 48 if (ratio > 0.5) {
- 712
-
- 713 10 vendor.addWeighting(entry.getKey());
- 714 10 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 715 8 vendor.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
- 716
- }
- 717
+ 668 1 foundSomething = true ;
+ 669 1 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGHEST);
+ 670 1 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
+ 671 1 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
+ 672 1 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
+ 673 1 if (parentArtifactId != null && !parentArtifactId.isEmpty() && !parentArtifactId.equals(artifactid)) {
+ 674 1 dependency.getProductEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.MEDIUM);
+ 675 1 dependency.getVendorEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.LOW);
+ 676 1 addMatchingValues(classes, parentArtifactId, dependency.getVendorEvidence());
+ 677 1 addMatchingValues(classes, parentArtifactId, dependency.getProductEvidence());
+ 678
}
- 718 48 }
- 719 5 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
- 720 985 final float ratio = entry.getValue() / (float ) classCount;
- 721 985 if (ratio > 0.5) {
- 722 5 product.addWeighting(entry.getKey());
- 723 5 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
- 724 4 product.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
- 725
- }
- 726
- }
- 727 985 }
- 728 5 }
- 729
-
- 730
-
- 731
-
- 732
-
- 733
-
- 734
-
- 735
-
- 736
-
- 737
-
- 738
-
- 739
-
- 740
-
- 741
-
- 742
-
- 743
-
- 744
- protected boolean parseManifest(Dependency dependency, ArrayList<ClassNameInformation> classInformation) throws IOException {
- 745 5 boolean foundSomething = false ;
- 746 5 JarFile jar = null ;
- 747
- try {
- 748 5 jar = new JarFile(dependency.getActualFilePath());
- 749
-
- 750 5 final Manifest manifest = jar.getManifest();
- 751
-
- 752 5 if (manifest == null ) {
- 753
-
- 754 0 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
- 755
- && !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar" )
- 756
- && !dependency.getFileName().toLowerCase().endsWith("-src.jar" )
- 757
- && !dependency.getFileName().toLowerCase().endsWith("-doc.jar" )) {
- 758 0 LOGGER.log(Level.FINE,
- 759
- String.format("Jar file '%s' does not contain a manifest." ,
- 760
- dependency.getFileName()));
- 761
- }
- 762 0 return false ;
- 763
- }
- 764 5 final Attributes atts = manifest.getMainAttributes();
- 765
-
- 766 5 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
- 767 5 final EvidenceCollection productEvidence = dependency.getProductEvidence();
- 768 5 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
- 769
-
- 770 5 final String source = "Manifest" ;
- 771
-
- 772 5 for (Entry<Object, Object> entry : atts.entrySet()) {
- 773 65 String key = entry.getKey().toString();
- 774 65 String value = atts.getValue(key);
- 775 65 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
- 776 0 value = Jsoup.parse(value).text();
- 777
- }
- 778 65 if (IGNORE_VALUES.contains(value)) {
- 779 0 continue ;
- 780 65 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
- 781 1 foundSomething = true ;
- 782 1 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 783 1 addMatchingValues(classInformation, value, productEvidence);
- 784 64 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
- 785 2 foundSomething = true ;
- 786 2 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 787 62 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
- 788 1 foundSomething = true ;
- 789 1 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 790 1 addMatchingValues(classInformation, value, vendorEvidence);
- 791 61 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
- 792 0 foundSomething = true ;
- 793 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 794 0 addMatchingValues(classInformation, value, vendorEvidence);
- 795 61 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
- 796 2 foundSomething = true ;
- 797 2 addDescription(dependency, value, "manifest" , key);
- 798
-
- 799 2 addMatchingValues(classInformation, value, productEvidence);
- 800 59 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
- 801 3 foundSomething = true ;
- 802 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 803 3 addMatchingValues(classInformation, value, productEvidence);
- 804 56 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
- 805 3 foundSomething = true ;
- 806 3 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 807 3 addMatchingValues(classInformation, value, vendorEvidence);
- 808 53 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
- 809 3 foundSomething = true ;
- 810 3 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
- 811 50 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
- 812 2 continue ;
- 813
-
- 814
-
- 815
-
- 816
-
- 817
-
- 818
-
- 819
-
- 820
-
- 821
- } else {
- 822 48 key = key.toLowerCase();
- 823
-
- 824 48 if (!IGNORE_KEYS.contains(key)
- 825
- && !key.endsWith("jdk" )
- 826
- && !key.contains("lastmodified" )
- 827
- && !key.endsWith("package" )
- 828
- && !key.endsWith("classpath" )
- 829
- && !key.endsWith("class-path" )
- 830
- && !key.endsWith("-scm" )
- 831
- && !key.startsWith("scm-" )
- 832
- && !value.trim().startsWith("scm:" )
- 833
- && !isImportPackage(key, value)
- 834
- && !isPackage(key, value)) {
- 835
-
- 836 14 foundSomething = true ;
- 837 14 if (key.contains("version" )) {
- 838 1 if (key.contains("specification" )) {
- 839 1 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
- 840
- } else {
- 841 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 842
- }
- 843 13 } else if ("build-id" .equals(key)) {
- 844 0 int pos = value.indexOf('(' );
- 845 0 if (pos >= 0) {
- 846 0 value = value.substring(0, pos - 1);
- 847
- }
- 848 0 pos = value.indexOf('[' );
- 849 0 if (pos >= 0) {
- 850 0 value = value.substring(0, pos - 1);
- 851
- }
- 852 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 853 0 } else if (key.contains("title" )) {
- 854 1 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 855 1 addMatchingValues(classInformation, value, productEvidence);
- 856 12 } else if (key.contains("vendor" )) {
- 857 0 if (key.contains("specification" )) {
- 858 0 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
- 859
- } else {
- 860 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 861 0 addMatchingValues(classInformation, value, vendorEvidence);
- 862
- }
- 863 12 } else if (key.contains("name" )) {
- 864 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 865 3 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
- 866 3 addMatchingValues(classInformation, value, vendorEvidence);
- 867 3 addMatchingValues(classInformation, value, productEvidence);
- 868 9 } else if (key.contains("license" )) {
- 869 2 addLicense(dependency, value);
- 870
- } else {
- 871 7 if (key.contains("description" )) {
- 872 0 addDescription(dependency, value, "manifest" , key);
- 873
- } else {
- 874 7 productEvidence.addEvidence(source, key, value, Confidence.LOW);
- 875 7 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
- 876 7 addMatchingValues(classInformation, value, vendorEvidence);
- 877 7 addMatchingValues(classInformation, value, productEvidence);
- 878 7 if (value.matches(".*\\d.*" )) {
- 879 3 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
- 880 15 while (tokenizer.hasMoreElements()) {
- 881 12 final String s = tokenizer.nextToken();
- 882 12 if (s.matches("^[0-9.]+$" )) {
- 883 1 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
- 884
- }
- 885 12 }
- 886
- }
- 887
- }
- 888
- }
- 889
- }
- 890
- }
- 891 63 }
- 892
- } finally {
- 893 5 if (jar != null ) {
- 894 5 jar.close();
- 895
- }
- 896
- }
- 897 5 return foundSomething;
- 898
- }
- 899
-
- 900
-
- 901
-
- 902
-
- 903
-
- 904
-
- 905
-
- 906
-
- 907
-
- 908
-
- 909
-
- 910
-
- 911
-
- 912
- private String addDescription(Dependency dependency, String description, String source, String key) {
- 913 2 if (dependency.getDescription() == null ) {
- 914 2 dependency.setDescription(description);
- 915
- }
- 916
- String desc;
- 917 2 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
- 918 0 desc = Jsoup.parse(description).text();
- 919
+ 679
} else {
- 920 2 desc = description;
- 921
+ 680 0 addAsIdentifier = false ;
+ 681
}
- 922 2 dependency.setDescription(desc);
- 923 2 if (desc.length() > 100) {
- 924 0 desc = desc.replaceAll("\\s\\s+" , " " );
- 925 0 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
- 926 0 final int posLike = desc.toLowerCase().indexOf("like " , 100);
- 927 0 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
- 928 0 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
- 929 0 int pos = -1;
- 930 0 pos = Math.max(pos, posSuchAs);
- 931 0 if (pos >= 0 && posLike >= 0) {
- 932 0 pos = Math.min(pos, posLike);
- 933
- } else {
- 934 0 pos = Math.max(pos, posLike);
- 935
+ 682
+
+ 683 1 String version = interpolateString(pom.getVersion(), pomProperties);
+ 684 1 String parentVersion = null ;
+ 685
+
+ 686 1 if (pom.getParent() != null ) {
+ 687 1 parentVersion = interpolateString(pom.getParent().getVersion(), pomProperties);
+ 688 1 if ((version == null || version.isEmpty()) && parentVersion != null && !parentVersion.isEmpty()) {
+ 689 1 version = parentVersion;
+ 690
}
- 936 0 if (pos >= 0 && posWillUse >= 0) {
- 937 0 pos = Math.min(pos, posWillUse);
+ 691
+ }
+ 692
+
+ 693 1 if (version != null && !version.isEmpty()) {
+ 694 1 foundSomething = true ;
+ 695 1 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
+ 696 1 if (parentVersion != null && !parentVersion.isEmpty() && !parentVersion.equals(version)) {
+ 697 0 dependency.getVersionEvidence().addEvidence("pom" , "parent-version" , version, Confidence.LOW);
+ 698
+ }
+ 699
+ } else {
+ 700 0 addAsIdentifier = false ;
+ 701
+ }
+ 702
+
+ 703 1 if (addAsIdentifier) {
+ 704 1 dependency.addIdentifier("maven" , String.format("%s:%s:%s" , originalGroupID, originalArtifactID, version), null , Confidence.LOW);
+ 705
+ }
+ 706
+
+ 707
+
+ 708 1 final Organization org = pom.getOrganization();
+ 709 1 if (org != null && org.getName() != null ) {
+ 710 0 foundSomething = true ;
+ 711 0 final String orgName = interpolateString(org.getName(), pomProperties);
+ 712 0 if (orgName != null && !orgName.isEmpty()) {
+ 713 0 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
+ 714 0 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
+ 715
+ }
+ 716
+ }
+ 717
+
+ 718 1 final String pomName = interpolateString(pom.getName(), pomProperties);
+ 719 1 if (pomName != null && !pomName.isEmpty()) {
+ 720 1 foundSomething = true ;
+ 721 1 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 722 1 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+ 723 1 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
+ 724 1 addMatchingValues(classes, pomName, dependency.getProductEvidence());
+ 725
+ }
+ 726
+
+ 727
+
+ 728 1 if (pom.getDescription() != null ) {
+ 729 0 foundSomething = true ;
+ 730 0 final String description = interpolateString(pom.getDescription(), pomProperties);
+ 731 0 if (description != null && !description.isEmpty()) {
+ 732 0 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
+ 733 0 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
+ 734 0 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
+ 735
+ }
+ 736
+ }
+ 737 1 extractLicense(pom, pomProperties, dependency);
+ 738 1 return foundSomething;
+ 739
+ }
+ 740
+
+ 741
+
+ 742
+
+ 743
+
+ 744
+
+ 745
+
+ 746
+
+ 747
+
+ 748
+
+ 749
+ protected void analyzePackageNames(ArrayList<ClassNameInformation> classNames,
+ 750
+ Dependency dependency, boolean addPackagesAsEvidence) {
+ 751 5 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
+ 752 5 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
+ 753 5 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
+ 754
+
+ 755 5 final int classCount = classNames.size();
+ 756 5 final EvidenceCollection vendor = dependency.getVendorEvidence();
+ 757 5 final EvidenceCollection product = dependency.getProductEvidence();
+ 758
+
+ 759 5 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
+ 760 48 final float ratio = entry.getValue() / (float ) classCount;
+ 761 48 if (ratio > 0.5) {
+ 762
+
+ 763 10 vendor.addWeighting(entry.getKey());
+ 764 10 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 765 8 vendor.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
+ 766
+ }
+ 767
+ }
+ 768 48 }
+ 769 5 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
+ 770 985 final float ratio = entry.getValue() / (float ) classCount;
+ 771 985 if (ratio > 0.5) {
+ 772 5 product.addWeighting(entry.getKey());
+ 773 5 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+ 774 4 product.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
+ 775
+ }
+ 776
+ }
+ 777 985 }
+ 778 5 }
+ 779
+
+ 780
+
+ 781
+
+ 782
+
+ 783
+
+ 784
+
+ 785
+
+ 786
+
+ 787
+
+ 788
+
+ 789
+
+ 790
+
+ 791
+
+ 792
+
+ 793
+
+ 794
+ protected boolean parseManifest(Dependency dependency, ArrayList<ClassNameInformation> classInformation) throws IOException {
+ 795 5 boolean foundSomething = false ;
+ 796 5 JarFile jar = null ;
+ 797
+ try {
+ 798 5 jar = new JarFile(dependency.getActualFilePath());
+ 799
+
+ 800 5 final Manifest manifest = jar.getManifest();
+ 801
+
+ 802 5 if (manifest == null ) {
+ 803
+
+ 804 0 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
+ 805
+ && !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar" )
+ 806
+ && !dependency.getFileName().toLowerCase().endsWith("-src.jar" )
+ 807
+ && !dependency.getFileName().toLowerCase().endsWith("-doc.jar" )) {
+ 808 0 LOGGER.log(Level.FINE,
+ 809
+ String.format("Jar file '%s' does not contain a manifest." ,
+ 810
+ dependency.getFileName()));
+ 811
+ }
+ 812 0 return false ;
+ 813
+ }
+ 814 5 final Attributes atts = manifest.getMainAttributes();
+ 815
+
+ 816 5 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
+ 817 5 final EvidenceCollection productEvidence = dependency.getProductEvidence();
+ 818 5 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
+ 819
+
+ 820 5 final String source = "Manifest" ;
+ 821
+
+ 822 5 for (Entry<Object, Object> entry : atts.entrySet()) {
+ 823 65 String key = entry.getKey().toString();
+ 824 65 String value = atts.getValue(key);
+ 825 65 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
+ 826 0 value = Jsoup.parse(value).text();
+ 827
+ }
+ 828 65 if (IGNORE_VALUES.contains(value)) {
+ 829 0 continue ;
+ 830 65 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
+ 831 1 foundSomething = true ;
+ 832 1 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 833 1 addMatchingValues(classInformation, value, productEvidence);
+ 834 64 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
+ 835 2 foundSomething = true ;
+ 836 2 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 837 62 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
+ 838 1 foundSomething = true ;
+ 839 1 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 840 1 addMatchingValues(classInformation, value, vendorEvidence);
+ 841 61 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
+ 842 0 foundSomething = true ;
+ 843 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 844 0 addMatchingValues(classInformation, value, vendorEvidence);
+ 845 61 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
+ 846 2 foundSomething = true ;
+ 847 2 addDescription(dependency, value, "manifest" , key);
+ 848
+
+ 849 2 addMatchingValues(classInformation, value, productEvidence);
+ 850 59 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
+ 851 3 foundSomething = true ;
+ 852 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 853 3 addMatchingValues(classInformation, value, productEvidence);
+ 854 56 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
+ 855 3 foundSomething = true ;
+ 856 3 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 857 3 addMatchingValues(classInformation, value, vendorEvidence);
+ 858 53 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
+ 859 3 foundSomething = true ;
+ 860 3 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+ 861 50 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
+ 862 2 continue ;
+ 863
+
+ 864
+
+ 865
+
+ 866
+
+ 867
+
+ 868
+
+ 869
+
+ 870
+
+ 871
+ } else {
+ 872 48 key = key.toLowerCase();
+ 873
+
+ 874 48 if (!IGNORE_KEYS.contains(key)
+ 875
+ && !key.endsWith("jdk" )
+ 876
+ && !key.contains("lastmodified" )
+ 877
+ && !key.endsWith("package" )
+ 878
+ && !key.endsWith("classpath" )
+ 879
+ && !key.endsWith("class-path" )
+ 880
+ && !key.endsWith("-scm" )
+ 881
+ && !key.startsWith("scm-" )
+ 882
+ && !value.trim().startsWith("scm:" )
+ 883
+ && !isImportPackage(key, value)
+ 884
+ && !isPackage(key, value)) {
+ 885
+
+ 886 14 foundSomething = true ;
+ 887 14 if (key.contains("version" )) {
+ 888 1 if (key.contains("specification" )) {
+ 889 1 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 890
+ } else {
+ 891 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 892
+ }
+ 893 13 } else if ("build-id" .equals(key)) {
+ 894 0 int pos = value.indexOf('(' );
+ 895 0 if (pos >= 0) {
+ 896 0 value = value.substring(0, pos - 1);
+ 897
+ }
+ 898 0 pos = value.indexOf('[' );
+ 899 0 if (pos >= 0) {
+ 900 0 value = value.substring(0, pos - 1);
+ 901
+ }
+ 902 0 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 903 0 } else if (key.contains("title" )) {
+ 904 1 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 905 1 addMatchingValues(classInformation, value, productEvidence);
+ 906 12 } else if (key.contains("vendor" )) {
+ 907 0 if (key.contains("specification" )) {
+ 908 0 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 909
+ } else {
+ 910 0 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 911 0 addMatchingValues(classInformation, value, vendorEvidence);
+ 912
+ }
+ 913 12 } else if (key.contains("name" )) {
+ 914 3 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 915 3 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+ 916 3 addMatchingValues(classInformation, value, vendorEvidence);
+ 917 3 addMatchingValues(classInformation, value, productEvidence);
+ 918 9 } else if (key.contains("license" )) {
+ 919 2 addLicense(dependency, value);
+ 920
+ } else {
+ 921 7 if (key.contains("description" )) {
+ 922 0 addDescription(dependency, value, "manifest" , key);
+ 923
+ } else {
+ 924 7 productEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 925 7 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+ 926 7 addMatchingValues(classInformation, value, vendorEvidence);
+ 927 7 addMatchingValues(classInformation, value, productEvidence);
+ 928 7 if (value.matches(".*\\d.*" )) {
+ 929 3 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
+ 930 15 while (tokenizer.hasMoreElements()) {
+ 931 12 final String s = tokenizer.nextToken();
+ 932 12 if (s.matches("^[0-9.]+$" )) {
+ 933 1 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
+ 934
+ }
+ 935 12 }
+ 936
+ }
+ 937
+ }
938
- } else {
- 939 0 pos = Math.max(pos, posWillUse);
+ }
+ 939
+ }
940
- }
- 941 0 if (pos >= 0 && posUses >= 0) {
- 942 0 pos = Math.min(pos, posUses);
- 943
- } else {
- 944 0 pos = Math.max(pos, posUses);
+ }
+ 941 63 }
+ 942
+ } finally {
+ 943 5 if (jar != null ) {
+ 944 5 jar.close();
945
}
946
+ }
+ 947 5 return foundSomething;
+ 948
+ }
+ 949
- 947 0 if (pos > 0) {
- 948 0 final StringBuilder sb = new StringBuilder(pos + 3);
- 949 0 sb.append(desc.substring(0, pos));
- 950 0 sb.append("..." );
- 951 0 desc = sb.toString();
+ 950
+
+ 951
+
952
- }
- 953 0 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
- 954 0 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
- 955 0 } else {
- 956 2 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
- 957 2 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+
+ 953
+
+ 954
+
+ 955
+
+ 956
+
+ 957
+
958
- }
- 959 2 return desc;
+
+ 959
+
960
- }
+
961
-
+
962
-
- 963
-
- 964
-
+ private String addDescription(Dependency dependency, String description, String source, String key) {
+ 963 2 if (dependency.getDescription() == null ) {
+ 964 2 dependency.setDescription(description);
965
-
+ }
966
-
- 967
-
- 968
- private void addLicense(Dependency d, String license) {
- 969 2 if (d.getLicense() == null ) {
- 970 2 d.setLicense(license);
- 971 0 } else if (!d.getLicense().contains(license)) {
- 972 0 d.setLicense(d.getLicense() + NEWLINE + license);
- 973
+ String desc;
+ 967 2 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
+ 968 0 desc = Jsoup.parse(description).text();
+ 969
+ } else {
+ 970 2 desc = description;
+ 971
}
- 974 2 }
- 975
-
- 976
-
- 977
-
- 978
-
- 979 7 private File tempFileLocation = null ;
- 980
-
- 981
-
- 982
-
+ 972 2 dependency.setDescription(desc);
+ 973 2 if (desc.length() > 100) {
+ 974 0 desc = desc.replaceAll("\\s\\s+" , " " );
+ 975 0 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
+ 976 0 final int posLike = desc.toLowerCase().indexOf("like " , 100);
+ 977 0 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
+ 978 0 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
+ 979 0 int pos = -1;
+ 980 0 pos = Math.max(pos, posSuchAs);
+ 981 0 if (pos >= 0 && posLike >= 0) {
+ 982 0 pos = Math.min(pos, posLike);
983
-
- 984
-
+ } else {
+ 984 0 pos = Math.max(pos, posLike);
985
-
- 986
- @Override
- 987
- public void initializeFileTypeAnalyzer() throws Exception {
- 988 1 final File baseDir = Settings.getTempDirectory();
- 989 1 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
- 990 1 if (!tempFileLocation.delete()) {
- 991 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
- 992 0 throw new AnalysisException(msg);
- 993
- }
- 994 1 if (!tempFileLocation.mkdirs()) {
- 995 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
- 996 0 throw new AnalysisException(msg);
- 997
- }
- 998 1 }
- 999
-
- 1000
-
- 1001
-
- 1002
-
- 1003
- @Override
- 1004
- public void close() {
- 1005 1 if (tempFileLocation != null && tempFileLocation.exists()) {
- 1006 1 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
- 1007 1 final boolean success = FileUtils.delete(tempFileLocation);
- 1008 1 if (!success) {
- 1009 0 LOGGER.log(Level.WARNING,
- 1010
- "Failed to delete some temporary files, see the log for more details" );
- 1011
}
+ 986 0 if (pos >= 0 && posWillUse >= 0) {
+ 987 0 pos = Math.min(pos, posWillUse);
+ 988
+ } else {
+ 989 0 pos = Math.max(pos, posWillUse);
+ 990
+ }
+ 991 0 if (pos >= 0 && posUses >= 0) {
+ 992 0 pos = Math.min(pos, posUses);
+ 993
+ } else {
+ 994 0 pos = Math.max(pos, posUses);
+ 995
+ }
+ 996
+
+ 997 0 if (pos > 0) {
+ 998 0 final StringBuilder sb = new StringBuilder(pos + 3);
+ 999 0 sb.append(desc.substring(0, pos));
+ 1000 0 sb.append("..." );
+ 1001 0 desc = sb.toString();
+ 1002
+ }
+ 1003 0 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
+ 1004 0 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
+ 1005 0 } else {
+ 1006 2 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+ 1007 2 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+ 1008
+ }
+ 1009 2 return desc;
+ 1010
+ }
+ 1011
+
1012
- }
- 1013 1 }
+
+ 1013
+
1014
-
+
1015
-
+
1016
-
+
1017
-
+
1018
-
- 1019
-
- 1020
-
- 1021
-
- 1022
-
+ private void addLicense(Dependency d, String license) {
+ 1019 2 if (d.getLicense() == null ) {
+ 1020 2 d.setLicense(license);
+ 1021 0 } else if (!d.getLicense().contains(license)) {
+ 1022 0 d.setLicense(d.getLicense() + NEWLINE + license);
1023
-
- 1024
-
+ }
+ 1024 2 }
1025
-
+
1026
-
+
1027
-
+
1028
-
- 1029
-
+
+ 1029 7 private File tempFileLocation = null ;
1030
-
+
1031
-
+
1032
-
+
1033
-
+
1034
-
+
1035
-
+
1036
-
+ @Override
1037
-
- 1038
-
- 1039
-
- 1040
-
- 1041
-
- 1042
- protected String interpolateString(String text, Properties properties) {
- 1043 14 Properties props = properties;
- 1044 14 if (text == null ) {
- 1045 1 return text;
- 1046
+ public void initializeFileTypeAnalyzer() throws Exception {
+ 1038 1 final File baseDir = Settings.getTempDirectory();
+ 1039 1 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
+ 1040 1 if (!tempFileLocation.delete()) {
+ 1041 0 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
+ 1042 0 throw new AnalysisException(msg);
+ 1043
}
- 1047 13 if (props == null ) {
- 1048 6 props = new Properties();
+ 1044 1 if (!tempFileLocation.mkdirs()) {
+ 1045 0 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
+ 1046 0 throw new AnalysisException(msg);
+ 1047
+ }
+ 1048 1 }
1049
- }
+
1050
-
- 1051 13 final int pos = text.indexOf("${" );
- 1052 13 if (pos < 0) {
- 1053 10 return text;
- 1054
- }
- 1055 3 final int end = text.indexOf("}" );
- 1056 3 if (end < pos) {
- 1057 0 return text;
- 1058
- }
- 1059
-
- 1060 3 final String propName = text.substring(pos + 2, end);
- 1061 3 String propValue = interpolateString(props.getProperty(propName), props);
- 1062 3 if (propValue == null ) {
- 1063 0 propValue = "" ;
- 1064
- }
- 1065 3 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
- 1066 3 sb.append(text.subSequence(0, pos));
- 1067 3 sb.append(propValue);
- 1068 3 sb.append(text.substring(end + 1));
- 1069 3 return interpolateString(sb.toString(), props);
- 1070
- }
- 1071
-
- 1072
- 1073
-
- 1074
-
- 1075
-
- 1076
-
- 1077
-
- 1078
+ 1051
+
+ 1052
- 1079
- private boolean isImportPackage(String key, String value) {
- 1080 15 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
- 1081 15 final boolean matches = packageRx.matcher(value).matches();
- 1082 15 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
- 1083
- }
- 1084
+ 1053
+ @Override
+ 1054
+ public void close() {
+ 1055 1 if (tempFileLocation != null && tempFileLocation.exists()) {
+ 1056 1 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
+ 1057 1 final boolean success = FileUtils.delete(tempFileLocation);
+ 1058 1 if (!success) {
+ 1059 0 LOGGER.log(Level.WARNING,
+ 1060
+ "Failed to delete some temporary files, see the log for more details" );
+ 1061
+ }
+ 1062
+ }
+ 1063 1 }
+ 1064
- 1085
+ 1065
+ 1066
+
+ 1067
+
+ 1068
+
+ 1069
+
+ 1070
+
+ 1071
+
+ 1072
+
+ 1073
+
+ 1074
+
+ 1075
+
+ 1076
+
+ 1077
+
+ 1078
+
+ 1079
+
+ 1080
+
+ 1081
+
+ 1082
+
+ 1083
+
+ 1084
+
+ 1085
+
1086
-
+
1087
-
- 1088
+ 1088
+
1089
-
+
1090
-
+
1091
1092
- private ArrayList<ClassNameInformation> collectClassNames(Dependency dependency) {
- 1093 5 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
- 1094 5 JarFile jar = null ;
- 1095
- try {
- 1096 5 jar = new JarFile(dependency.getActualFilePath());
- 1097 5 final Enumeration entries = jar.entries();
- 1098 1848 while (entries.hasMoreElements()) {
- 1099 1843 final JarEntry entry = (JarEntry) entries.nextElement();
- 1100 1843 final String name = entry.getName().toLowerCase();
- 1101
-
- 1102 1843 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
- 1103 1535 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
- 1104 1535 classNames.add(className);
- 1105
- }
- 1106 1843 }
- 1107 0 } catch (IOException ex) {
- 1108 0 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
- 1109 0 LOGGER.log(Level.WARNING, msg);
- 1110 0 LOGGER.log(Level.FINE, null , ex);
- 1111
- } finally {
- 1112 5 if (jar != null ) {
- 1113
- try {
- 1114 5 jar.close();
- 1115 0 } catch (IOException ex) {
- 1116 0 LOGGER.log(Level.FINEST, null , ex);
- 1117 5 }
- 1118
- }
- 1119
+ protected String interpolateString(String text, Properties properties) {
+ 1093 14 Properties props = properties;
+ 1094 14 if (text == null ) {
+ 1095 1 return text;
+ 1096
}
- 1120 5 return classNames;
- 1121
+ 1097 13 if (props == null ) {
+ 1098 6 props = new Properties();
+ 1099
+ }
+ 1100
+
+ 1101 13 final int pos = text.indexOf("${" );
+ 1102 13 if (pos < 0) {
+ 1103 10 return text;
+ 1104
+ }
+ 1105 3 final int end = text.indexOf("}" );
+ 1106 3 if (end < pos) {
+ 1107 0 return text;
+ 1108
+ }
+ 1109
+
+ 1110 3 final String propName = text.substring(pos + 2, end);
+ 1111 3 String propValue = interpolateString(props.getProperty(propName), props);
+ 1112 3 if (propValue == null ) {
+ 1113 0 propValue = "" ;
+ 1114
+ }
+ 1115 3 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
+ 1116 3 sb.append(text.subSequence(0, pos));
+ 1117 3 sb.append(propValue);
+ 1118 3 sb.append(text.substring(end + 1));
+ 1119 3 return interpolateString(sb.toString(), props);
+ 1120
}
+ 1121
+
1122
-
+
1123
-
+
1124
-
+
1125
-
+
1126
-
+
1127
-
+
1128
-
+
1129
-
- 1130
-
- 1131
- private void analyzeFullyQualifiedClassNames(ArrayList<ClassNameInformation> classNames,
- 1132
- HashMap<String, Integer> vendor, HashMap<String, Integer> product) {
- 1133 5 for (ClassNameInformation entry : classNames) {
- 1134 1535 final ArrayList<String> list = entry.getPackageStructure();
- 1135 1535 addEntry(vendor, list.get(0));
+ private boolean isImportPackage(String key, String value) {
+ 1130 15 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
+ 1131 15 final boolean matches = packageRx.matcher(value).matches();
+ 1132 15 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
+ 1133
+ }
+ 1134
+
+ 1135
+
1136
-
- 1137 1535 if (list.size() == 2) {
- 1138 0 addEntry(product, list.get(1));
+
+ 1137
+
+ 1138
+
1139
- }
- 1140 1535 if (list.size() == 3) {
- 1141 345 addEntry(vendor, list.get(1));
- 1142 345 addEntry(product, list.get(1));
- 1143 345 addEntry(product, list.get(2));
- 1144
- }
- 1145 1535 if (list.size() >= 4) {
- 1146 1190 addEntry(vendor, list.get(1));
- 1147 1190 addEntry(vendor, list.get(2));
- 1148 1190 addEntry(product, list.get(1));
- 1149 1190 addEntry(product, list.get(2));
- 1150 1190 addEntry(product, list.get(3));
+
+ 1140
+
+ 1141
+
+ 1142
+ private ArrayList<ClassNameInformation> collectClassNames(Dependency dependency) {
+ 1143 5 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
+ 1144 5 JarFile jar = null ;
+ 1145
+ try {
+ 1146 5 jar = new JarFile(dependency.getActualFilePath());
+ 1147 5 final Enumeration entries = jar.entries();
+ 1148 1848 while (entries.hasMoreElements()) {
+ 1149 1843 final JarEntry entry = (JarEntry) entries.nextElement();
+ 1150 1843 final String name = entry.getName().toLowerCase();
1151
- }
- 1152 1535 }
- 1153 5 }
- 1154
-
+
+ 1152 1843 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
+ 1153 1535 final ClassNameInformation className = new ClassNameInformation(name.substring(0, name.length() - 6));
+ 1154 1535 classNames.add(className);
1155
-
- 1156
-
- 1157
-
- 1158
-
- 1159
-
- 1160
-
- 1161
-
- 1162
- private void addEntry(HashMap<String, Integer> collection, String key) {
- 1163 8520 if (collection.containsKey(key)) {
- 1164 7487 collection.put(key, collection.get(key) + 1);
- 1165
- } else {
- 1166 1033 collection.put(key, 1);
- 1167
- }
- 1168 8520 }
- 1169
-
- 1170
-
- 1171
-
- 1172
-
- 1173
-
- 1174
-
- 1175
-
- 1176
-
- 1177
-
- 1178
-
- 1179
- private void addMatchingValues(ArrayList<ClassNameInformation> classes, String value, EvidenceCollection evidence) {
- 1180 41 if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) {
- 1181 0 return ;
- 1182
- }
- 1183 41 final String text = value.toLowerCase();
- 1184 41 for (ClassNameInformation cni : classes) {
- 1185 16500 for (String key : cni.getPackageStructure()) {
- 1186 63820 if (text.contains(key)) {
- 1187 15400 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
- 1188
}
- 1189 63820 }
- 1190 16500 }
- 1191 41 }
- 1192
+ 1156 1843 }
+ 1157 0 } catch (IOException ex) {
+ 1158 0 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
+ 1159 0 LOGGER.log(Level.WARNING, msg);
+ 1160 0 LOGGER.log(Level.FINE, null , ex);
+ 1161
+ } finally {
+ 1162 5 if (jar != null ) {
+ 1163
+ try {
+ 1164 5 jar.close();
+ 1165 0 } catch (IOException ex) {
+ 1166 0 LOGGER.log(Level.FINEST, null , ex);
+ 1167 5 }
+ 1168
+ }
+ 1169
+ }
+ 1170 5 return classNames;
+ 1171
+ }
+ 1172
- 1193
+ 1173
- 1194
-
- 1195
+ 1174
+
+ 1175
+
+ 1176
- 1196
-
- 1197
-
- 1198
-
- 1199
+ 1177
+
+ 1178
+
+ 1179
+
+ 1180
- 1200
- private boolean isPackage(String key, String value) {
- 1201
+ 1181
+ private void analyzeFullyQualifiedClassNames(ArrayList<ClassNameInformation> classNames,
+ 1182
+ HashMap<String, Integer> vendor, HashMap<String, Integer> product) {
+ 1183 5 for (ClassNameInformation entry : classNames) {
+ 1184 1535 final ArrayList<String> list = entry.getPackageStructure();
+ 1185 1535 addEntry(vendor, list.get(0));
+ 1186
- 1202 15 return !key.matches(".*(version|title|vendor|name|license|description).*" )
- 1203
- && value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$" );
+ 1187 1535 if (list.size() == 2) {
+ 1188 0 addEntry(product, list.get(1));
+ 1189
+ }
+ 1190 1535 if (list.size() == 3) {
+ 1191 345 addEntry(vendor, list.get(1));
+ 1192 345 addEntry(product, list.get(1));
+ 1193 345 addEntry(product, list.get(2));
+ 1194
+ }
+ 1195 1535 if (list.size() >= 4) {
+ 1196 1190 addEntry(vendor, list.get(1));
+ 1197 1190 addEntry(vendor, list.get(2));
+ 1198 1190 addEntry(product, list.get(1));
+ 1199 1190 addEntry(product, list.get(2));
+ 1200 1190 addEntry(product, list.get(3));
+ 1201
+ }
+ 1202 1535 }
+ 1203 5 }
1204
1205
- }
+
1206
-
+
1207
-
+
1208
-
- 1209
+ 1209
+
1210
-
+
1211
-
+
1212
-
- 1213
-
- 1214
- private void extractLicense(Model pom, Properties pomProperties, Dependency dependency) {
+ private void addEntry(HashMap<String, Integer> collection, String key) {
+ 1213 8520 if (collection.containsKey(key)) {
+ 1214 7487 collection.put(key, collection.get(key) + 1);
1215
-
- 1216 1 if (pom.getLicenses() != null ) {
- 1217 0 String license = null ;
- 1218 0 for (License lic : pom.getLicenses().getLicense()) {
- 1219 0 String tmp = null ;
- 1220 0 if (lic.getName() != null ) {
- 1221 0 tmp = interpolateString(lic.getName(), pomProperties);
- 1222
- }
- 1223 0 if (lic.getUrl() != null ) {
- 1224 0 if (tmp == null ) {
- 1225 0 tmp = interpolateString(lic.getUrl(), pomProperties);
- 1226
- } else {
- 1227 0 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
- 1228
- }
- 1229
- }
- 1230 0 if (tmp == null ) {
- 1231 0 continue ;
- 1232
- }
- 1233 0 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
- 1234 0 tmp = Jsoup.parse(tmp).text();
- 1235
- }
- 1236 0 if (license == null ) {
- 1237 0 license = tmp;
- 1238
- } else {
- 1239 0 license += "\n" + tmp;
- 1240
- }
- 1241 0 }
- 1242 0 if (license != null ) {
- 1243 0 dependency.setLicense(license);
- 1244
- }
- 1245
+ } else {
+ 1216 1033 collection.put(key, 1);
+ 1217
}
- 1246 1 }
- 1247
+ 1218 8520 }
+ 1219
- 1248
+ 1220
- 1249
-
- 1250
+ 1221
+
+ 1222
+
+ 1223
+
+ 1224
+
+ 1225
+
+ 1226
+
+ 1227
+
+ 1228
- 1251
- protected static class ClassNameInformation {
- 1252
+ 1229
+ private void addMatchingValues(ArrayList<ClassNameInformation> classes, String value, EvidenceCollection evidence) {
+ 1230 39 if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) {
+ 1231 0 return ;
+ 1232
+ }
+ 1233 39 final String text = value.toLowerCase();
+ 1234 39 for (ClassNameInformation cni : classes) {
+ 1235 15708 for (String key : cni.getPackageStructure()) {
+ 1236 60662 if (text.contains(key)) {
+ 1237 14608 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
+ 1238
+ }
+ 1239 60662 }
+ 1240 15708 }
+ 1241 39 }
+ 1242
+ 1243
+
+ 1244
+
+ 1245
+
+ 1246
+
+ 1247
+
+ 1248
+
+ 1249
+
+ 1250
+ private boolean isPackage(String key, String value) {
+ 1251
+
+ 1252 15 return !key.matches(".*(version|title|vendor|name|license|description).*" )
1253
-
+ && value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$" );
1254
-
+
1255
-
+ }
1256
-
+
1257
-
+
1258
-
+
1259
-
+
1260
-
+
1261
-
+
1262
-
+
1263
-
+
1264
-
+ private void extractLicense(Model pom, Properties pomProperties, Dependency dependency) {
1265
-
- 1266
-
- 1267
-
- 1268
-
- 1269
-
- 1270
-
- 1271
-
+
+ 1266 1 if (pom.getLicenses() != null ) {
+ 1267 0 String license = null ;
+ 1268 0 for (License lic : pom.getLicenses().getLicense()) {
+ 1269 0 String tmp = null ;
+ 1270 0 if (lic.getName() != null ) {
+ 1271 0 tmp = interpolateString(lic.getName(), pomProperties);
1272
-
- 1273 1535 ClassNameInformation(String className) {
- 1274 1535 name = className;
- 1275 1535 if (name.contains("/" )) {
- 1276 1535 final String[] tmp = className.toLowerCase().split("/" );
- 1277 1535 int start = 0;
- 1278 1535 int end = 3;
- 1279 1535 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
- 1280 1535 start = 1;
- 1281 1535 end = 4;
+ }
+ 1273 0 if (lic.getUrl() != null ) {
+ 1274 0 if (tmp == null ) {
+ 1275 0 tmp = interpolateString(lic.getUrl(), pomProperties);
+ 1276
+ } else {
+ 1277 0 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
+ 1278
+ }
+ 1279
+ }
+ 1280 0 if (tmp == null ) {
+ 1281 0 continue ;
1282
}
- 1283 1535 if (tmp.length <= end) {
- 1284 345 end = tmp.length - 1;
+ 1283 0 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
+ 1284 0 tmp = Jsoup.parse(tmp).text();
1285
}
- 1286 7330 for (int i = start; i <= end; i++) {
- 1287 5795 packageStructure.add(tmp[i]);
+ 1286 0 if (license == null ) {
+ 1287 0 license = tmp;
1288
+ } else {
+ 1289 0 license += "\n" + tmp;
+ 1290
}
- 1289 1535 } else {
- 1290 0 packageStructure.add(name);
- 1291
- }
- 1292 1535 }
- 1293
-
+ 1291 0 }
+ 1292 0 if (license != null ) {
+ 1293 0 dependency.setLicense(license);
1294
-
+ }
1295
-
- 1296
- private String name;
+ }
+ 1296 1 }
1297
1298
-
- 1299
-
- 1300
-
- 1301
-
- 1302
-
- 1303
- public String getName() {
- 1304
- return name;
- 1305
- }
- 1306
-
- 1307
-
- 1308
-
- 1309
-
- 1310
-
- 1311
-
- 1312
- public void setName(String name) {
- 1313
- this .name = name;
- 1314
- }
- 1315
-
- 1316
-
- 1317
-
- 1318 1535 private final ArrayList<String> packageStructure = new ArrayList<String>();
- 1319
-
- 1320
-
- 1321
-
- 1322
-
- 1323
-
- 1324
-
- 1325
- public ArrayList<String> getPackageStructure() {
- 1326
- return packageStructure;
- 1327
- }
- 1328
- }
- 1329
-
- 1330
- 1331
-
- 1332
-
- 1333
-
- 1334
-
- 1335
+ 1299
+
+ 1300
- 1336
- private File getNextTempDirectory() throws AnalysisException {
- 1337 0 dirCount += 1;
- 1338 0 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
- 1339
-
- 1340 0 if (directory.exists()) {
- 1341 0 return getNextTempDirectory();
- 1342
- }
- 1343 0 if (!directory.mkdirs()) {
- 1344 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
- 1345 0 throw new AnalysisException(msg);
+ 1301
+ protected static class ClassNameInformation {
+ 1302
+
+ 1303
+
+ 1304
+
+ 1305
+
+ 1306
+
+ 1307
+
+ 1308
+
+ 1309
+
+ 1310
+
+ 1311
+
+ 1312
+
+ 1313
+
+ 1314
+
+ 1315
+
+ 1316
+
+ 1317
+
+ 1318
+
+ 1319
+
+ 1320
+
+ 1321
+
+ 1322
+
+ 1323 1535 ClassNameInformation(String className) {
+ 1324 1535 name = className;
+ 1325 1535 if (name.contains("/" )) {
+ 1326 1535 final String[] tmp = className.toLowerCase().split("/" );
+ 1327 1535 int start = 0;
+ 1328 1535 int end = 3;
+ 1329 1535 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
+ 1330 1535 start = 1;
+ 1331 1535 end = 4;
+ 1332
+ }
+ 1333 1535 if (tmp.length <= end) {
+ 1334 345 end = tmp.length - 1;
+ 1335
+ }
+ 1336 7330 for (int i = start; i <= end; i++) {
+ 1337 5795 packageStructure.add(tmp[i]);
+ 1338
+ }
+ 1339 1535 } else {
+ 1340 0 packageStructure.add(name);
+ 1341
+ }
+ 1342 1535 }
+ 1343
+
+ 1344
+
+ 1345
+
1346
- }
- 1347 0 return directory;
+ private String name;
+ 1347
+
1348
- }
+
1349
+
+ 1350
+
+ 1351
+
+ 1352
+
+ 1353
+ public String getName() {
+ 1354
+ return name;
+ 1355
+ }
+ 1356
+
+ 1357
+
+ 1358
+
+ 1359
+
+ 1360
+
+ 1361
+
+ 1362
+ public void setName(String name) {
+ 1363
+ this .name = name;
+ 1364
+ }
+ 1365
+
+ 1366
+
+ 1367
+
+ 1368 1535 private final ArrayList<String> packageStructure = new ArrayList<String>();
+ 1369
+
+ 1370
+
+ 1371
+
+ 1372
+
+ 1373
+
+ 1374
+
+ 1375
+ public ArrayList<String> getPackageStructure() {
+ 1376
+ return packageStructure;
+ 1377
+ }
+ 1378
+ }
+ 1379
+
+ 1380
+
+ 1381
+
+ 1382
+
+ 1383
+
+ 1384
+
+ 1385
+
+ 1386
+ private File getNextTempDirectory() throws AnalysisException {
+ 1387 0 dirCount += 1;
+ 1388 0 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+ 1389
+
+ 1390 0 if (directory.exists()) {
+ 1391 0 return getNextTempDirectory();
+ 1392
+ }
+ 1393 0 if (!directory.mkdirs()) {
+ 1394 0 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+ 1395 0 throw new AnalysisException(msg);
+ 1396
+ }
+ 1397 0 return directory;
+ 1398
+ }
+ 1399
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
index 28df59f0b..ca52f764b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.JavaScriptAnalyzer.html
@@ -275,6 +275,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
index 4a6ead028..1b16f4628 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NexusAnalyzer.html
@@ -12,7 +12,7 @@
@@ -82,7 +82,7 @@
32
import org.owasp.dependencycheck.dependency.Dependency;
33
- import org.owasp.dependencycheck.dependency.Identifier;
+ import org.owasp.dependencycheck.utils.InvalidSettingException;
34
import org.owasp.dependencycheck.utils.Settings;
35
@@ -115,242 +115,299 @@
49
- 50
- public class NexusAnalyzer extends AbstractFileTypeAnalyzer {
+ 50 2 public class NexusAnalyzer extends AbstractFileTypeAnalyzer {
51
52
53
-
+
54
- 55 1 private static final Logger LOGGER = Logger.getLogger(NexusAnalyzer.class .getName());
+ 55
+ public static final String DEFAULT_URL = "https://repository.sonatype.org/service/local/" ;
56
57
58
-
+
59
- 60
- private static final String ANALYZER_NAME = "Nexus Analyzer" ;
+ 60 1 private static final Logger LOGGER = Logger.getLogger(NexusAnalyzer.class .getName());
61
62
63
-
+
64
- 65 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+ 65
+ private static final String ANALYZER_NAME = "Nexus Analyzer" ;
66
67
68
-
+
69
- 70 1 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
+ 70 1 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
71
72
73
-
+
74
- 75
- private NexusSearch searcher;
+ 75 1 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
76
77
78
-
+
79
-
+
80
-
+ private NexusSearch searcher;
81
-
+
82
- @Override
+
83
- public void initializeFileTypeAnalyzer() throws Exception {
- 84 0 LOGGER.fine("Initializing Nexus Analyzer" );
- 85 0 LOGGER.fine(String.format("Nexus Analyzer enabled: %s" , isEnabled()));
- 86 0 if (isEnabled()) {
- 87 0 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL);
- 88 0 LOGGER.fine(String.format("Nexus Analyzer URL: %s" , searchUrl));
+
+ 84
+
+ 85 2 private final boolean enabled = checkEnabled();
+ 86
+
+ 87
+
+ 88
+
89
- try {
- 90 0 searcher = new NexusSearch(new URL(searchUrl));
- 91 0 if (!searcher.preflightRequest()) {
- 92 0 LOGGER.warning("There was an issue getting Nexus status. Disabling analyzer." );
- 93 0 setEnabled(false );
+
+ 90
+
+ 91
+
+ 92
+ private boolean checkEnabled() {
+ 93
+
94
- }
- 95 0 } catch (MalformedURLException mue) {
+
+ 95
+
96
-
- 97
-
- 98 0 LOGGER.warning(String.format("Property %s not a valid URL. Nexus Analyzer disabled" , searchUrl));
- 99 0 setEnabled(false );
- 100 0 }
- 101
- }
- 102 0 }
- 103
-
- 104
-
- 105
-
- 106
-
- 107
-
- 108
-
- 109
- @Override
- 110
- public String getName() {
- 111 4 return ANALYZER_NAME;
- 112
- }
- 113
-
- 114
-
- 115
-
- 116
-
- 117
-
- 118
-
- 119
- @Override
- 120
- protected String getAnalyzerEnabledSettingKey() {
- 121 2 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
- 122
- }
- 123
-
- 124
-
- 125
-
- 126
-
- 127
-
- 128
-
- 129
- @Override
- 130
- public AnalysisPhase getAnalysisPhase() {
- 131 1 return ANALYSIS_PHASE;
- 132
- }
- 133
-
- 134
-
- 135
-
- 136
-
- 137
-
- 138
-
- 139
- @Override
- 140
- public Set<String> getSupportedExtensions() {
- 141 0 return SUPPORTED_EXTENSIONS;
- 142
- }
- 143
-
- 144
-
- 145
-
- 146
-
- 147
-
- 148
-
- 149
-
- 150
-
- 151
- @Override
- 152
- public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
- 153
+
+ 97 2 boolean retval = false ;
+ 98
try {
- 154 0 final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum());
- 155 0 if (ma.getGroupId() != null && !"" .equals(ma.getGroupId())) {
- 156 0 dependency.getVendorEvidence().addEvidence("nexus" , "groupid" , ma.getGroupId(), Confidence.HIGH);
- 157
+ 99 2 if ((!DEFAULT_URL.equals(Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL)))
+ 100
+ && Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED)) {
+ 101 0 LOGGER.info("Enabling Nexus analyzer" );
+ 102 0 retval = true ;
+ 103
+ } else {
+ 104 2 LOGGER.info("Nexus analyzer disabled, using Central instead" );
+ 105
}
- 158 0 if (ma.getArtifactId() != null && !"" .equals(ma.getArtifactId())) {
- 159 0 dependency.getProductEvidence().addEvidence("nexus" , "artifactid" , ma.getArtifactId(), Confidence.HIGH);
- 160
- }
- 161 0 if (ma.getVersion() != null && !"" .equals(ma.getVersion())) {
- 162 0 dependency.getVersionEvidence().addEvidence("nexus" , "version" , ma.getVersion(), Confidence.HIGH);
- 163
- }
- 164 0 if (ma.getArtifactUrl() != null && !"" .equals(ma.getArtifactUrl())) {
- 165 0 boolean found = false ;
- 166 0 for (Identifier i : dependency.getIdentifiers()) {
- 167 0 if ("maven" .equals(i.getType()) && i.getValue().equals(ma.toString())) {
- 168 0 found = true ;
- 169 0 i.setConfidence(Confidence.HIGHEST);
- 170 0 i.setUrl(ma.getArtifactUrl());
- 171 0 break ;
- 172
- }
- 173 0 }
- 174 0 if (!found) {
- 175 0 dependency.addIdentifier("maven" , ma.toString(), ma.getArtifactUrl(), Confidence.HIGHEST);
- 176
+ 106 0 } catch (InvalidSettingException ise) {
+ 107 0 LOGGER.warning("Invalid setting. Disabling Nexus analyzer" );
+ 108 2 }
+ 109
+
+ 110 2 return retval;
+ 111
+ }
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+ @Override
+ 119
+ public boolean isEnabled() {
+ 120
+ return enabled;
+ 121
+ }
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+ @Override
+ 129
+ public void initializeFileTypeAnalyzer() throws Exception {
+ 130 0 LOGGER.fine("Initializing Nexus Analyzer" );
+ 131 0 LOGGER.fine(String.format("Nexus Analyzer enabled: %s" , isEnabled()));
+ 132 0 if (isEnabled()) {
+ 133 0 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL);
+ 134 0 LOGGER.fine(String.format("Nexus Analyzer URL: %s" , searchUrl));
+ 135
+ try {
+ 136 0 searcher = new NexusSearch(new URL(searchUrl));
+ 137 0 if (!searcher.preflightRequest()) {
+ 138 0 LOGGER.warning("There was an issue getting Nexus status. Disabling analyzer." );
+ 139 0 setEnabled(false );
+ 140
}
- 177
- }
- 178 0 } catch (IllegalArgumentException iae) {
+ 141 0 } catch (MalformedURLException mue) {
+ 142
+
+ 143
+
+ 144 0 LOGGER.warning(String.format("Property %s not a valid URL. Nexus Analyzer disabled" , searchUrl));
+ 145 0 setEnabled(false );
+ 146 0 }
+ 147
+ }
+ 148 0 }
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+ @Override
+ 156
+ public String getName() {
+ 157 4 return ANALYZER_NAME;
+ 158
+ }
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+ @Override
+ 166
+ protected String getAnalyzerEnabledSettingKey() {
+ 167 2 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
+ 168
+ }
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+ @Override
+ 176
+ public AnalysisPhase getAnalysisPhase() {
+ 177 1 return ANALYSIS_PHASE;
+ 178
+ }
179
-
- 180 0 LOGGER.info(String.format("invalid sha-1 hash on %s" , dependency.getFileName()));
- 181 0 } catch (FileNotFoundException fnfe) {
+
+ 180
+
+ 181
+
182
-
- 183 0 LOGGER.fine(String.format("Artifact not found in repository '%s'" , dependency.getFileName()));
- 184 0 LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
- 185 0 } catch (IOException ioe) {
+
+ 183
+
+ 184
+
+ 185
+ @Override
186
-
- 187 0 LOGGER.log(Level.FINE, "Could not connect to nexus repository" , ioe);
- 188 0 }
- 189 0 }
+ public Set<String> getSupportedExtensions() {
+ 187 0 return SUPPORTED_EXTENSIONS;
+ 188
+ }
+ 189
+
190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+ @Override
+ 198
+ public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
+ 199 0 if (!isEnabled()) {
+ 200 0 return ;
+ 201
+ }
+ 202
+ try {
+ 203 0 final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum());
+ 204 0 dependency.addAsEvidence("nexus" , ma, Confidence.HIGH);
+ 205 0 } catch (IllegalArgumentException iae) {
+ 206
+
+ 207 0 LOGGER.info(String.format("invalid sha-1 hash on %s" , dependency.getFileName()));
+ 208 0 } catch (FileNotFoundException fnfe) {
+ 209
+
+ 210 0 LOGGER.fine(String.format("Artifact not found in repository '%s'" , dependency.getFileName()));
+ 211 0 LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
+ 212 0 } catch (IOException ioe) {
+ 213
+
+ 214 0 LOGGER.log(Level.FINE, "Could not connect to nexus repository" , ioe);
+ 215 0 }
+ 216 0 }
+ 217
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
index c350378f6..1a0f35080 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NuspecAnalyzer.html
@@ -297,6 +297,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
index 64ab5b0a9..931f0fa98 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.NvdCveAnalyzer.html
@@ -12,7 +12,7 @@
@@ -207,7 +207,7 @@
100
public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
101 2 for (Identifier id : dependency.getIdentifiers()) {
- 102 2 if ("cpe" .equals(id.getType())) {
+ 102 4 if ("cpe" .equals(id.getType())) {
103
try {
104 2 final String value = id.getValue();
@@ -218,7 +218,7 @@
109 2 }
110
}
- 111 2 }
+ 111 4 }
112 2 for (Identifier id : dependency.getSuppressedIdentifiers()) {
113 0 if ("cpe" .equals(id.getType())) {
114
@@ -293,6 +293,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
index 649836cf4..50e70bfd4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.VulnerabilitySuppressionAnalyzer.html
@@ -153,13 +153,13 @@
70
71 2 for (final SuppressionRule rule : getRules()) {
- 72 10 rule.process(dependency);
- 73 10 }
+ 72 16 rule.process(dependency);
+ 73 16 }
74 2 }
75
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
index 8bb0d6f42..d9eb51f79 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.AnalysisException.html
@@ -151,6 +151,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
index dc65720cd..8fde0b314 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.analyzer.exception.ArchiveExtractionException.html
@@ -151,6 +151,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
new file mode 100644
index 000000000..e6eeee73d
--- /dev/null
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.central.CentralSearch.html
@@ -0,0 +1,280 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.data.central.CentralSearch
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.data.central;
+ 19
+
+ 20
+ import java.io.FileNotFoundException;
+ 21
+ import java.io.IOException;
+ 22
+ import java.net.HttpURLConnection;
+ 23
+ import java.net.URL;
+ 24
+ import java.util.ArrayList;
+ 25
+ import java.util.List;
+ 26
+ import java.util.logging.Logger;
+ 27
+ import javax.xml.parsers.DocumentBuilder;
+ 28
+ import javax.xml.parsers.DocumentBuilderFactory;
+ 29
+ import javax.xml.xpath.XPath;
+ 30
+ import javax.xml.xpath.XPathConstants;
+ 31
+ import javax.xml.xpath.XPathFactory;
+ 32
+ import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+ 33
+ import org.owasp.dependencycheck.utils.Settings;
+ 34
+ import org.owasp.dependencycheck.utils.URLConnectionFactory;
+ 35
+ import org.w3c.dom.Document;
+ 36
+ import org.w3c.dom.NodeList;
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43
+ public class CentralSearch {
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+ private final URL rootURL;
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+ private boolean useProxy;
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58 1 private static final Logger LOGGER = Logger.getLogger(CentralSearch.class .getName());
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66 6 public CentralSearch(URL rootURL) {
+ 67 6 this .rootURL = rootURL;
+ 68 6 if (null != Settings.getString(Settings.KEYS.PROXY_SERVER)) {
+ 69 0 useProxy = true ;
+ 70 0 LOGGER.fine("Using proxy" );
+ 71
+ } else {
+ 72 6 useProxy = false ;
+ 73 6 LOGGER.fine("Not using proxy" );
+ 74
+ }
+ 75 6 }
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+ public List<MavenArtifact> searchSha1(String sha1) throws IOException {
+ 87 7 if (null == sha1 || !sha1.matches("^[0-9A-Fa-f]{40}$" )) {
+ 88 2 throw new IllegalArgumentException("Invalid SHA1 format" );
+ 89
+ }
+ 90
+
+ 91 5 final URL url = new URL(rootURL + String.format("?q=1:\"%s\"&wt=xml" , sha1));
+ 92
+
+ 93 5 LOGGER.fine(String.format("Searching Central url %s" , url.toString()));
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99 5 final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+ 100
+
+ 101 5 conn.setDoOutput(true );
+ 102
+
+ 103
+
+ 104
+
+ 105 5 conn.addRequestProperty("Accept" , "application/xml" );
+ 106 5 conn.connect();
+ 107
+
+ 108 5 if (conn.getResponseCode() == 200) {
+ 109 5 boolean missing = false ;
+ 110
+ try {
+ 111 5 final DocumentBuilder builder = DocumentBuilderFactory
+ 112
+ .newInstance().newDocumentBuilder();
+ 113 5 final Document doc = builder.parse(conn.getInputStream());
+ 114 5 final XPath xpath = XPathFactory.newInstance().newXPath();
+ 115 5 final String numFound = xpath.evaluate("/response/result/@numFound" , doc);
+ 116 5 if ("0" .equals(numFound)) {
+ 117 1 missing = true ;
+ 118
+ } else {
+ 119 4 final ArrayList<MavenArtifact> result = new ArrayList<MavenArtifact>();
+ 120 4 final NodeList docs = (NodeList) xpath.evaluate("/response/result/doc" , doc, XPathConstants.NODESET);
+ 121 9 for (int i = 0; i < docs.getLength(); i++) {
+ 122 5 final String g = xpath.evaluate("./str[@name='g']" , docs.item(i));
+ 123 5 LOGGER.finest(String.format("GroupId: %s" , g));
+ 124 5 final String a = xpath.evaluate("./str[@name='a']" , docs.item(i));
+ 125 5 LOGGER.finest(String.format("ArtifactId: %s" , a));
+ 126 5 final String v = xpath.evaluate("./str[@name='v']" , docs.item(i));
+ 127 5 LOGGER.finest(String.format("Version: %s" , v));
+ 128 5 result.add(new MavenArtifact(g, a, v, url.toString()));
+ 129
+ }
+ 130
+
+ 131 4 return result;
+ 132
+ }
+ 133 0 } catch (Throwable e) {
+ 134
+
+ 135
+
+ 136 0 throw new IOException(e.getMessage(), e);
+ 137 1 }
+ 138
+
+ 139 1 if (missing) {
+ 140 1 throw new FileNotFoundException("Artifact not found in Central" );
+ 141
+ }
+ 142 0 } else {
+ 143 0 final String msg = String.format("Could not connect to Central received response code: %d %s" ,
+ 144
+ conn.getResponseCode(), conn.getResponseMessage());
+ 145 0 LOGGER.fine(msg);
+ 146 0 throw new IOException(msg);
+ 147
+ }
+ 148
+
+ 149 0 return null ;
+ 150
+ }
+ 151
+ }
+
+
+
+
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
index a89946113..3c75cdb43 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.html
@@ -130,457 +130,459 @@
56
public final class CpeMemoryIndex {
57
-
+
58
-
+
59
+
+ 60
- 60 1 private static final Logger LOGGER = Logger.getLogger(CpeMemoryIndex.class .getName());
- 61
-
+ 61 1 private static final Logger LOGGER = Logger.getLogger(CpeMemoryIndex.class .getName());
62
-
+
63
+
+ 64
- 64 1 private static CpeMemoryIndex instance = new CpeMemoryIndex();
- 65
-
+ 65 1 private static CpeMemoryIndex instance = new CpeMemoryIndex();
66
-
+
67
-
+
68
-
+
69
- private CpeMemoryIndex() {
+
70
- }
+ private CpeMemoryIndex() {
71
-
+ }
72
-
+
73
-
+
74
-
+
75
-
+
76
-
+
77
+
+ 78
public static CpeMemoryIndex getInstance() {
- 78 2 return instance;
- 79
- }
+ 79 2 return instance;
80
-
+ }
81
-
+
82
-
+
83
- private RAMDirectory index;
+
84
-
+ private RAMDirectory index;
85
-
+
86
-
+
87
- private IndexReader indexReader;
+
88
-
+ private IndexReader indexReader;
89
-
+
90
-
+
91
- private IndexSearcher indexSearcher;
+
92
-
+ private IndexSearcher indexSearcher;
93
-
+
94
-
+
95
- private Analyzer searchingAnalyzer;
+
96
-
+ private Analyzer searchingAnalyzer;
97
-
+
98
-
+
99
- private QueryParser queryParser;
+
100
-
+ private QueryParser queryParser;
101
-
+
102
-
+
103
- private SearchFieldAnalyzer productSearchFieldAnalyzer;
+
104
-
+ private SearchFieldAnalyzer productSearchFieldAnalyzer;
105
-
+
106
-
+
107
- private SearchFieldAnalyzer vendorSearchFieldAnalyzer;
+
108
-
+ private SearchFieldAnalyzer vendorSearchFieldAnalyzer;
109
-
+
110
-
+
111
-
+
112
-
+
113
-
+
114
-
+
115
+
+ 116
public void open(CveDB cve) throws IndexException {
- 116 2 if (!openState) {
- 117 1 index = new RAMDirectory();
- 118 1 buildIndex(cve);
- 119
+ 117 2 if (!openState) {
+ 118 1 index = new RAMDirectory();
+ 119 1 buildIndex(cve);
+ 120
try {
- 120 1 indexReader = DirectoryReader.open(index);
- 121 0 } catch (IOException ex) {
- 122 0 throw new IndexException(ex);
- 123 1 }
- 124 1 indexSearcher = new IndexSearcher(indexReader);
- 125 1 searchingAnalyzer = createSearchingAnalyzer();
- 126 1 queryParser = new QueryParser(LuceneUtils.CURRENT_VERSION, Fields.DOCUMENT_KEY, searchingAnalyzer);
- 127 1 openState = true ;
- 128
+ 121 1 indexReader = DirectoryReader.open(index);
+ 122 0 } catch (IOException ex) {
+ 123 0 throw new IndexException(ex);
+ 124 1 }
+ 125 1 indexSearcher = new IndexSearcher(indexReader);
+ 126 1 searchingAnalyzer = createSearchingAnalyzer();
+ 127 1 queryParser = new QueryParser(LuceneUtils.CURRENT_VERSION, Fields.DOCUMENT_KEY, searchingAnalyzer);
+ 128 1 openState = true ;
+ 129
}
- 129 2 }
- 130
-
+ 130 2 }
131
-
+
132
-
+
133
- private boolean openState = false ;
+
134
-
+ private boolean openState = false ;
135
-
+
136
-
+
137
-
+
138
-
+
139
-
+
140
- public boolean isOpen() {
+
141
- return openState;
+ public boolean isOpen() {
142
- }
+ return openState;
143
-
+ }
144
-
+
145
-
+
146
-
+
147
-
+
148
-
- 149
- @SuppressWarnings("unchecked" )
- 150
- private Analyzer createIndexingAnalyzer() {
- 151 1 final Map fieldAnalyzers = new HashMap();
- 152 1 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
- 153 1 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
- 154
- }
- 155
-
- 156
-
- 157
-
- 158
-
- 159
- 160
+ 149
- 161
+ 150
@SuppressWarnings("unchecked" )
+ 151
+ private Analyzer createIndexingAnalyzer() {
+ 152 1 final Map fieldAnalyzers = new HashMap();
+ 153 1 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
+ 154 1 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
+ 155
+ }
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+
162
+ @SuppressWarnings("unchecked" )
+ 163
private Analyzer createSearchingAnalyzer() {
- 163 1 final Map fieldAnalyzers = new HashMap();
- 164 1 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
- 165 1 productSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
- 166 1 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
- 167 1 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
- 168 1 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
- 169
+ 164 1 final Map<String, Analyzer> fieldAnalyzers = new HashMap<String, Analyzer>();
+ 165 1 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
+ 166 1 productSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
+ 167 1 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer(LuceneUtils.CURRENT_VERSION);
+ 168 1 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
+ 169 1 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
+ 170
- 170 1 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
- 171
- }
+ 171 1 return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
172
-
+ }
173
-
+
174
-
+
175
-
+
176
-
+
177
-
+
178
-
+
179
-
+
180
-
+
181
-
+
182
+
+ 183
public void saveEntry(String vendor, String product, IndexWriter indexWriter) throws CorruptIndexException, IOException {
- 183 22135 final Document doc = new Document();
- 184 22135 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
- 185 22135 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
- 186 22135 doc.add(v);
- 187 22135 doc.add(p);
- 188 22135 indexWriter.addDocument(doc);
- 189 22135 }
- 190
-
+ 184 22135 final Document doc = new Document();
+ 185 22135 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
+ 186 22135 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
+ 187 22135 doc.add(v);
+ 188 22135 doc.add(p);
+ 189 22135 indexWriter.addDocument(doc);
+ 190 22135 }
191
-
+
192
-
+
193
-
+
194
+
+ 195
public void close() {
- 195 1 if (searchingAnalyzer != null ) {
- 196 1 searchingAnalyzer.close();
- 197 1 searchingAnalyzer = null ;
- 198
+ 196 1 if (searchingAnalyzer != null ) {
+ 197 1 searchingAnalyzer.close();
+ 198 1 searchingAnalyzer = null ;
+ 199
}
- 199 1 if (indexReader != null ) {
- 200
+ 200 1 if (indexReader != null ) {
+ 201
try {
- 201 1 indexReader.close();
- 202 0 } catch (IOException ex) {
- 203 0 LOGGER.log(Level.FINEST, null , ex);
- 204 1 }
- 205 1 indexReader = null ;
- 206
+ 202 1 indexReader.close();
+ 203 0 } catch (IOException ex) {
+ 204 0 LOGGER.log(Level.FINEST, null , ex);
+ 205 1 }
+ 206 1 indexReader = null ;
+ 207
}
- 207 1 queryParser = null ;
- 208 1 indexSearcher = null ;
- 209 1 if (index != null ) {
- 210 1 index.close();
- 211 1 index = null ;
- 212
+ 208 1 queryParser = null ;
+ 209 1 indexSearcher = null ;
+ 210 1 if (index != null ) {
+ 211 1 index.close();
+ 212 1 index = null ;
+ 213
}
- 213 1 openState = false ;
- 214 1 }
- 215
-
+ 214 1 openState = false ;
+ 215 1 }
216
-
+
217
-
+
218
-
+
219
-
+
220
-
+
221
-
+
222
+
+ 223
private void buildIndex(CveDB cve) throws IndexException {
- 223 1 Analyzer analyzer = null ;
- 224 1 IndexWriter indexWriter = null ;
- 225
+ 224 1 Analyzer analyzer = null ;
+ 225 1 IndexWriter indexWriter = null ;
+ 226
try {
- 226 1 analyzer = createIndexingAnalyzer();
- 227 1 final IndexWriterConfig conf = new IndexWriterConfig(LuceneUtils.CURRENT_VERSION, analyzer);
- 228 1 indexWriter = new IndexWriter(index, conf);
- 229
+ 227 1 analyzer = createIndexingAnalyzer();
+ 228 1 final IndexWriterConfig conf = new IndexWriterConfig(LuceneUtils.CURRENT_VERSION, analyzer);
+ 229 1 indexWriter = new IndexWriter(index, conf);
+ 230
try {
- 230 1 final Set<Pair<String, String>> data = cve.getVendorProductList();
- 231 1 for (Pair<String, String> pair : data) {
- 232 22135 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
- 233 22135 }
- 234 0 } catch (DatabaseException ex) {
- 235 0 LOGGER.log(Level.FINE, null , ex);
- 236 0 throw new IndexException("Error reading CPE data" , ex);
- 237 1 }
- 238 0 } catch (CorruptIndexException ex) {
- 239 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 240 0 } catch (IOException ex) {
- 241 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 242
+ 231 1 final Set<Pair<String, String>> data = cve.getVendorProductList();
+ 232 1 for (Pair<String, String> pair : data) {
+ 233 22135 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
+ 234 22135 }
+ 235 0 } catch (DatabaseException ex) {
+ 236 0 LOGGER.log(Level.FINE, null , ex);
+ 237 0 throw new IndexException("Error reading CPE data" , ex);
+ 238 1 }
+ 239 0 } catch (CorruptIndexException ex) {
+ 240 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 241 0 } catch (IOException ex) {
+ 242 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 243
} finally {
- 243 1 if (indexWriter != null ) {
- 244
- try {
+ 244 1 if (indexWriter != null ) {
245
+ try {
+ 246
try {
- 246 1 indexWriter.commit();
- 247
+ 247 1 indexWriter.commit();
+ 248
} finally {
- 248 1 indexWriter.close(true );
- 249 1 }
- 250 0 } catch (CorruptIndexException ex) {
- 251 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 252 0 } catch (IOException ex) {
- 253 0 throw new IndexException("Unable to close an in-memory index" , ex);
- 254 1 }
- 255 1 if (analyzer != null ) {
- 256 1 analyzer.close();
- 257
- }
+ 249 1 indexWriter.close(true );
+ 250 1 }
+ 251 0 } catch (CorruptIndexException ex) {
+ 252 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 253 0 } catch (IOException ex) {
+ 254 0 throw new IndexException("Unable to close an in-memory index" , ex);
+ 255 1 }
+ 256 1 if (analyzer != null ) {
+ 257 1 analyzer.close();
258
- }
+ }
259
+ }
+ 260
}
- 260 1 }
- 261
-
+ 261 1 }
262
-
+
263
-
+
264
-
+
265
+
+ 266
private void resetSearchingAnalyzer() {
- 266 0 if (productSearchFieldAnalyzer != null ) {
- 267 0 productSearchFieldAnalyzer.clear();
- 268
+ 267 0 if (productSearchFieldAnalyzer != null ) {
+ 268 0 productSearchFieldAnalyzer.clear();
+ 269
}
- 269 0 if (vendorSearchFieldAnalyzer != null ) {
- 270 0 vendorSearchFieldAnalyzer.clear();
- 271
+ 270 0 if (vendorSearchFieldAnalyzer != null ) {
+ 271 0 vendorSearchFieldAnalyzer.clear();
+ 272
}
- 272 0 }
- 273
-
+ 273 0 }
274
-
+
275
-
+
276
-
+
277
-
+
278
-
+
279
-
+
280
-
+
281
-
+
282
-
+
283
+
+ 284
public TopDocs search(String searchString, int maxQueryResults) throws ParseException, IOException {
- 284 6 if (searchString == null || searchString.trim().isEmpty()) {
- 285 0 throw new ParseException("Query is null or empty" );
- 286
+ 285 6 if (searchString == null || searchString.trim().isEmpty()) {
+ 286 0 throw new ParseException("Query is null or empty" );
+ 287
}
- 287 6 final Query query = queryParser.parse(searchString);
- 288 6 return indexSearcher.search(query, maxQueryResults);
- 289
- }
+ 288 6 final Query query = queryParser.parse(searchString);
+ 289 6 return indexSearcher.search(query, maxQueryResults);
290
-
+ }
291
-
+
292
-
+
293
-
+
294
-
+
295
-
+
296
-
+
297
-
+
298
-
+
299
-
- 300
- public TopDocs search(Query query, int maxQueryResults) throws CorruptIndexException, IOException {
- 301 0 resetSearchingAnalyzer();
- 302 0 return indexSearcher.search(query, maxQueryResults);
- 303
- }
- 304
-
- 305
-
- 306
-
- 307
-
- 308
-
- 309
-
- 310
- 311
+ 300
- 312
- public Document getDocument(int documentId) throws IOException {
- 313 23 return indexSearcher.doc(documentId);
- 314
+ 301
+ public TopDocs search(Query query, int maxQueryResults) throws CorruptIndexException, IOException {
+ 302 0 resetSearchingAnalyzer();
+ 303 0 return indexSearcher.search(query, maxQueryResults);
+ 304
}
- 315
+ 305
- 316
+ 306
- 317
-
- 318
+ 307
+
+ 308
- 319
-
- 320
+ 309
+
+ 310
+
+ 311
+
+ 312
- 321
- public int numDocs() {
- 322 1 if (indexReader == null ) {
- 323 0 return -1;
- 324
- }
- 325 1 return indexReader.numDocs();
- 326
+ 313
+ public Document getDocument(int documentId) throws IOException {
+ 314 23 return indexSearcher.doc(documentId);
+ 315
}
+ 316
+
+ 317
+
+ 318
+
+ 319
+
+ 320
+
+ 321
+
+ 322
+ public int numDocs() {
+ 323 1 if (indexReader == null ) {
+ 324 0 return -1;
+ 325
+ }
+ 326 1 return indexReader.numDocs();
327
+ }
+ 328
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
index 6a1987157..acc4bbf53 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.Fields.html
@@ -109,6 +109,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
index 8f4ff35fd..857bb3041 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexEntry.html
@@ -375,6 +375,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
index 1218b573e..51b15c348 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cpe.IndexException.html
@@ -151,6 +151,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
index ff179a078..220c74be4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweDB.html
@@ -12,7 +12,7 @@
@@ -80,103 +80,110 @@
31
public final class CweDB {
32
-
+
33
-
+
34
+
+ 35
- 35 1 private static final Logger LOGGER = Logger.getLogger(CweDB.class .getName());
- 36
-
+ 36 1 private static final Logger LOGGER = Logger.getLogger(CweDB.class .getName());
37
-
+
38
-
+
39
- private CweDB() {
+
40
-
+
41
- }
+ private CweDB() {
42
-
+
43
-
+ }
44
-
- 45 1 private static final HashMap<String, String> CWE = loadData();
+
+ 45
+
46
-
- 47
-
+
+ 47 1 private static final HashMap<String, String> CWE = loadData();
48
-
- 49
-
- 50
-
- 51
-
- 52
- private static HashMap<String, String> loadData() {
- 53 1 ObjectInputStream oin = null ;
- 54
- try {
- 55 1 final String filePath = "data/cwe.hashmap.serialized" ;
- 56 1 final InputStream input = CweDB.class .getClassLoader().getResourceAsStream(filePath);
- 57 1 oin = new ObjectInputStream(input);
- 58 1 return (HashMap<String, String>) oin.readObject();
- 59 0 } catch (ClassNotFoundException ex) {
- 60 0 LOGGER.log(Level.WARNING, "Unable to load CWE data. This should not be an issue." );
- 61 0 LOGGER.log(Level.FINE, null , ex);
- 62 0 } catch (IOException ex) {
- 63 0 LOGGER.log(Level.WARNING, "Unable to load CWE data due to an IO Error. This should not be an issue." );
- 64 0 LOGGER.log(Level.FINE, null , ex);
- 65
- } finally {
- 66 1 if (oin != null ) {
- 67
- try {
- 68 1 oin.close();
- 69 0 } catch (IOException ex) {
- 70 0 LOGGER.log(Level.FINEST, null , ex);
- 71 2 }
- 72
- }
- 73
- }
- 74 0 return null ;
- 75
- }
- 76
- 77
+ 49
- 78
-
- 79
-
- 80
+ 50
+
+ 51
- 81
-
- 82
-
- 83
+ 52
+
+ 53
- 84
- public static String getCweName(String cweId) {
- 85 9 if (cweId != null ) {
- 86 9 return CWE.get(cweId);
- 87
+ 54
+ private static HashMap<String, String> loadData() {
+ 55 1 ObjectInputStream oin = null ;
+ 56
+ try {
+ 57 1 final String filePath = "data/cwe.hashmap.serialized" ;
+ 58 1 final InputStream input = CweDB.class .getClassLoader().getResourceAsStream(filePath);
+ 59 1 oin = new ObjectInputStream(input);
+ 60
+ @SuppressWarnings("unchecked" )
+ 61 1 final HashMap<String, String> ret = (HashMap<String, String>) oin.readObject();
+ 62 1 return ret;
+ 63 0 } catch (ClassNotFoundException ex) {
+ 64 0 LOGGER.log(Level.WARNING, "Unable to load CWE data. This should not be an issue." );
+ 65 0 LOGGER.log(Level.FINE, null , ex);
+ 66 0 } catch (IOException ex) {
+ 67 0 LOGGER.log(Level.WARNING, "Unable to load CWE data due to an IO Error. This should not be an issue." );
+ 68 0 LOGGER.log(Level.FINE, null , ex);
+ 69
+ } finally {
+ 70 1 if (oin != null ) {
+ 71
+ try {
+ 72 1 oin.close();
+ 73 0 } catch (IOException ex) {
+ 74 0 LOGGER.log(Level.FINEST, null , ex);
+ 75 2 }
+ 76
+ }
+ 77
}
- 88 0 return null ;
- 89
+ 78 0 return null ;
+ 79
}
- 90
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+ public static String getCweName(String cweId) {
+ 89 9 if (cweId != null ) {
+ 90 9 return CWE.get(cweId);
+ 91
+ }
+ 92 0 return null ;
+ 93
+ }
+ 94
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
index 30e34d11f..7ca686362 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.cwe.CweHandler.html
@@ -122,6 +122,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
index 4e4b2ffb4..9033550b3 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AbstractTokenizingFilter.html
@@ -85,7 +85,7 @@
34
- 35 11 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
+ 35 9 private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class );
36
37
@@ -144,9 +144,9 @@
64
public AbstractTokenizingFilter(TokenStream stream) {
- 65 11 super (stream);
- 66 11 tokens = new LinkedList<String>();
- 67 11 }
+ 65 9 super (stream);
+ 66 9 tokens = new LinkedList<String>();
+ 67 9 }
68
69
@@ -161,20 +161,20 @@
74
protected boolean addTerm() {
- 75 32107 final boolean termAdded = tokens.size() > 0;
- 76 32105 if (termAdded) {
- 77 21685 final String term = tokens.pop();
- 78 21679 clearAttributes();
- 79 21672 termAtt.append(term);
+ 75 19659 final boolean termAdded = tokens.size() > 0;
+ 76 19650 if (termAdded) {
+ 77 13179 final String term = tokens.pop();
+ 78 13180 clearAttributes();
+ 79 13183 termAtt.append(term);
80
}
- 81 32084 return termAdded;
+ 81 19643 return termAdded;
82
}
83
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
index 30996a298..b3f50f017 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.AlphaNumericTokenizer.html
@@ -135,13 +135,13 @@
@Override
59
protected boolean isTokenChar(int c) {
- 60 517068 return Character.isLetter(c) || Character.isDigit(c);
+ 60 517162 return Character.isLetter(c) || Character.isDigit(c);
61
}
62
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
index 02a515890..c514251a0 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.DependencySimilarity.html
@@ -112,6 +112,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
index ca897ee9c..41df03e17 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.FieldAnalyzer.html
@@ -173,6 +173,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
index 45eb5729c..f0d062e30 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.LuceneUtils.html
@@ -124,15 +124,15 @@
final CharSequence text) {
54
- 55 99 if (text == null || buf == null ) {
+ 55 105 if (text == null || buf == null ) {
56 1 return ;
57
}
58
- 59 961 for (int i = 0; i < text.length(); i++) {
- 60 863 final char c = text.charAt(i);
- 61 863 switch (c) {
+ 59 1061 for (int i = 0; i < text.length(); i++) {
+ 60 957 final char c = text.charAt(i);
+ 61 957 switch (c) {
62
case '+' :
63
@@ -169,17 +169,17 @@
case ':' :
79
case '\\' :
- 80 58 buf.append('\\' );
+ 80 60 buf.append('\\' );
81
default :
- 82 863 buf.append(c);
+ 82 957 buf.append(c);
83
break ;
84
}
85
}
- 86 98 }
+ 86 104 }
87
88
@@ -198,27 +198,27 @@
public static String escapeLuceneQuery(final CharSequence text) {
95
- 96 98 if (text == null ) {
+ 96 104 if (text == null ) {
97 1 return null ;
98
}
99
- 100 97 int size = text.length();
- 101 97 size = size >> 1;
- 102 97 final StringBuilder buf = new StringBuilder(size);
+ 100 103 int size = text.length();
+ 101 103 size = size >> 1;
+ 102 103 final StringBuilder buf = new StringBuilder(size);
103
- 104 97 appendEscapedLuceneQuery(buf, text);
+ 104 103 appendEscapedLuceneQuery(buf, text);
105
- 106 97 return buf.toString();
+ 106 103 return buf.toString();
107
}
108
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
index bf38ad60c..d084663d9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchFieldAnalyzer.html
@@ -203,6 +203,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html
index 69f5a96f0..9c7bc0c15 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer.html
@@ -158,6 +158,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
index d35b00238..8891a440e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.TokenPairConcatenatingFilter.html
@@ -187,35 +187,35 @@
87
- 88 638 while (input.incrementToken()) {
- 89 181 final String word = new String(termAtt.buffer(), 0, termAtt.length());
- 90 181 words.add(word);
- 91 181 }
+ 88 686 while (input.incrementToken()) {
+ 89 195 final String word = new String(termAtt.buffer(), 0, termAtt.length());
+ 90 195 words.add(word);
+ 91 195 }
92
93
94
- 95 457 if (previousWord != null && words.size() > 0) {
- 96 173 final String word = words.getFirst();
- 97 173 clearAttributes();
- 98 173 termAtt.append(previousWord).append(word);
- 99 173 previousWord = null ;
- 100 173 return true ;
+ 95 491 if (previousWord != null && words.size() > 0) {
+ 96 187 final String word = words.getFirst();
+ 97 187 clearAttributes();
+ 98 187 termAtt.append(previousWord).append(word);
+ 99 187 previousWord = null ;
+ 100 187 return true ;
101
}
102
- 103 284 if (words.size() > 0) {
- 104 181 final String word = words.removeFirst();
- 105 181 clearAttributes();
- 106 181 termAtt.append(word);
- 107 181 previousWord = word;
- 108 181 return true ;
+ 103 304 if (words.size() > 0) {
+ 104 195 final String word = words.removeFirst();
+ 105 195 clearAttributes();
+ 106 195 termAtt.append(word);
+ 107 195 previousWord = word;
+ 108 195 return true ;
109
}
- 110 103 return false ;
+ 110 109 return false ;
111
}
112
@@ -243,6 +243,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
index b86c3f9b2..0838bfe7e 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.UrlTokenizingFilter.html
@@ -136,11 +136,11 @@
@Override
60
public boolean incrementToken() throws IOException {
- 61 32140 final LinkedList<String> tokens = getTokens();
- 62 32189 final CharTermAttribute termAtt = getTermAtt();
- 63 32220 if (tokens.size() == 0 && input.incrementToken()) {
- 64 21664 final String text = new String(termAtt.buffer(), 0, termAtt.length());
- 65 21704 if (UrlStringUtils.containsUrl(text)) {
+ 61 19713 final LinkedList<String> tokens = getTokens();
+ 62 19714 final CharTermAttribute termAtt = getTermAtt();
+ 63 19724 if (tokens.size() == 0 && input.incrementToken()) {
+ 64 13187 final String text = new String(termAtt.buffer(), 0, termAtt.length());
+ 65 13188 if (UrlStringUtils.containsUrl(text)) {
66 2 final String[] parts = text.split("\\s" );
67 4 for (String part : parts) {
68 2 if (UrlStringUtils.isUrl(part)) {
@@ -160,18 +160,18 @@
79
}
80 2 } else {
- 81 21700 tokens.add(text);
+ 81 13185 tokens.add(text);
82
}
83
}
- 84 21715 return addTerm();
+ 84 19650 return addTerm();
85
}
86
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html
index 2adf99e07..63ccf59ac 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionAnalyzer.html
@@ -157,6 +157,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html
index e4d36657b..66a57990f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter.html
@@ -195,6 +195,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
index cc902c218..921b9af01 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.MavenArtifact.html
@@ -12,7 +12,7 @@
@@ -158,12 +158,12 @@
73
- 74 1 public MavenArtifact(String groupId, String artifactId, String version, String url) {
- 75 1 setGroupId(groupId);
- 76 1 setArtifactId(artifactId);
- 77 1 setVersion(version);
- 78 1 setArtifactUrl(url);
- 79 1 }
+ 74 8 public MavenArtifact(String groupId, String artifactId, String version, String url) {
+ 75 8 setGroupId(groupId);
+ 76 8 setArtifactId(artifactId);
+ 77 8 setVersion(version);
+ 78 8 setArtifactUrl(url);
+ 79 8 }
80
81
@@ -180,7 +180,7 @@
@Override
87
public String toString() {
- 88 0 return String.format("%s:%s:%s" , groupId, artifactId, version);
+ 88 8 return String.format("%s:%s:%s" , groupId, artifactId, version);
89
}
90
@@ -335,6 +335,6 @@
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
index 616f04732..e0e9601bf 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nexus.NexusSearch.html
@@ -324,6 +324,6 @@
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
index d76c61072..dd37fef64 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NugetPackage.html
@@ -377,6 +377,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
index 03417d83c..0e0e761c4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParseException.html
@@ -153,6 +153,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
index 310023f47..361d24fda 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.NuspecParser.html
@@ -93,6 +93,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
index cb3365aa5..783f656cb 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nuget.XPathNuspecParser.html
@@ -164,6 +164,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
index c9aa561bb..add924a08 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.html
@@ -501,6 +501,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
index d76d04ac4..602e6b2d5 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.CorruptDatabaseException.html
@@ -121,6 +121,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
index 652cd12e7..76ff416fc 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseException.html
@@ -137,6 +137,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
index c1eb5db48..193e89e3d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DatabaseProperties.html
@@ -291,8 +291,8 @@
144
145
- public Map getMetaData() {
- 146 0 final TreeMap map = new TreeMap();
+ public Map<String, String> getMetaData() {
+ 146 0 final TreeMap<String, String> map = new TreeMap<String, String>();
147 0 for (Entry<Object, Object> entry : properties.entrySet()) {
148 0 final String key = (String) entry.getKey();
149 0 if (!"version" .equals(key)) {
@@ -306,11 +306,11 @@
156 0 map.put(key, formatted);
157 0 } catch (Throwable ex) {
158 0 LOGGER.log(Level.FINE, "Unable to parse timestamp from DB" , ex);
- 159 0 map.put(key, entry.getValue());
+ 159 0 map.put(key, (String) entry.getValue());
160 0 }
161
} else {
- 162 0 map.put(key, entry.getValue());
+ 162 0 map.put(key, (String) entry.getValue());
163
}
164
@@ -323,6 +323,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
index c0095c439..b730d4d39 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoadException.html
@@ -137,6 +137,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
index 54e1ce5ad..9f9f49d0b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverLoader.html
@@ -274,6 +274,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
index 0b0e80660..17bbf32a5 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.nvdcve.DriverShim.html
@@ -395,6 +395,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
index a953b95c5..77230b71f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.CachedWebDataSource.html
@@ -93,6 +93,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html
index 4e450b4ce..dc5ac400b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveInfo.html
@@ -293,6 +293,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
index d34bf8901..6656dcb50 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.NvdCveUpdater.html
@@ -137,6 +137,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html
index d584cfc8d..76f06bfb1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.StandardUpdate.html
@@ -546,6 +546,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
index ad76b6693..c7b7b33b8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateService.html
@@ -121,6 +121,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html
index b4dc61f55..4260cf647 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.UpdateableNvdCve.html
@@ -362,6 +362,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
index 142eea17c..adc7e6f66 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.InvalidDataException.html
@@ -119,6 +119,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
index 272f630a4..7636f74f0 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.exception.UpdateException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html
index 0f808749a..8000cdd38 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.task.ProcessTask.html
@@ -343,6 +343,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html
index 167cf3e83..9005ee1b2 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.html
@@ -453,6 +453,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html
index 71221c237..3679e5224 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.html
@@ -876,6 +876,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
index a53170930..1b5acc409 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Confidence.html
@@ -100,6 +100,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
index f4ed9439c..c7e3c5f97 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Dependency.html
@@ -12,7 +12,7 @@
@@ -74,1193 +74,1255 @@
28
import java.util.logging.Logger;
29
- import org.owasp.dependencycheck.utils.Checksum;
+ import org.owasp.dependencycheck.data.nexus.MavenArtifact;
30
- import org.owasp.dependencycheck.utils.FileUtils;
+ import org.owasp.dependencycheck.utils.Checksum;
31
-
+ import org.owasp.dependencycheck.utils.FileUtils;
32
-
+
33
-
+
34
-
+
35
-
+
36
-
+
37
-
+
38
+
+ 39
- 39 2 public class Dependency implements Serializable, Comparable<Dependency> {
- 40
-
+ 40 2 public class Dependency implements Serializable, Comparable<Dependency> {
41
-
+
42
-
+
43
+
+ 44
- 44 1 private static final Logger LOGGER = Logger.getLogger(Dependency.class .getName());
- 45
-
+ 45 1 private static final Logger LOGGER = Logger.getLogger(Dependency.class .getName());
46
-
+
47
-
+
48
- private String actualFilePath;
+
49
-
+ private String actualFilePath;
50
-
+
51
-
+
52
- private String filePath;
+
53
-
+ private String filePath;
54
-
+
55
-
+
56
- private String fileName;
+
57
-
+ private String fileName;
58
-
+
59
-
+
60
- private String fileExtension;
+
61
-
+ private String fileExtension;
62
-
+
63
-
+
64
- private String md5sum;
+
65
-
+ private String md5sum;
66
-
+
67
-
+
68
- private String sha1sum;
+
69
-
+ private String sha1sum;
70
-
+
71
-
+
72
- private Set<Identifier> identifiers;
+
73
-
+ private Set<Identifier> identifiers;
74
-
+
75
-
+
76
- private final EvidenceCollection vendorEvidence;
+
77
-
+ private final EvidenceCollection vendorEvidence;
78
-
+
79
-
+
80
- private final EvidenceCollection productEvidence;
+
81
-
+ private final EvidenceCollection productEvidence;
82
-
+
83
-
+
84
- private final EvidenceCollection versionEvidence;
+
85
-
+ private final EvidenceCollection versionEvidence;
86
-
+
87
-
+
88
-
- 89 38 public Dependency() {
- 90 38 vendorEvidence = new EvidenceCollection();
- 91 38 productEvidence = new EvidenceCollection();
- 92 38 versionEvidence = new EvidenceCollection();
- 93 38 identifiers = new TreeSet<Identifier>();
- 94 38 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
- 95 38 suppressedIdentifiers = new TreeSet<Identifier>();
- 96 38 suppressedVulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
- 97 38 }
- 98
-
- 99
-
- 100
+ 89
+
+ 90 40 public Dependency() {
+ 91 40 vendorEvidence = new EvidenceCollection();
+ 92 40 productEvidence = new EvidenceCollection();
+ 93 40 versionEvidence = new EvidenceCollection();
+ 94 40 identifiers = new TreeSet<Identifier>();
+ 95 40 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
+ 96 40 suppressedIdentifiers = new TreeSet<Identifier>();
+ 97 40 suppressedVulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator());
+ 98 40 }
+ 99
+
+ 100
+
101
-
+
102
-
+
103
-
+
104
+
+ 105
public Dependency(File file) {
- 105 17 this ();
- 106 17 this .actualFilePath = file.getPath();
- 107 17 this .filePath = this .actualFilePath;
- 108 17 this .fileName = file.getName();
- 109 17 this .fileExtension = FileUtils.getFileExtension(fileName);
- 110 17 determineHashes(file);
- 111 17 }
- 112
-
+ 106 17 this ();
+ 107 17 this .actualFilePath = file.getPath();
+ 108 17 this .filePath = this .actualFilePath;
+ 109 17 this .fileName = file.getName();
+ 110 17 this .fileExtension = FileUtils.getFileExtension(fileName);
+ 111 17 determineHashes(file);
+ 112 17 }
113
-
+
114
-
+
115
-
+
116
-
+
117
-
+
118
- public String getFileName() {
+
119
- return this .fileName;
+ public String getFileName() {
120
- }
+ return this .fileName;
121
-
+ }
122
-
+
123
-
+
124
-
+
125
-
+
126
-
+
127
-
+
128
+
+ 129
public String getFileNameForJavaScript() {
- 129 0 return this .fileName.replace("\\" , "\\\\" );
- 130
- }
+ 130 0 return this .fileName.replace("\\" , "\\\\" );
131
-
+ }
132
-
+
133
-
+
134
-
- 135
-
- 136
-
- 137
- public void setFileName(String fileName) {
- 138
- this .fileName = fileName;
- 139
- }
- 140
-
- 141
-
- 142
-
- 143
-
- 144
-
- 145
-
- 146
- public void setActualFilePath(String actualFilePath) {
- 147 2 this .actualFilePath = actualFilePath;
- 148 2 if (this .sha1sum == null ) {
- 149 2 final File file = new File(this .actualFilePath);
- 150 2 determineHashes(file);
- 151
- }
- 152 2 }
- 153
-
- 154
-
- 155
-
- 156
-
- 157
-
- 158
-
- 159
- public String getActualFilePath() {
- 160
- return this .actualFilePath;
- 161
- }
- 162
-
- 163
-
- 164
-
- 165
-
- 166
-
- 167
-
- 168
- public File getActualFile() {
- 169 3 return new File(this .actualFilePath);
- 170
- }
- 171
-
- 172
-
- 173
-
- 174
-
- 175
-
- 176
-
- 177
- public void setFilePath(String filePath) {
- 178
- this .filePath = filePath;
- 179
- }
- 180
-
- 181
-
- 182
-
- 183
-
- 184 38 private String displayName = null ;
- 185
-
- 186
-
- 187
-
- 188
-
- 189
-
- 190
-
- 191
- public void setDisplayFileName(String displayName) {
- 192
- this .displayName = displayName;
- 193
- }
- 194
-
- 195
-
- 196
-
- 197
-
- 198
-
- 199
-
- 200
-
- 201
- public String getDisplayFileName() {
- 202 0 if (displayName == null ) {
- 203 0 return this .fileName;
- 204
- }
- 205 0 return this .displayName;
- 206
- }
- 207
-
- 208
-
- 209
-
- 210
-
- 211
-
- 212
-
- 213
-
- 214
-
- 215
-
- 216
-
- 217
- public String getFilePath() {
- 218
- return this .filePath;
- 219
- }
- 220
-
- 221
-
- 222
+ 135
+
+ 136
+
+ 137
+
+ 138
+ public void setFileName(String fileName) {
+ 139
+ this .fileName = fileName;
+ 140
+ }
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+ public void setActualFilePath(String actualFilePath) {
+ 148 2 this .actualFilePath = actualFilePath;
+ 149 2 if (this .sha1sum == null ) {
+ 150 2 final File file = new File(this .actualFilePath);
+ 151 2 determineHashes(file);
+ 152
+ }
+ 153 2 }
+ 154
+
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+ public String getActualFilePath() {
+ 161
+ return this .actualFilePath;
+ 162
+ }
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+ public File getActualFile() {
+ 170 7 return new File(this .actualFilePath);
+ 171
+ }
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+ public void setFilePath(String filePath) {
+ 179
+ this .filePath = filePath;
+ 180
+ }
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185 40 private String displayName = null ;
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+ public void setDisplayFileName(String displayName) {
+ 193
+ this .displayName = displayName;
+ 194
+ }
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+ public String getDisplayFileName() {
+ 203 0 if (displayName == null ) {
+ 204 0 return this .fileName;
+ 205
+ }
+ 206 0 return this .displayName;
+ 207
+ }
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+ public String getFilePath() {
+ 219
+ return this .filePath;
+ 220
+ }
+ 221
+
+ 222
+
223
-
+
224
-
+
225
-
+
226
- public void setFileExtension(String fileExtension) {
+
227
- this .fileExtension = fileExtension;
+ public void setFileExtension(String fileExtension) {
228
- }
+ this .fileExtension = fileExtension;
229
-
+ }
230
-
+
231
-
+
232
-
+
233
-
+
234
-
+
235
- public String getFileExtension() {
+
236
- return this .fileExtension;
+ public String getFileExtension() {
237
- }
+ return this .fileExtension;
238
-
+ }
239
-
+
240
-
+
241
-
+
242
-
+
243
-
+
244
- public String getMd5sum() {
+
245
- return this .md5sum;
+ public String getMd5sum() {
246
- }
+ return this .md5sum;
247
-
+ }
248
-
+
249
-
+
250
-
+
251
-
+
252
-
+
253
- public void setMd5sum(String md5sum) {
+
254
- this .md5sum = md5sum;
+ public void setMd5sum(String md5sum) {
255
- }
+ this .md5sum = md5sum;
256
-
+ }
257
-
+
258
-
+
259
-
+
260
-
+
261
-
+
262
- public String getSha1sum() {
+
263
- return this .sha1sum;
+ public String getSha1sum() {
264
- }
+ return this .sha1sum;
265
-
+ }
266
-
+
267
-
+
268
-
+
269
-
+
270
-
+
271
- public void setSha1sum(String sha1sum) {
+
272
- this .sha1sum = sha1sum;
+ public void setSha1sum(String sha1sum) {
273
- }
+ this .sha1sum = sha1sum;
274
-
+ }
275
-
+
276
-
+
277
-
+
278
-
+
279
-
+
280
- public Set<Identifier> getIdentifiers() {
+
281
- return this .identifiers;
+ public Set<Identifier> getIdentifiers() {
282
- }
+ return this .identifiers;
283
-
+ }
284
-
+
285
-
+
286
-
+
287
-
+
288
-
+
289
- public void setIdentifiers(Set<Identifier> identifiers) {
+
290
- this .identifiers = identifiers;
+ public void setIdentifiers(Set<Identifier> identifiers) {
291
- }
+ this .identifiers = identifiers;
292
-
+ }
293
-
+
294
-
+
295
-
+
296
-
+
297
-
- 298
-
- 299
-
- 300
- public void addIdentifier(String type, String value, String url) {
- 301 11 final Identifier i = new Identifier(type, value, url);
- 302 11 this .identifiers.add(i);
- 303 11 }
- 304
-
- 305
-
- 306
-
- 307
-
- 308
- 309
+ 298
- 310
+ 299
- 311
-
- 312
+ 300
- 313
- public void addIdentifier(String type, String value, String url, Confidence confidence) {
- 314 1 final Identifier i = new Identifier(type, value, url);
- 315 1 i.setConfidence(confidence);
- 316 1 this .identifiers.add(i);
- 317 1 }
- 318
+ 301
+ public void addIdentifier(String type, String value, String url) {
+ 302 11 final Identifier i = new Identifier(type, value, url);
+ 303 11 this .identifiers.add(i);
+ 304 11 }
+ 305
- 319
+ 306
- 320
+ 307
+ 308
+
+ 309
+
+ 310
+
+ 311
+
+ 312
+
+ 313
+
+ 314
+ public void addIdentifier(String type, String value, String url, Confidence confidence) {
+ 315 4 final Identifier i = new Identifier(type, value, url);
+ 316 4 i.setConfidence(confidence);
+ 317 4 this .identifiers.add(i);
+ 318 4 }
+ 319
+
+ 320
+
321
-
+
322
-
+
323
-
+
324
- public void addIdentifier(Identifier identifier) {
- 325 2 this .identifiers.add(identifier);
- 326 2 }
+
+ 325
+
+ 326
+
327
-
- 328
-
- 329
-
+ public void addAsEvidence(String source, MavenArtifact mavenArtifact, Confidence confidence) {
+ 328 4 if (mavenArtifact.getGroupId() != null && !mavenArtifact.getGroupId().isEmpty()) {
+ 329 3 this .getVendorEvidence().addEvidence(source, "groupid" , mavenArtifact.getGroupId(), confidence);
330
- private Set<Identifier> suppressedIdentifiers;
- 331
-
- 332
-
+ }
+ 331 4 if (mavenArtifact.getArtifactId() != null && !mavenArtifact.getArtifactId().isEmpty()) {
+ 332 3 this .getProductEvidence().addEvidence(source, "artifactid" , mavenArtifact.getArtifactId(), confidence);
333
-
- 334
-
- 335
-
+ }
+ 334 4 if (mavenArtifact.getVersion() != null && !mavenArtifact.getVersion().isEmpty()) {
+ 335 3 this .getVersionEvidence().addEvidence(source, "version" , mavenArtifact.getVersion(), confidence);
336
-
- 337
- public Set<Identifier> getSuppressedIdentifiers() {
- 338
- return suppressedIdentifiers;
- 339
- }
- 340
-
- 341
-
- 342
-
- 343
-
- 344
-
- 345
-
+ }
+ 337 4 if (mavenArtifact.getArtifactUrl() != null && !mavenArtifact.getArtifactUrl().isEmpty()) {
+ 338 3 boolean found = false ;
+ 339 3 for (Identifier i : this .getIdentifiers()) {
+ 340 0 if ("maven" .equals(i.getType()) && i.getValue().equals(mavenArtifact.toString())) {
+ 341 0 found = true ;
+ 342 0 i.setConfidence(Confidence.HIGHEST);
+ 343 0 i.setUrl(mavenArtifact.getArtifactUrl());
+ 344 0 LOGGER.fine(String.format("Already found identifier %s. Confidence set to highest" , i.getValue()));
+ 345 0 break ;
346
- public void setSuppressedIdentifiers(Set<Identifier> suppressedIdentifiers) {
- 347
- this .suppressedIdentifiers = suppressedIdentifiers;
- 348
- }
- 349
-
- 350
-
+ }
+ 347 0 }
+ 348 3 if (!found) {
+ 349 3 LOGGER.fine(String.format("Adding new maven identifier %s" , mavenArtifact.toString()));
+ 350 3 this .addIdentifier("maven" , mavenArtifact.toString(), mavenArtifact.getArtifactUrl(), Confidence.HIGHEST);
351
-
+ }
352
-
- 353
-
+ }
+ 353 4 }
354
-
- 355
- public void addSuppressedIdentifier(Identifier identifier) {
- 356 4 this .suppressedIdentifiers.add(identifier);
- 357 4 }
- 358
- 359
+ 355
- 360
-
- 361
+ 356
+
+ 357
+
+ 358
+
+ 359
- 362
- private SortedSet<Vulnerability> suppressedVulnerabilities;
+ 360
+ public void addIdentifier(Identifier identifier) {
+ 361 4 this .identifiers.add(identifier);
+ 362 4 }
363
364
365
-
+
366
-
+
367
-
+ private Set<Identifier> suppressedIdentifiers;
368
-
+
369
- public SortedSet<Vulnerability> getSuppressedVulnerabilities() {
+
370
- return suppressedVulnerabilities;
+
371
- }
+
372
-
+
373
-
+
374
-
+ public Set<Identifier> getSuppressedIdentifiers() {
375
-
+ return suppressedIdentifiers;
376
-
+ }
377
-
+
378
- public void setSuppressedVulnerabilities(SortedSet<Vulnerability> suppressedVulnerabilities) {
+
379
- this .suppressedVulnerabilities = suppressedVulnerabilities;
+
380
- }
+
381
-
+
382
-
+
383
-
+ public void setSuppressedIdentifiers(Set<Identifier> suppressedIdentifiers) {
384
-
+ this .suppressedIdentifiers = suppressedIdentifiers;
385
-
+ }
386
-
+
387
- public void addSuppressedVulnerability(Vulnerability vulnerability) {
- 388 3 this .suppressedVulnerabilities.add(vulnerability);
- 389 3 }
+
+ 388
+
+ 389
+
390
-
+
391
-
+
392
-
- 393
-
- 394
-
+ public void addSuppressedIdentifier(Identifier identifier) {
+ 393 4 this .suppressedIdentifiers.add(identifier);
+ 394 4 }
395
-
+
396
- public EvidenceCollection getEvidence() {
- 397 3 return EvidenceCollection.merge(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+
+ 397
+
398
- }
+
399
-
+ private SortedSet<Vulnerability> suppressedVulnerabilities;
400
-
+
401
-
+
402
-
+
403
-
+
404
-
+
405
- public Set<Evidence> getEvidenceForDisplay() {
- 406 0 return EvidenceCollection.mergeForDisplay(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+
+ 406
+ public SortedSet<Vulnerability> getSuppressedVulnerabilities() {
407
- }
+ return suppressedVulnerabilities;
408
-
+ }
409
-
+
410
-
+
411
-
+
412
-
+
413
-
+
414
- public EvidenceCollection getEvidenceUsed() {
- 415 1 return EvidenceCollection.mergeUsed(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+
+ 415
+ public void setSuppressedVulnerabilities(SortedSet<Vulnerability> suppressedVulnerabilities) {
416
- }
+ this .suppressedVulnerabilities = suppressedVulnerabilities;
417
-
+ }
418
-
+
419
-
+
420
-
+
421
-
+
422
-
+
423
- public EvidenceCollection getVendorEvidence() {
+
424
- return this .vendorEvidence;
- 425
- }
- 426
-
+ public void addSuppressedVulnerability(Vulnerability vulnerability) {
+ 425 3 this .suppressedVulnerabilities.add(vulnerability);
+ 426 3 }
427
-
+
428
-
+
429
-
+
430
-
+
431
-
- 432
- public EvidenceCollection getProductEvidence() {
- 433
- return this .productEvidence;
- 434
- }
- 435
-
- 436
-
- 437
-
- 438
-
- 439
+ 432
+
+ 433
+ public EvidenceCollection getEvidence() {
+ 434 11 return EvidenceCollection.merge(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+ 435
+ }
+ 436
+
+ 437
+
+ 438
+
+ 439
+
440
-
+
441
- public EvidenceCollection getVersionEvidence() {
+
442
- return this .versionEvidence;
- 443
- }
+ public Set<Evidence> getEvidenceForDisplay() {
+ 443 0 return EvidenceCollection.mergeForDisplay(this .productEvidence, this .vendorEvidence, this .versionEvidence);
444
-
+ }
445
-
+
446
-
+
447
- private String description;
+
448
-
+
449
-
+
450
-
+
451
-
- 452
-
+ public EvidenceCollection getEvidenceUsed() {
+ 452 1 return EvidenceCollection.mergeUsed(this .productEvidence, this .vendorEvidence, this .versionEvidence);
453
-
+ }
454
- public String getDescription() {
- 455
- return description;
- 456
- }
- 457
- 458
+ 455
- 459
-
- 460
+ 456
+
+ 457
- 461
-
- 462
+ 458
+
+ 459
- 463
- public void setDescription(String description) {
- 464
- this .description = description;
- 465
+ 460
+ public EvidenceCollection getVendorEvidence() {
+ 461
+ return this .vendorEvidence;
+ 462
}
- 466
+ 463
+
+ 464
+ 465
+
+ 466
+
467
-
+
468
469
- private String license;
+ public EvidenceCollection getProductEvidence() {
470
-
+ return this .productEvidence;
471
-
- 472
-
- 473
-
- 474
-
- 475
-
- 476
- public String getLicense() {
- 477
- return license;
- 478
}
- 479
+ 472
- 480
+ 473
- 481
-
- 482
+ 474
+
+ 475
+ 476
+
+ 477
+
+ 478
+ public EvidenceCollection getVersionEvidence() {
+ 479
+ return this .versionEvidence;
+ 480
+ }
+ 481
+
+ 482
+
483
-
+
484
485
- public void setLicense(String license) {
+ private String description;
486
- this .license = license;
+
487
- }
+
488
-
+
489
-
+
490
-
+
491
- private SortedSet<Vulnerability> vulnerabilities;
+
492
-
+ public String getDescription() {
493
-
+ return description;
494
-
+ }
495
-
+
496
-
+
497
-
+
498
- public SortedSet<Vulnerability> getVulnerabilities() {
+
499
- return vulnerabilities;
+
500
- }
+
501
-
+ public void setDescription(String description) {
502
-
+ this .description = description;
503
-
+ }
504
-
+
505
-
+
506
-
+
507
- public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities) {
+
508
- this .vulnerabilities = vulnerabilities;
+ private String license;
509
- }
+
510
-
+
511
-
+
512
-
+
513
-
+
514
-
+
515
-
+ public String getLicense() {
516
- private void determineHashes(File file) {
- 517 19 String md5 = null ;
- 518 19 String sha1 = null ;
+ return license;
+ 517
+ }
+ 518
+
519
- try {
- 520 19 md5 = Checksum.getMD5Checksum(file);
- 521 16 sha1 = Checksum.getSHA1Checksum(file);
- 522 3 } catch (IOException ex) {
- 523 3 final String msg = String.format("Unable to read '%s' to determine hashes." , file.getName());
- 524 3 LOGGER.log(Level.WARNING, msg);
- 525 3 LOGGER.log(Level.FINE, null , ex);
- 526 0 } catch (NoSuchAlgorithmException ex) {
- 527 0 final String msg = "Unable to use MD5 of SHA1 checksums." ;
- 528 0 LOGGER.log(Level.WARNING, msg);
- 529 0 LOGGER.log(Level.FINE, null , ex);
- 530 19 }
- 531 19 this .setMd5sum(md5);
- 532 19 this .setSha1sum(sha1);
- 533 19 }
+
+ 520
+
+ 521
+
+ 522
+
+ 523
+
+ 524
+ public void setLicense(String license) {
+ 525
+ this .license = license;
+ 526
+ }
+ 527
+
+ 528
+
+ 529
+
+ 530
+
+ 531
+ private SortedSet<Vulnerability> vulnerabilities;
+ 532
+
+ 533
+
534
-
+
535
-
+
536
-
+
537
-
+
538
-
+ public SortedSet<Vulnerability> getVulnerabilities() {
539
-
+ return vulnerabilities;
540
- public void addVulnerability(Vulnerability vulnerability) {
- 541 3 this .vulnerabilities.add(vulnerability);
- 542 3 }
+ }
+ 541
+
+ 542
+
543
-
+
544
-
+
545
+
+ 546
- 546 38 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
547
-
+ public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities) {
548
-
+ this .vulnerabilities = vulnerabilities;
549
-
+ }
550
-
+
551
-
+
552
-
+
553
- public Set<Dependency> getRelatedDependencies() {
+
554
- return relatedDependencies;
+
555
- }
+
556
-
- 557
-
- 558
-
+ private void determineHashes(File file) {
+ 557 19 String md5 = null ;
+ 558 19 String sha1 = null ;
559
-
- 560
-
- 561
-
- 562
- public void setRelatedDependencies(Set<Dependency> relatedDependencies) {
- 563
- this .relatedDependencies = relatedDependencies;
- 564
- }
- 565
-
- 566
-
- 567
-
- 568
-
- 569
-
- 570
-
- 571
- public void addRelatedDependency(Dependency dependency) {
- 572 0 relatedDependencies.add(dependency);
- 573 0 }
+ try {
+ 560 19 md5 = Checksum.getMD5Checksum(file);
+ 561 16 sha1 = Checksum.getSHA1Checksum(file);
+ 562 3 } catch (IOException ex) {
+ 563 3 final String msg = String.format("Unable to read '%s' to determine hashes." , file.getName());
+ 564 3 LOGGER.log(Level.WARNING, msg);
+ 565 3 LOGGER.log(Level.FINE, null , ex);
+ 566 0 } catch (NoSuchAlgorithmException ex) {
+ 567 0 final String msg = "Unable to use MD5 of SHA1 checksums." ;
+ 568 0 LOGGER.log(Level.WARNING, msg);
+ 569 0 LOGGER.log(Level.FINE, null , ex);
+ 570 19 }
+ 571 19 this .setMd5sum(md5);
+ 572 19 this .setSha1sum(sha1);
+ 573 19 }
574
575
576
-
+
577
578
-
+
579
-
+
580
-
- 581
- public int compareTo(Dependency o) {
- 582 2 return this .getFileName().compareToIgnoreCase(o.getFileName());
+ public void addVulnerability(Vulnerability vulnerability) {
+ 581 3 this .vulnerabilities.add(vulnerability);
+ 582 3 }
583
- }
+
584
-
+
585
-
+
586
-
- 587
-
+
+ 587 40 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
588
-
+
589
-
+
590
-
+
591
- @Override
+
592
- public boolean equals(Object obj) {
- 593 0 if (obj == null ) {
- 594 0 return false ;
+
+ 593
+
+ 594
+ public Set<Dependency> getRelatedDependencies() {
595
- }
- 596 0 if (getClass() != obj.getClass()) {
- 597 0 return false ;
+ return relatedDependencies;
+ 596
+ }
+ 597
+
598
- }
- 599 0 final Dependency other = (Dependency) obj;
- 600 0 if ((this .actualFilePath == null ) ? (other.actualFilePath != null ) : !this .actualFilePath.equals(other.actualFilePath)) {
- 601 0 return false ;
+
+ 599
+
+ 600
+
+ 601
+
602
- }
- 603 0 if ((this .filePath == null ) ? (other.filePath != null ) : !this .filePath.equals(other.filePath)) {
- 604 0 return false ;
+
+ 603
+ public void setRelatedDependencies(Set<Dependency> relatedDependencies) {
+ 604
+ this .relatedDependencies = relatedDependencies;
605
- }
- 606 0 if ((this .fileName == null ) ? (other.fileName != null ) : !this .fileName.equals(other.fileName)) {
- 607 0 return false ;
+ }
+ 606
+
+ 607
+
608
- }
- 609 0 if ((this .fileExtension == null ) ? (other.fileExtension != null ) : !this .fileExtension.equals(other.fileExtension)) {
- 610 0 return false ;
+
+ 609
+
+ 610
+
611
- }
- 612 0 if ((this .md5sum == null ) ? (other.md5sum != null ) : !this .md5sum.equals(other.md5sum)) {
- 613 0 return false ;
- 614
- }
- 615 0 if ((this .sha1sum == null ) ? (other.sha1sum != null ) : !this .sha1sum.equals(other.sha1sum)) {
- 616 0 return false ;
+
+ 612
+ public void addRelatedDependency(Dependency dependency) {
+ 613 0 relatedDependencies.add(dependency);
+ 614 0 }
+ 615
+
+ 616
+
617
- }
- 618 0 if (this .identifiers != other.identifiers && (this .identifiers == null || !this .identifiers.equals(other.identifiers))) {
- 619 0 return false ;
+
+ 618
+
+ 619
+
620
- }
- 621 0 if (this .vendorEvidence != other.vendorEvidence && (this .vendorEvidence == null || !this .vendorEvidence.equals(other.vendorEvidence))) {
- 622 0 return false ;
- 623
- }
- 624 0 if (this .productEvidence != other.productEvidence && (this .productEvidence == null || !this .productEvidence.equals(other.productEvidence))) {
- 625 0 return false ;
+
+ 621
+
+ 622
+ public int compareTo(Dependency o) {
+ 623 2 return this .getFilePath().compareToIgnoreCase(o.getFilePath());
+ 624
+ }
+ 625
+
626
- }
- 627 0 if (this .versionEvidence != other.versionEvidence && (this .versionEvidence == null || !this .versionEvidence.equals(other.versionEvidence))) {
- 628 0 return false ;
+
+ 627
+
+ 628
+
629
- }
- 630 0 if ((this .description == null ) ? (other.description != null ) : !this .description.equals(other.description)) {
- 631 0 return false ;
+
+ 630
+
+ 631
+
632
+ @Override
+ 633
+ public boolean equals(Object obj) {
+ 634 0 if (obj == null ) {
+ 635 0 return false ;
+ 636
}
- 633 0 if ((this .license == null ) ? (other.license != null ) : !this .license.equals(other.license)) {
- 634 0 return false ;
- 635
+ 637 0 if (getClass() != obj.getClass()) {
+ 638 0 return false ;
+ 639
}
- 636 0 if (this .vulnerabilities != other.vulnerabilities && (this .vulnerabilities == null || !this .vulnerabilities.equals(other.vulnerabilities))) {
- 637 0 return false ;
- 638
+ 640 0 final Dependency other = (Dependency) obj;
+ 641 0 if ((this .actualFilePath == null ) ? (other.actualFilePath != null ) : !this .actualFilePath.equals(other.actualFilePath)) {
+ 642 0 return false ;
+ 643
}
- 639 0 if (this .relatedDependencies != other.relatedDependencies
- 640
- && (this .relatedDependencies == null || !this .relatedDependencies.equals(other.relatedDependencies))) {
- 641 0 return false ;
- 642
- }
- 643 0 return true ;
- 644
- }
- 645
-
+ 644 0 if ((this .filePath == null ) ? (other.filePath != null ) : !this .filePath.equals(other.filePath)) {
+ 645 0 return false ;
646
-
- 647
-
- 648
-
+ }
+ 647 0 if ((this .fileName == null ) ? (other.fileName != null ) : !this .fileName.equals(other.fileName)) {
+ 648 0 return false ;
649
-
- 650
-
- 651
- @Override
+ }
+ 650 0 if ((this .fileExtension == null ) ? (other.fileExtension != null ) : !this .fileExtension.equals(other.fileExtension)) {
+ 651 0 return false ;
652
- public int hashCode() {
- 653 26 int hash = 3;
- 654 26 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
- 655 26 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
- 656 26 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
- 657 26 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
- 658 26 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
- 659 26 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
- 660 26 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
- 661 26 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
- 662 26 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
- 663 26 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
- 664 26 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
- 665 26 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
- 666 26 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
- 667 26 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
- 668 26 return hash;
- 669
- }
+ }
+ 653 0 if ((this .md5sum == null ) ? (other.md5sum != null ) : !this .md5sum.equals(other.md5sum)) {
+ 654 0 return false ;
+ 655
+ }
+ 656 0 if ((this .sha1sum == null ) ? (other.sha1sum != null ) : !this .sha1sum.equals(other.sha1sum)) {
+ 657 0 return false ;
+ 658
+ }
+ 659 0 if (this .identifiers != other.identifiers && (this .identifiers == null || !this .identifiers.equals(other.identifiers))) {
+ 660 0 return false ;
+ 661
+ }
+ 662 0 if (this .vendorEvidence != other.vendorEvidence && (this .vendorEvidence == null || !this .vendorEvidence.equals(other.vendorEvidence))) {
+ 663 0 return false ;
+ 664
+ }
+ 665 0 if (this .productEvidence != other.productEvidence && (this .productEvidence == null || !this .productEvidence.equals(other.productEvidence))) {
+ 666 0 return false ;
+ 667
+ }
+ 668 0 if (this .versionEvidence != other.versionEvidence && (this .versionEvidence == null || !this .versionEvidence.equals(other.versionEvidence))) {
+ 669 0 return false ;
670
-
- 671
-
- 672
-
+ }
+ 671 0 if ((this .description == null ) ? (other.description != null ) : !this .description.equals(other.description)) {
+ 672 0 return false ;
673
-
- 674
-
- 675
-
+ }
+ 674 0 if ((this .license == null ) ? (other.license != null ) : !this .license.equals(other.license)) {
+ 675 0 return false ;
676
- @Override
- 677
- public String toString() {
- 678 0 return "Dependency{ fileName='" + fileName + "', actualFilePath='" + actualFilePath + "', filePath='" + filePath + "'}" ;
+ }
+ 677 0 if (this .vulnerabilities != other.vulnerabilities && (this .vulnerabilities == null || !this .vulnerabilities.equals(other.vulnerabilities))) {
+ 678 0 return false ;
679
+ }
+ 680 0 if (this .relatedDependencies != other.relatedDependencies
+ 681
+ && (this .relatedDependencies == null || !this .relatedDependencies.equals(other.relatedDependencies))) {
+ 682 0 return false ;
+ 683
+ }
+ 684 0 return true ;
+ 685
}
- 680
+ 686
+
+ 687
+
+ 688
+
+ 689
+
+ 690
+
+ 691
+
+ 692
+ @Override
+ 693
+ public int hashCode() {
+ 694 28 int hash = 3;
+ 695 28 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
+ 696 28 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
+ 697 28 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
+ 698 28 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
+ 699 28 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
+ 700 28 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
+ 701 28 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
+ 702 28 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
+ 703 28 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
+ 704 28 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
+ 705 28 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
+ 706 28 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
+ 707 28 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
+ 708 28 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
+ 709 28 return hash;
+ 710
+ }
+ 711
+
+ 712
+
+ 713
+
+ 714
+
+ 715
+
+ 716
+
+ 717
+ @Override
+ 718
+ public String toString() {
+ 719 0 return "Dependency{ fileName='" + fileName + "', actualFilePath='" + actualFilePath + "', filePath='" + filePath + "'}" ;
+ 720
+ }
+ 721
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
index 5b2cd6ec0..4e082186d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Evidence.html
@@ -69,7 +69,7 @@
26
- 27 39714 public class Evidence implements Serializable, Comparable<Evidence> {
+ 27 37400 public class Evidence implements Serializable, Comparable<Evidence> {
28
29
@@ -222,8 +222,8 @@
103
public String getValue() {
- 104 325 used = true ;
- 105 325 return value;
+ 104 377 used = true ;
+ 105 377 return value;
106
}
107
@@ -242,8 +242,8 @@
114
public String getValue(Boolean setUsed) {
- 115 50 used = used || setUsed;
- 116 50 return value;
+ 115 54 used = used || setUsed;
+ 116 54 return value;
117
}
118
@@ -368,12 +368,12 @@
@Override
178
public int hashCode() {
- 179 2 int hash = 3;
- 180 2 hash = 67 * hash + (this .name != null ? this .name.hashCode() : 0);
- 181 2 hash = 67 * hash + (this .source != null ? this .source.hashCode() : 0);
- 182 2 hash = 67 * hash + (this .value != null ? this .value.hashCode() : 0);
- 183 2 hash = 67 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
- 184 2 return hash;
+ 179 5 int hash = 3;
+ 180 5 hash = 67 * hash + (this .name != null ? this .name.hashCode() : 0);
+ 181 5 hash = 67 * hash + (this .source != null ? this .source.hashCode() : 0);
+ 182 5 hash = 67 * hash + (this .value != null ? this .value.hashCode() : 0);
+ 183 5 hash = 67 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
+ 184 5 return hash;
185
}
186
@@ -447,15 +447,15 @@
224
public int compareTo(Evidence o) {
- 225 39714 if (o == null ) {
+ 225 37400 if (o == null ) {
226 0 return 1;
227
}
- 228 39714 if (equalsWithNullCheck(source, o.source)) {
- 229 25251 if (equalsWithNullCheck(name, o.name)) {
- 230 25158 if (equalsWithNullCheck(value, o.value)) {
- 231 15445 if (equalsWithNullCheck(confidence, o.confidence)) {
- 232 15432 return 0;
+ 228 37400 if (equalsWithNullCheck(source, o.source)) {
+ 229 23688 if (equalsWithNullCheck(name, o.name)) {
+ 230 23581 if (equalsWithNullCheck(value, o.value)) {
+ 231 14656 if (equalsWithNullCheck(confidence, o.confidence)) {
+ 232 14643 return 0;
233
} else {
234 13 return compareToWithNullCheck(confidence, o.confidence);
@@ -463,17 +463,17 @@
}
236
} else {
- 237 9713 return compareToIgnoreCaseWithNullCheck(value, o.value);
+ 237 8925 return compareToIgnoreCaseWithNullCheck(value, o.value);
238
}
239
} else {
- 240 93 return compareToIgnoreCaseWithNullCheck(name, o.name);
+ 240 107 return compareToIgnoreCaseWithNullCheck(name, o.name);
241
}
242
} else {
- 243 14463 return compareToIgnoreCaseWithNullCheck(source, o.source);
+ 243 13712 return compareToIgnoreCaseWithNullCheck(source, o.source);
244
}
245
@@ -496,13 +496,13 @@
254
private boolean equalsWithNullCheck(String me, String other) {
- 255 90123 if (me == null && other == null ) {
+ 255 84669 if (me == null && other == null ) {
256 0 return true ;
- 257 90123 } else if (me == null || other == null ) {
+ 257 84669 } else if (me == null || other == null ) {
258 0 return false ;
259
}
- 260 90123 return me.equals(other);
+ 260 84669 return me.equals(other);
261
}
262
@@ -523,13 +523,13 @@
270
private boolean equalsWithNullCheck(Confidence me, Confidence other) {
- 271 15445 if (me == null && other == null ) {
+ 271 14656 if (me == null && other == null ) {
272 0 return true ;
- 273 15445 } else if (me == null || other == null ) {
+ 273 14656 } else if (me == null || other == null ) {
274 0 return false ;
275
}
- 276 15445 return me.equals(other);
+ 276 14656 return me.equals(other);
277
}
278
@@ -552,15 +552,15 @@
287
private int compareToIgnoreCaseWithNullCheck(String me, String other) {
- 288 24269 if (me == null && other == null ) {
+ 288 22744 if (me == null && other == null ) {
289 0 return 0;
- 290 24269 } else if (me == null ) {
+ 290 22744 } else if (me == null ) {
291 0 return -1;
- 292 24269 } else if (other == null ) {
+ 292 22744 } else if (other == null ) {
293 0 return 1;
294
}
- 295 24269 return me.compareToIgnoreCase(other);
+ 295 22744 return me.compareToIgnoreCase(other);
296
}
297
@@ -598,6 +598,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
index b8b34e8ff..7147acc99 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.EvidenceCollection.html
@@ -12,7 +12,7 @@
Classes in this File Line Coverage Branch Coverage Complexity
- EvidenceCollection 2.8333333333333335; 2.833
+ EvidenceCollection 2.8333333333333335; 2.833
EvidenceCollection$1 2.8333333333333335; 2.833
EvidenceCollection$2 2.8333333333333335; 2.833
EvidenceCollection$3 2.8333333333333335; 2.833
@@ -117,10 +117,10 @@
48
- 49 57 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
+ 49 63 private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
50
public boolean passes(Evidence evidence) {
- 51 57 return evidence.getConfidence() == Confidence.HIGHEST;
+ 51 63 return evidence.getConfidence() == Confidence.HIGHEST;
52
}
53
@@ -131,10 +131,10 @@
56
- 57 47 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
+ 57 52 private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
58
public boolean passes(Evidence evidence) {
- 59 47 return evidence.getConfidence() == Confidence.HIGH;
+ 59 52 return evidence.getConfidence() == Confidence.HIGH;
60
}
61
@@ -148,7 +148,7 @@
65 1 private static final Filter<Evidence> MEDIUM_CONFIDENCE = new Filter<Evidence>() {
66
public boolean passes(Evidence evidence) {
- 67 32 return evidence.getConfidence() == Confidence.MEDIUM;
+ 67 36 return evidence.getConfidence() == Confidence.MEDIUM;
68
}
69
@@ -162,7 +162,7 @@
73 1 private static final Filter<Evidence> LOW_CONFIDENCE = new Filter<Evidence>() {
74
public boolean passes(Evidence evidence) {
- 75 32 return evidence.getConfidence() == Confidence.LOW;
+ 75 36 return evidence.getConfidence() == Confidence.LOW;
76
}
77
@@ -176,7 +176,7 @@
81 1 private static final Filter<Evidence> EVIDENCE_USED = new Filter<Evidence>() {
82
public boolean passes(Evidence evidence) {
- 83 437 return evidence.isUsed();
+ 83 481 return evidence.isUsed();
84
}
85
@@ -234,10 +234,10 @@
115
- 116 118 public EvidenceCollection() {
- 117 118 list = new TreeSet<Evidence>();
- 118 118 weightedStrings = new HashSet<String>();
- 119 118 }
+ 116 132 public EvidenceCollection() {
+ 117 132 list = new TreeSet<Evidence>();
+ 118 132 weightedStrings = new HashSet<String>();
+ 119 132 }
120
121
@@ -252,8 +252,8 @@
126
public void addEvidence(Evidence e) {
- 127 15493 list.add(e);
- 128 15493 }
+ 127 14708 list.add(e);
+ 128 14708 }
129
130
@@ -274,9 +274,9 @@
138
public void addEvidence(String source, String name, String value, Confidence confidence) {
- 139 15486 final Evidence e = new Evidence(source, name, value, confidence);
- 140 15486 addEvidence(e);
- 141 15486 }
+ 139 14701 final Evidence e = new Evidence(source, name, value, confidence);
+ 140 14701 addEvidence(e);
+ 141 14701 }
142
143
@@ -391,18 +391,18 @@
203
public Set<Evidence> getEvidence(String source, String name) {
- 204 2 if (source == null || name == null ) {
+ 204 8 if (source == null || name == null ) {
205 0 return null ;
206
}
- 207 2 final Set<Evidence> ret = new HashSet<Evidence>();
- 208 2 for (Evidence e : list) {
- 209 2 if (source.equals(e.getSource()) && name.equals(e.getName())) {
- 210 2 ret.add(e);
+ 207 8 final Set<Evidence> ret = new HashSet<Evidence>();
+ 208 8 for (Evidence e : list) {
+ 209 11 if (source.equals(e.getSource()) && name.equals(e.getName())) {
+ 210 5 ret.add(e);
211
}
- 212 2 }
- 213 2 return ret;
+ 212 11 }
+ 213 8 return ret;
214
}
215
@@ -448,12 +448,12 @@
237 57 for (Evidence e : EvidenceCollection.EVIDENCE_USED.filter(this )) {
238
- 239 259 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
- 240 259 if (value.contains(textToTest)) {
+ 239 306 final String value = urlCorrection(e.getValue().toLowerCase()).replaceAll("[\\s_-]" , "" );
+ 240 306 if (value.contains(textToTest)) {
241 28 return true ;
242
}
- 243 231 }
+ 243 278 }
244 29 return false ;
245
}
@@ -505,13 +505,13 @@
273
public boolean contains(Confidence confidence) {
- 274 12 for (Evidence e : list) {
- 275 62 if (e.getConfidence().equals(confidence)) {
- 276 11 return true ;
+ 274 14 for (Evidence e : list) {
+ 275 71 if (e.getConfidence().equals(confidence)) {
+ 276 12 return true ;
277
}
- 278 51 }
- 279 1 return false ;
+ 278 59 }
+ 279 2 return false ;
280
}
281
@@ -559,13 +559,13 @@
306
public static EvidenceCollection merge(EvidenceCollection... ec) {
- 307 3 final EvidenceCollection ret = new EvidenceCollection();
- 308 12 for (EvidenceCollection col : ec) {
- 309 9 ret.list.addAll(col.list);
- 310 9 ret.weightedStrings.addAll(col.weightedStrings);
+ 307 11 final EvidenceCollection ret = new EvidenceCollection();
+ 308 44 for (EvidenceCollection col : ec) {
+ 309 33 ret.list.addAll(col.list);
+ 310 33 ret.weightedStrings.addAll(col.weightedStrings);
311
}
- 312 3 return ret;
+ 312 11 return ret;
313
}
314
@@ -617,8 +617,8 @@
public String toString() {
342 3 final StringBuilder sb = new StringBuilder();
343 3 for (Evidence e : this .list) {
- 344 13 sb.append(e.getValue()).append(' ' );
- 345 13 }
+ 344 12 sb.append(e.getValue()).append(' ' );
+ 345 12 }
346 3 return sb.toString();
347
}
@@ -679,8 +679,8 @@
376
private String urlCorrection(String value) {
- 377 259 if (value == null || !UrlStringUtils.containsUrl(value)) {
- 378 254 return value;
+ 377 306 if (value == null || !UrlStringUtils.containsUrl(value)) {
+ 378 301 return value;
379
}
380 5 final StringBuilder sb = new StringBuilder(value.length());
@@ -709,6 +709,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
index 70d17fd64..203ba0c01 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Identifier.html
@@ -67,7 +67,7 @@
25
- 26 26 public class Identifier implements Serializable, Comparable<Identifier> {
+ 26 35 public class Identifier implements Serializable, Comparable<Identifier> {
27
28
@@ -377,10 +377,10 @@
@Override
187
public int hashCode() {
- 188 10 int hash = 5;
- 189 10 hash = 53 * hash + (this .value != null ? this .value.hashCode() : 0);
- 190 10 hash = 53 * hash + (this .type != null ? this .type.hashCode() : 0);
- 191 10 return hash;
+ 188 30 int hash = 5;
+ 189 30 hash = 53 * hash + (this .value != null ? this .value.hashCode() : 0);
+ 190 30 hash = 53 * hash + (this .type != null ? this .type.hashCode() : 0);
+ 191 30 return hash;
192
}
193
@@ -418,17 +418,17 @@
210
public int compareTo(Identifier o) {
- 211 28 if (o == null ) {
+ 211 39 if (o == null ) {
212 0 return -1;
213
}
- 214 28 return this .value.compareTo(o.value);
+ 214 39 return this .value.compareTo(o.value);
215
}
216
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
index 16febd151..95cb306cc 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Reference.html
@@ -296,6 +296,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
index 1576ac49b..912b684a7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.Vulnerability.html
@@ -871,6 +871,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
index 07ec2bfa2..9ef68a446 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerabilityComparator.html
@@ -107,6 +107,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
index 1006a4c4d..cfbde8ee7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.dependency.VulnerableSoftware.html
@@ -665,6 +665,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
index e2326c052..d805a9ea9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.NoDataException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
index 74785d686..242fb1658 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.exception.ScanAgentException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html
index 7cb28f9af..265407396 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.MavenNamespaceFilter.html
@@ -198,6 +198,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html
index 413958b32..228e8f931 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Activation.html
@@ -409,6 +409,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html
index 5c04a64bf..2f1a9f172 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationFile.html
@@ -233,6 +233,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html
index 770578428..0e71f3196 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationOS.html
@@ -347,6 +347,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html
index 41d74e942..1c8544d5f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ActivationProperty.html
@@ -233,6 +233,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html
index 509ae0541..618cba54d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Build.html
@@ -1635,6 +1635,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html
index 536fb5f6c..05d1b4e5b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.BuildBase.html
@@ -1145,6 +1145,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html
index a93122dc0..b678da13f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.CiManagement.html
@@ -429,6 +429,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html
index 8b7079a13..5d44158da 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Contributor.html
@@ -875,6 +875,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html
index 634501956..739e693e4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Dependency.html
@@ -783,6 +783,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html
index 02f7de96e..34cf5b01b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DependencyManagement.html
@@ -317,6 +317,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html
index 2f13b8489..df2999491 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DeploymentRepository.html
@@ -409,6 +409,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html
index f0b2f04d1..7b278a568 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Developer.html
@@ -929,6 +929,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html
index eb24ab0d4..8e2a0157c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.DistributionManagement.html
@@ -465,6 +465,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html
index 0e4ff3a90..2c43ae23f 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Exclusion.html
@@ -225,6 +225,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html
index 304135092..c72ad2c8b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Extension.html
@@ -283,6 +283,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html
index 68f911977..036d6b603 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.IssueManagement.html
@@ -229,6 +229,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html
index 22079953e..4ec56b3de 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.License.html
@@ -349,6 +349,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html
index 2ae1a51df..3acf2a760 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.MailingList.html
@@ -609,6 +609,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html
index 589568d08..c4dccf0d9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Model.html
@@ -3169,6 +3169,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html
index dd5b3edff..4dedfa887 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Notifier.html
@@ -683,6 +683,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html
index 6a7ecd088..68158952b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory.html
@@ -1396,6 +1396,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html
index 3cd7d48f0..1b765223b 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Organization.html
@@ -225,6 +225,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html
index 79110fa02..b4343f675 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Parent.html
@@ -345,6 +345,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html
index ae62df5c9..f983132d8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Plugin.html
@@ -1217,6 +1217,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html
index 412f8401e..3c79d0216 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginExecution.html
@@ -697,6 +697,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html
index 5bc8a9f2b..6ec2a8488 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.PluginManagement.html
@@ -317,6 +317,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html
index 569e854b8..1e748da53 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Prerequisites.html
@@ -171,6 +171,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html
index fc1c30af2..5e7b2c955 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Profile.html
@@ -1673,6 +1673,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html
index 0475b287d..47edf91d4 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Relocation.html
@@ -343,6 +343,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html
index 9596b3475..170709325 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportPlugin.html
@@ -755,6 +755,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html
index 4454cf912..add1540e1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.ReportSet.html
@@ -639,6 +639,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html
index e6168ec22..216626584 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Reporting.html
@@ -433,6 +433,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html
index dee835671..d9eb58900 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Repository.html
@@ -465,6 +465,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html
index ae7a03a0b..88f9f5212 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.RepositoryPolicy.html
@@ -287,6 +287,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html
index e7423dca4..da01799c6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Resource.html
@@ -697,6 +697,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html
index 6fb0fd648..b2e4f1ad9 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Scm.html
@@ -345,6 +345,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html
index c6865eb98..e0dc7beed 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.Site.html
@@ -287,6 +287,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html
index 2ea44cf63..4108203d6 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.jaxb.pom.generated.package-info.html
@@ -37,6 +37,6 @@
package org.owasp.dependencycheck.jaxb.pom.generated;
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
index 98d32674a..377390844 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.EscapeTool.html
@@ -159,6 +159,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
index 24107fbd8..4de82bbd7 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.ReportGenerator.html
@@ -12,8 +12,8 @@
@@ -319,134 +319,153 @@
168
public void generateReports(String outputDir, String outputFormat) throws IOException, Exception {
169 0 final String format = outputFormat.toUpperCase();
- 170 0 if (format.matches("^(XML|HTML|VULN|ALL)$" )) {
- 171 0 if ("XML" .equalsIgnoreCase(format)) {
- 172 0 generateReports(outputDir, Format.XML);
- 173
- }
- 174 0 if ("HTML" .equalsIgnoreCase(format)) {
- 175 0 generateReports(outputDir, Format.HTML);
- 176
- }
- 177 0 if ("VULN" .equalsIgnoreCase(format)) {
- 178 0 generateReports(outputDir, Format.VULN);
- 179
- }
- 180 0 if ("ALL" .equalsIgnoreCase(format)) {
- 181 0 generateReports(outputDir, Format.ALL);
- 182
- }
- 183
- }
- 184 0 }
- 185
-
- 186
-
- 187
-
- 188
-
- 189
-
- 190
-
- 191
-
- 192
-
- 193
-
- 194
-
- 195
-
- 196
- protected void generateReport(String templateName, String outFileName) throws IOException, Exception {
- 197 0 InputStream input = null ;
- 198 0 String templatePath = null ;
- 199 0 final File f = new File(templateName);
- 200 0 if (f.exists() && f.isFile()) {
- 201
- try {
- 202 0 templatePath = templateName;
- 203 0 input = new FileInputStream(f);
- 204 0 } catch (FileNotFoundException ex) {
- 205 0 final String msg = "Unable to generate the report, the report template file could not be found." ;
- 206 0 LOGGER.log(Level.SEVERE, msg);
- 207 0 LOGGER.log(Level.FINE, null , ex);
- 208 0 }
- 209
- } else {
- 210 0 templatePath = "templates/" + templateName + ".vsl" ;
- 211 0 input = this .getClass().getClassLoader().getResourceAsStream(templatePath);
- 212
- }
- 213 0 if (input == null ) {
- 214 0 throw new IOException("Template file doesn't exist" );
- 215
- }
- 216
-
- 217 0 final InputStreamReader reader = new InputStreamReader(input, "UTF-8" );
- 218 0 OutputStreamWriter writer = null ;
- 219 0 OutputStream outputStream = null ;
- 220
-
- 221
- try {
- 222 0 final File outDir = new File(outFileName).getParentFile();
- 223 0 if (!outDir.exists()) {
- 224 0 final boolean created = outDir.mkdirs();
- 225 0 if (!created) {
- 226 0 throw new Exception("Unable to create directory '" + outDir.getAbsolutePath() + "'." );
- 227
+ 170 0 final String pathToCheck = outputDir.toLowerCase();
+ 171 0 if (format.matches("^(XML|HTML|VULN|ALL)$" )) {
+ 172 0 if ("XML" .equalsIgnoreCase(format)) {
+ 173 0 if (pathToCheck.endsWith(".xml" )) {
+ 174 0 generateReport("XmlReport" , outputDir);
+ 175
+ } else {
+ 176 0 generateReports(outputDir, Format.XML);
+ 177
}
- 228
+ 178
}
+ 179 0 if ("HTML" .equalsIgnoreCase(format)) {
+ 180 0 if (pathToCheck.endsWith(".html" ) || pathToCheck.endsWith(".htm" )) {
+ 181 0 generateReport("HtmlReport" , outputDir);
+ 182
+ } else {
+ 183 0 generateReports(outputDir, Format.HTML);
+ 184
+ }
+ 185
+ }
+ 186 0 if ("VULN" .equalsIgnoreCase(format)) {
+ 187 0 if (pathToCheck.endsWith(".html" ) || pathToCheck.endsWith(".htm" )) {
+ 188 0 generateReport("VulnReport" , outputDir);
+ 189
+ } else {
+ 190 0 generateReports(outputDir, Format.VULN);
+ 191
+ }
+ 192
+ }
+ 193 0 if ("ALL" .equalsIgnoreCase(format)) {
+ 194 0 generateReports(outputDir, Format.ALL);
+ 195
+ }
+ 196
+ }
+ 197 0 }
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+ protected void generateReport(String templateName, String outFileName) throws IOException, Exception {
+ 210 0 InputStream input = null ;
+ 211 0 String templatePath = null ;
+ 212 0 final File f = new File(templateName);
+ 213 0 if (f.exists() && f.isFile()) {
+ 214
+ try {
+ 215 0 templatePath = templateName;
+ 216 0 input = new FileInputStream(f);
+ 217 0 } catch (FileNotFoundException ex) {
+ 218 0 final String msg = "Unable to generate the report, the report template file could not be found." ;
+ 219 0 LOGGER.log(Level.SEVERE, msg);
+ 220 0 LOGGER.log(Level.FINE, null , ex);
+ 221 0 }
+ 222
+ } else {
+ 223 0 templatePath = "templates/" + templateName + ".vsl" ;
+ 224 0 input = this .getClass().getClassLoader().getResourceAsStream(templatePath);
+ 225
+ }
+ 226 0 if (input == null ) {
+ 227 0 throw new IOException("Template file doesn't exist" );
+ 228
+ }
229
- 230 0 outputStream = new FileOutputStream(outFileName);
- 231 0 writer = new OutputStreamWriter(outputStream, "UTF-8" );
- 232
+ 230 0 final InputStreamReader reader = new InputStreamReader(input, "UTF-8" );
+ 231 0 OutputStreamWriter writer = null ;
+ 232 0 OutputStream outputStream = null ;
+ 233
- 233 0 if (!engine.evaluate(context, writer, templatePath, reader)) {
- 234 0 throw new Exception("Failed to convert the template into html." );
- 235
+ 234
+ try {
+ 235 0 final File outDir = new File(outFileName).getParentFile();
+ 236 0 if (!outDir.exists()) {
+ 237 0 final boolean created = outDir.mkdirs();
+ 238 0 if (!created) {
+ 239 0 throw new Exception("Unable to create directory '" + outDir.getAbsolutePath() + "'." );
+ 240
+ }
+ 241
}
- 236 0 writer.flush();
- 237
+ 242
+
+ 243 0 outputStream = new FileOutputStream(outFileName);
+ 244 0 writer = new OutputStreamWriter(outputStream, "UTF-8" );
+ 245
+
+ 246 0 if (!engine.evaluate(context, writer, templatePath, reader)) {
+ 247 0 throw new Exception("Failed to convert the template into html." );
+ 248
+ }
+ 249 0 writer.flush();
+ 250
} finally {
- 238 0 if (writer != null ) {
- 239
- try {
- 240 0 writer.close();
- 241 0 } catch (IOException ex) {
- 242 0 LOGGER.log(Level.FINEST, null , ex);
- 243 0 }
- 244
- }
- 245 0 if (outputStream != null ) {
- 246
- try {
- 247 0 outputStream.close();
- 248 0 } catch (IOException ex) {
- 249 0 LOGGER.log(Level.FINEST, null , ex);
- 250 0 }
- 251
- }
+ 251 0 if (writer != null ) {
252
- try {
- 253 0 reader.close();
- 254 0 } catch (IOException ex) {
- 255 0 LOGGER.log(Level.FINEST, null , ex);
- 256 0 }
- 257 0 }
- 258 0 }
+ try {
+ 253 0 writer.close();
+ 254 0 } catch (IOException ex) {
+ 255 0 LOGGER.log(Level.FINEST, null , ex);
+ 256 0 }
+ 257
+ }
+ 258 0 if (outputStream != null ) {
259
+ try {
+ 260 0 outputStream.close();
+ 261 0 } catch (IOException ex) {
+ 262 0 LOGGER.log(Level.FINEST, null , ex);
+ 263 0 }
+ 264
+ }
+ 265
+ try {
+ 266 0 reader.close();
+ 267 0 } catch (IOException ex) {
+ 268 0 LOGGER.log(Level.FINEST, null , ex);
+ 269 0 }
+ 270 0 }
+ 271 0 }
+ 272
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
index 6e568904f..ec1ed9a3c 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.reporting.VelocityLoggerRedirect.html
@@ -221,6 +221,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
index 5f3bc3c8c..a709b8747 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.PropertyType.html
@@ -237,21 +237,21 @@
110
public boolean matches(String text) {
- 111 38 if (text == null ) {
+ 111 66 if (text == null ) {
112 0 return false ;
113
}
- 114 38 if (this .regex) {
+ 114 66 if (this .regex) {
115
Pattern rx;
- 116 12 if (this .caseSensitive) {
+ 116 40 if (this .caseSensitive) {
117 2 rx = Pattern.compile(this .value);
118
} else {
- 119 10 rx = Pattern.compile(this .value, Pattern.CASE_INSENSITIVE);
+ 119 38 rx = Pattern.compile(this .value, Pattern.CASE_INSENSITIVE);
120
}
- 121 12 return rx.matcher(text).matches();
+ 121 40 return rx.matcher(text).matches();
122
} else {
123 26 if (this .caseSensitive) {
@@ -357,6 +357,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
index edfe38d04..779d9ff37 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionErrorHandler.html
@@ -197,6 +197,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
index 2f57e4bee..6fa19c6c8 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionHandler.html
@@ -217,13 +217,13 @@
@Override
101
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
- 102 195 currentAttributes = attributes;
- 103 195 currentText = new StringBuffer();
- 104 195 if (SUPPRESS.equals(qName)) {
- 105 45 rule = new SuppressionRule();
- 106 45 final String base = currentAttributes.getValue("base" );
- 107 45 if (base != null ) {
- 108 45 rule.setBase(Boolean.parseBoolean(base));
+ 102 270 currentAttributes = attributes;
+ 103 270 currentText = new StringBuffer();
+ 104 270 if (SUPPRESS.equals(qName)) {
+ 105 60 rule = new SuppressionRule();
+ 106 60 final String base = currentAttributes.getValue("base" );
+ 107 60 if (base != null ) {
+ 108 60 rule.setBase(Boolean.parseBoolean(base));
109
} else {
110 0 rule.setBase(false );
@@ -231,7 +231,7 @@
}
112
}
- 113 195 }
+ 113 270 }
114
115
@@ -254,30 +254,30 @@
@Override
124
public void endElement(String uri, String localName, String qName) throws SAXException {
- 125 195 if (SUPPRESS.equals(qName)) {
- 126 45 suppressionRules.add(rule);
- 127 45 rule = null ;
- 128 150 } else if (FILE_PATH.equals(qName)) {
- 129 17 final PropertyType pt = processPropertyType();
- 130 17 rule.setFilePath(pt);
- 131 17 } else if (SHA1.equals(qName)) {
+ 125 270 if (SUPPRESS.equals(qName)) {
+ 126 60 suppressionRules.add(rule);
+ 127 60 rule = null ;
+ 128 210 } else if (FILE_PATH.equals(qName)) {
+ 129 22 final PropertyType pt = processPropertyType();
+ 130 22 rule.setFilePath(pt);
+ 131 22 } else if (SHA1.equals(qName)) {
132 4 rule.setSha1(currentText.toString());
- 133 129 } else if (GAV.equals(qName)) {
- 134 20 final PropertyType pt = processPropertyType();
- 135 20 rule.setGav(pt);
- 136 20 } else if (CPE.equals(qName)) {
- 137 43 final PropertyType pt = processPropertyType();
- 138 43 rule.addCpe(pt);
- 139 43 } else if (CWE.equals(qName)) {
+ 133 184 } else if (GAV.equals(qName)) {
+ 134 30 final PropertyType pt = processPropertyType();
+ 135 30 rule.setGav(pt);
+ 136 30 } else if (CPE.equals(qName)) {
+ 137 73 final PropertyType pt = processPropertyType();
+ 138 73 rule.addCpe(pt);
+ 139 73 } else if (CWE.equals(qName)) {
140 0 rule.addCwe(currentText.toString());
- 141 66 } else if (CVE.equals(qName)) {
+ 141 81 } else if (CVE.equals(qName)) {
142 8 rule.addCve(currentText.toString());
- 143 58 } else if (CVSS_BELOW.equals(qName)) {
+ 143 73 } else if (CVSS_BELOW.equals(qName)) {
144 4 final float cvss = Float.parseFloat(currentText.toString());
145 4 rule.addCvssBelow(cvss);
146
}
- 147 195 }
+ 147 270 }
148
149
@@ -300,8 +300,8 @@
@Override
158
public void characters(char [] ch, int start, int length) throws SAXException {
- 159 431 currentText.append(ch, start, length);
- 160 431 }
+ 159 611 currentText.append(ch, start, length);
+ 160 611 }
161
162
@@ -318,28 +318,28 @@
168
private PropertyType processPropertyType() {
- 169 80 final PropertyType pt = new PropertyType();
- 170 80 pt.setValue(currentText.toString());
- 171 80 if (currentAttributes != null && currentAttributes.getLength() > 0) {
- 172 80 final String regex = currentAttributes.getValue("regex" );
- 173 80 if (regex != null ) {
- 174 80 pt.setRegex(Boolean.parseBoolean(regex));
+ 169 125 final PropertyType pt = new PropertyType();
+ 170 125 pt.setValue(currentText.toString());
+ 171 125 if (currentAttributes != null && currentAttributes.getLength() > 0) {
+ 172 125 final String regex = currentAttributes.getValue("regex" );
+ 173 125 if (regex != null ) {
+ 174 125 pt.setRegex(Boolean.parseBoolean(regex));
175
}
- 176 80 final String caseSensitive = currentAttributes.getValue("caseSensitive" );
- 177 80 if (caseSensitive != null ) {
- 178 80 pt.setCaseSensitive(Boolean.parseBoolean(caseSensitive));
+ 176 125 final String caseSensitive = currentAttributes.getValue("caseSensitive" );
+ 177 125 if (caseSensitive != null ) {
+ 178 125 pt.setCaseSensitive(Boolean.parseBoolean(caseSensitive));
179
}
180
}
- 181 80 return pt;
+ 181 125 return pt;
182
}
183
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
index 40a671935..2fd33f85d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParseException.html
@@ -76,85 +76,75 @@
29
30
-
+
31
32
- private static final long serialVersionUID = 1L;
- 33
-
- 34
-
- 35
-
- 36
-
- 37
public SuppressionParseException() {
- 38
+ 33
super ();
+ 34
+ }
+ 35
+
+ 36
+
+ 37
+
+ 38
+
39
- }
+
40
-
+
41
-
- 42
-
- 43
-
- 44
-
- 45
-
- 46
public SuppressionParseException(String msg) {
- 47
+ 42
super (msg);
+ 43
+ }
+ 44
+
+ 45
+
+ 46
+
+ 47
+
48
- }
+
49
-
+
50
-
- 51
-
- 52
-
- 53
-
- 54
-
- 55
public SuppressionParseException(Throwable ex) {
- 56
+ 51
super (ex);
- 57
+ 52
}
- 58
+ 53
- 59
+ 54
- 60
+ 55
- 61
+ 56
- 62
+ 57
- 63
-
- 64
+ 58
+
+ 59
- 65
+ 60
public SuppressionParseException(String msg, Throwable ex) {
- 66
+ 61
super (msg, ex);
- 67
+ 62
}
- 68
+ 63
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
index 80436c4df..d9b823f87 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionParser.html
@@ -238,6 +238,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
index ff6dd5971..de5df1db1 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.suppression.SuppressionRule.html
@@ -12,7 +12,7 @@
@@ -77,7 +77,7 @@
30
- 31 61 public class SuppressionRule {
+ 31 76 public class SuppressionRule {
32
33
@@ -174,7 +174,7 @@
79
- 80 61 private List<PropertyType> cpe = new ArrayList<PropertyType>();
+ 80 76 private List<PropertyType> cpe = new ArrayList<PropertyType>();
81
82
@@ -225,8 +225,8 @@
105
public void addCpe(PropertyType cpe) {
- 106 50 this .cpe.add(cpe);
- 107 50 }
+ 106 80 this .cpe.add(cpe);
+ 107 80 }
108
109
@@ -250,7 +250,7 @@
119
- 120 61 private List<Float> cvssBelow = new ArrayList<Float>();
+ 120 76 private List<Float> cvssBelow = new ArrayList<Float>();
121
122
@@ -326,7 +326,7 @@
159
- 160 61 private List<String> cwe = new ArrayList<String>();
+ 160 76 private List<String> cwe = new ArrayList<String>();
161
162
@@ -402,7 +402,7 @@
199
- 200 61 private List<String> cve = new ArrayList<String>();
+ 200 76 private List<String> cve = new ArrayList<String>();
201
202
@@ -478,7 +478,7 @@
239
- 240 61 private PropertyType gav = null ;
+ 240 76 private PropertyType gav = null ;
241
242
@@ -535,318 +535,326 @@
268
269
- private boolean base;
+
270
-
+
271
-
+
272
-
+
273
-
+ private boolean base;
274
-
+
275
-
+
276
- public boolean isBase() {
+
277
- return base;
+
278
- }
+
279
-
+
280
-
+ public boolean isBase() {
281
-
+ return base;
282
-
+ }
283
-
+
284
-
+
285
- public void setBase(boolean base) {
+
286
- this .base = base;
+
287
- }
+
288
-
+
289
-
+ public void setBase(boolean base) {
290
-
+ this .base = base;
291
-
+ }
292
-
+
293
-
+
294
-
+
295
- public void process(Dependency dependency) {
- 296 30 if (filePath != null && !filePath.matches(dependency.getFilePath())) {
- 297 0 return ;
+
+ 296
+
+ 297
+
298
+
+ 299
+ public void process(Dependency dependency) {
+ 300 42 if (filePath != null && !filePath.matches(dependency.getFilePath())) {
+ 301 4 return ;
+ 302
}
- 299 30 if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) {
- 300 1 return ;
- 301
+ 303 38 if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) {
+ 304 1 return ;
+ 305
}
- 302 29 if (gav != null ) {
- 303 17 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
- 304 17 boolean gavFound = false ;
- 305 37 while (itr.hasNext()) {
- 306 21 final Identifier i = itr.next();
- 307 21 if (identifierMatches("maven" , this .gav, i)) {
- 308 1 gavFound = true ;
- 309 1 break ;
- 310
- }
- 311 20 }
- 312 17 if (!gavFound) {
- 313 16 return ;
+ 306 37 if (gav != null ) {
+ 307 25 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+ 308 25 boolean gavFound = false ;
+ 309 77 while (itr.hasNext()) {
+ 310 53 final Identifier i = itr.next();
+ 311 53 if (identifierMatches("maven" , this .gav, i)) {
+ 312 1 gavFound = true ;
+ 313 1 break ;
314
+ }
+ 315 52 }
+ 316 25 if (!gavFound) {
+ 317 24 return ;
+ 318
}
- 315
+ 319
}
- 316
+ 320
- 317 13 if (this .hasCpe()) {
- 318 8 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
- 319 22 while (itr.hasNext()) {
- 320 14 final Identifier i = itr.next();
- 321 14 for (PropertyType c : this .cpe) {
- 322 22 if (identifierMatches("cpe" , c, i)) {
- 323 7 if (!isBase()) {
- 324 4 dependency.addSuppressedIdentifier(i);
- 325
+ 321 13 if (this .hasCpe()) {
+ 322 8 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+ 323 26 while (itr.hasNext()) {
+ 324 18 final Identifier i = itr.next();
+ 325 18 for (PropertyType c : this .cpe) {
+ 326 26 if (identifierMatches("cpe" , c, i)) {
+ 327 7 if (!isBase()) {
+ 328 4 dependency.addSuppressedIdentifier(i);
+ 329
}
- 326 7 itr.remove();
- 327 7 break ;
- 328
+ 330 7 itr.remove();
+ 331 7 break ;
+ 332
}
- 329 15 }
- 330 14 }
- 331
+ 333 19 }
+ 334 18 }
+ 335
}
- 332 13 if (hasCve() || hasCwe() || hasCvssBelow()) {
- 333 5 final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator();
- 334 10 while (itr.hasNext()) {
- 335 5 boolean remove = false ;
- 336 5 final Vulnerability v = itr.next();
- 337 5 for (String entry : this .cve) {
- 338 3 if (entry.equalsIgnoreCase(v.getName())) {
- 339 1 remove = true ;
- 340 1 break ;
- 341
+ 336 13 if (hasCve() || hasCwe() || hasCvssBelow()) {
+ 337 5 final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator();
+ 338 10 while (itr.hasNext()) {
+ 339 5 boolean remove = false ;
+ 340 5 final Vulnerability v = itr.next();
+ 341 5 for (String entry : this .cve) {
+ 342 3 if (entry.equalsIgnoreCase(v.getName())) {
+ 343 1 remove = true ;
+ 344 1 break ;
+ 345
}
- 342 2 }
- 343 5 if (!remove) {
- 344 4 for (String entry : this .cwe) {
- 345 1 if (v.getCwe() != null ) {
- 346 1 final String toMatch = String.format("CWE-%s " , entry);
- 347 1 final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase();
- 348 1 if (toTest.equals(toMatch)) {
- 349 1 remove = true ;
- 350 1 break ;
- 351
+ 346 2 }
+ 347 5 if (!remove) {
+ 348 4 for (String entry : this .cwe) {
+ 349 1 if (v.getCwe() != null ) {
+ 350 1 final String toMatch = String.format("CWE-%s " , entry);
+ 351 1 final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase();
+ 352 1 if (toTest.equals(toMatch)) {
+ 353 1 remove = true ;
+ 354 1 break ;
+ 355
}
- 352
+ 356
}
- 353 0 }
- 354
+ 357 0 }
+ 358
}
- 355 5 if (!remove) {
- 356 3 for (float cvss : this .cvssBelow) {
- 357 3 if (v.getCvssScore() < cvss) {
- 358 1 remove = true ;
- 359 1 break ;
- 360
+ 359 5 if (!remove) {
+ 360 3 for (float cvss : this .cvssBelow) {
+ 361 3 if (v.getCvssScore() < cvss) {
+ 362 1 remove = true ;
+ 363 1 break ;
+ 364
}
- 361 2 }
- 362
- }
- 363 5 if (remove) {
- 364 3 if (!isBase()) {
- 365 3 dependency.addSuppressedVulnerability(v);
+ 365 2 }
366
- }
- 367 3 itr.remove();
- 368
}
- 369 5 }
+ 367 5 if (remove) {
+ 368 3 if (!isBase()) {
+ 369 3 dependency.addSuppressedVulnerability(v);
370
- }
- 371 13 }
+ }
+ 371 3 itr.remove();
372
-
- 373
-
- 374
-
- 375
-
- 376
-
- 377
-
- 378
-
- 379
- boolean cpeHasNoVersion(PropertyType c) {
- 380 26 if (c.isRegex()) {
- 381 2 return false ;
- 382
- }
- 383 24 if (countCharacter(c.getValue(), ':' ) == 3) {
- 384 18 return true ;
- 385
- }
- 386 6 return false ;
- 387
- }
- 388
-
- 389
-
- 390
-
- 391
-
- 392
-
- 393
-
- 394
-
- 395
-
- 396
- int countCharacter(String str, char c) {
- 397 27 int count = 0;
- 398 27 int pos = str.indexOf(c) + 1;
- 399 111 while (pos > 0) {
- 400 84 count += 1;
- 401 84 pos = str.indexOf(c, pos) + 1;
- 402
- }
- 403 27 return count;
- 404
- }
- 405
-
- 406
-
- 407
-
- 408
-
- 409
-
- 410
-
- 411
-
- 412
-
- 413
-
- 414
- boolean identifierMatches(String identifierType, PropertyType suppressionEntry, Identifier identifier) {
- 415 52 if (identifierType.equals(identifier.getType())) {
- 416 29 if (suppressionEntry.matches(identifier.getValue())) {
- 417 5 return true ;
- 418 24 } else if ("cpe" .equals(identifierType) && cpeHasNoVersion(suppressionEntry)) {
- 419 17 if (suppressionEntry.isCaseSensitive()) {
- 420 0 return identifier.getValue().startsWith(suppressionEntry.getValue());
- 421
- } else {
- 422 17 final String id = identifier.getValue().toLowerCase();
- 423 17 final String check = suppressionEntry.getValue().toLowerCase();
- 424 17 return id.startsWith(check);
- 425
}
- 426
- }
- 427
+ 373 5 }
+ 374
}
- 428 30 return false ;
- 429
- }
- 430
+ 375 13 }
+ 376
- 431
+ 377
- 432
-
- 433
+ 378
+
+ 379
- 434
-
- 435
+ 380
+
+ 381
+
+ 382
- 436
- @Override
- 437
- public String toString() {
- 438 0 final StringBuilder sb = new StringBuilder();
- 439 0 sb.append("SuppressionRule{" );
- 440 0 if (filePath != null ) {
- 441 0 sb.append("filePath=" ).append(filePath).append("," );
- 442
+ 383
+ boolean cpeHasNoVersion(PropertyType c) {
+ 384 26 if (c.isRegex()) {
+ 385 2 return false ;
+ 386
}
- 443 0 if (sha1 != null ) {
- 444 0 sb.append("sha1=" ).append(sha1).append("," );
- 445
+ 387 24 if (countCharacter(c.getValue(), ':' ) == 3) {
+ 388 18 return true ;
+ 389
}
- 446 0 if (gav != null ) {
- 447 0 sb.append("gav=" ).append(gav).append("," );
- 448
- }
- 449 0 if (cpe != null && cpe.size() > 0) {
- 450 0 sb.append("cpe={" );
- 451 0 for (PropertyType pt : cpe) {
- 452 0 sb.append(pt).append("," );
- 453 0 }
- 454 0 sb.append("}" );
- 455
- }
- 456 0 if (cwe != null && cwe.size() > 0) {
- 457 0 sb.append("cwe={" );
- 458 0 for (String s : cwe) {
- 459 0 sb.append(s).append("," );
- 460 0 }
- 461 0 sb.append("}" );
- 462
- }
- 463 0 if (cve != null && cve.size() > 0) {
- 464 0 sb.append("cve={" );
- 465 0 for (String s : cve) {
- 466 0 sb.append(s).append("," );
- 467 0 }
- 468 0 sb.append("}" );
- 469
- }
- 470 0 if (cvssBelow != null && cvssBelow.size() > 0) {
- 471 0 sb.append("cvssBelow={" );
- 472 0 for (Float s : cvssBelow) {
- 473 0 sb.append(s).append("," );
- 474 0 }
- 475 0 sb.append("}" );
- 476
- }
- 477 0 sb.append("}" );
- 478 0 return sb.toString();
- 479
+ 390 6 return false ;
+ 391
}
+ 392
+
+ 393
+
+ 394
+
+ 395
+
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400
+ int countCharacter(String str, char c) {
+ 401 27 int count = 0;
+ 402 27 int pos = str.indexOf(c) + 1;
+ 403 111 while (pos > 0) {
+ 404 84 count += 1;
+ 405 84 pos = str.indexOf(c, pos) + 1;
+ 406
+ }
+ 407 27 return count;
+ 408
+ }
+ 409
+
+ 410
+
+ 411
+
+ 412
+
+ 413
+
+ 414
+
+ 415
+
+ 416
+
+ 417
+
+ 418
+ boolean identifierMatches(String identifierType, PropertyType suppressionEntry, Identifier identifier) {
+ 419 88 if (identifierType.equals(identifier.getType())) {
+ 420 53 if (suppressionEntry.matches(identifier.getValue())) {
+ 421 5 return true ;
+ 422 48 } else if ("cpe" .equals(identifierType) && cpeHasNoVersion(suppressionEntry)) {
+ 423 17 if (suppressionEntry.isCaseSensitive()) {
+ 424 0 return identifier.getValue().startsWith(suppressionEntry.getValue());
+ 425
+ } else {
+ 426 17 final String id = identifier.getValue().toLowerCase();
+ 427 17 final String check = suppressionEntry.getValue().toLowerCase();
+ 428 17 return id.startsWith(check);
+ 429
+ }
+ 430
+ }
+ 431
+ }
+ 432 66 return false ;
+ 433
+ }
+ 434
+
+ 435
+
+ 436
+
+ 437
+
+ 438
+
+ 439
+
+ 440
+ @Override
+ 441
+ public String toString() {
+ 442 0 final StringBuilder sb = new StringBuilder();
+ 443 0 sb.append("SuppressionRule{" );
+ 444 0 if (filePath != null ) {
+ 445 0 sb.append("filePath=" ).append(filePath).append("," );
+ 446
+ }
+ 447 0 if (sha1 != null ) {
+ 448 0 sb.append("sha1=" ).append(sha1).append("," );
+ 449
+ }
+ 450 0 if (gav != null ) {
+ 451 0 sb.append("gav=" ).append(gav).append("," );
+ 452
+ }
+ 453 0 if (cpe != null && cpe.size() > 0) {
+ 454 0 sb.append("cpe={" );
+ 455 0 for (PropertyType pt : cpe) {
+ 456 0 sb.append(pt).append("," );
+ 457 0 }
+ 458 0 sb.append("}" );
+ 459
+ }
+ 460 0 if (cwe != null && cwe.size() > 0) {
+ 461 0 sb.append("cwe={" );
+ 462 0 for (String s : cwe) {
+ 463 0 sb.append(s).append("," );
+ 464 0 }
+ 465 0 sb.append("}" );
+ 466
+ }
+ 467 0 if (cve != null && cve.size() > 0) {
+ 468 0 sb.append("cve={" );
+ 469 0 for (String s : cve) {
+ 470 0 sb.append(s).append("," );
+ 471 0 }
+ 472 0 sb.append("}" );
+ 473
+ }
+ 474 0 if (cvssBelow != null && cvssBelow.size() > 0) {
+ 475 0 sb.append("cvssBelow={" );
+ 476 0 for (Float s : cvssBelow) {
+ 477 0 sb.append(s).append("," );
+ 478 0 }
+ 479 0 sb.append("}" );
480
+ }
+ 481 0 sb.append("}" );
+ 482 0 return sb.toString();
+ 483
+ }
+ 484
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
index c2eccb063..7f2d5c582 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DBUtils.html
@@ -12,7 +12,7 @@
@@ -125,69 +125,72 @@
55
try {
56 0 rs = statement.getGeneratedKeys();
- 57 0 rs.next();
- 58 0 id = rs.getInt(1);
- 59 0 } catch (SQLException ex) {
- 60 0 throw new DatabaseException("Unable to get primary key for inserted row" );
- 61
+ 57 0 if (!rs.next()) {
+ 58 0 throw new DatabaseException("Unable to get primary key for inserted row" );
+ 59
+ }
+ 60 0 id = rs.getInt(1);
+ 61 0 } catch (SQLException ex) {
+ 62 0 throw new DatabaseException("Unable to get primary key for inserted row" );
+ 63
} finally {
- 62 0 closeResultSet(rs);
- 63 0 }
- 64 0 return id;
- 65
- }
- 66
-
+ 64 0 closeResultSet(rs);
+ 65 0 }
+ 66 0 return id;
67
-
+ }
68
-
- 69
-
- 70
-
- 71
-
- 72
- public static void closeStatement(Statement statement) {
- 73 33 if (statement != null ) {
- 74
- try {
- 75 33 statement.close();
- 76 0 } catch (SQLException ex) {
- 77 0 LOGGER.log(Level.FINEST, statement.toString(), ex);
- 78 33 }
- 79
- }
- 80 33 }
- 81
- 82
+ 69
- 83
-
- 84
+ 70
+
+ 71
- 85
-
- 86
+ 72
+
+ 73
- 87
- public static void closeResultSet(ResultSet rs) {
- 88 35 if (rs != null ) {
- 89
+ 74
+ public static void closeStatement(Statement statement) {
+ 75 33 if (statement != null ) {
+ 76
try {
- 90 35 rs.close();
- 91 0 } catch (SQLException ex) {
- 92 0 LOGGER.log(Level.FINEST, rs.toString(), ex);
- 93 35 }
- 94
+ 77 33 statement.close();
+ 78 0 } catch (SQLException ex) {
+ 79 0 LOGGER.log(Level.FINEST, statement.toString(), ex);
+ 80 33 }
+ 81
}
- 95 35 }
+ 82 33 }
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+ public static void closeResultSet(ResultSet rs) {
+ 90 35 if (rs != null ) {
+ 91
+ try {
+ 92 35 rs.close();
+ 93 0 } catch (SQLException ex) {
+ 94 0 LOGGER.log(Level.FINEST, rs.toString(), ex);
+ 95 35 }
96
+ }
+ 97 35 }
+ 98
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
index 74f8d8e8d..b7dcec6be 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersion.html
@@ -12,7 +12,7 @@
@@ -124,9 +124,9 @@
54
- 55 402 public DependencyVersion(String version) {
- 56 402 parseVersion(version);
- 57 402 }
+ 55 488 public DependencyVersion(String version) {
+ 56 488 parseVersion(version);
+ 57 488 }
58
59
@@ -143,21 +143,21 @@
65
public final void parseVersion(String version) {
- 66 404 versionParts = new ArrayList<String>();
- 67 404 if (version != null ) {
- 68 404 final Pattern rx = Pattern.compile("(\\d+|[a-z]+\\d+|(release|beta|alpha)$)" );
- 69 404 final Matcher matcher = rx.matcher(version.toLowerCase());
- 70 1687 while (matcher.find()) {
- 71 1283 versionParts.add(matcher.group());
+ 66 490 versionParts = new ArrayList<String>();
+ 67 490 if (version != null ) {
+ 68 490 final Pattern rx = Pattern.compile("(\\d+[a-z]{1,3}$|[a-z]+\\d+|\\d+|(release|beta|alpha)$)" );
+ 69 490 final Matcher matcher = rx.matcher(version.toLowerCase());
+ 70 2053 while (matcher.find()) {
+ 71 1563 versionParts.add(matcher.group());
72
}
- 73 404 if (versionParts.isEmpty()) {
+ 73 490 if (versionParts.isEmpty()) {
74 4 versionParts.add(version);
75
}
76
}
- 77 404 }
+ 77 490 }
78
79
@@ -235,7 +235,7 @@
@Override
116
public String toString() {
- 117 83 return StringUtils.join(versionParts.toArray(), "." );
+ 117 85 return StringUtils.join(versionParts.toArray(), "." );
118
}
119
@@ -256,30 +256,30 @@
@Override
127
public boolean equals(Object obj) {
- 128 353 if (obj == null ) {
+ 128 431 if (obj == null ) {
129 0 return false ;
130
}
- 131 353 if (getClass() != obj.getClass()) {
+ 131 431 if (getClass() != obj.getClass()) {
132 0 return false ;
133
}
- 134 353 final DependencyVersion other = (DependencyVersion) obj;
- 135 353 final int max = (this .versionParts.size() < other.versionParts.size())
+ 134 431 final DependencyVersion other = (DependencyVersion) obj;
+ 135 431 final int max = (this .versionParts.size() < other.versionParts.size())
136
? this .versionParts.size() : other.versionParts.size();
137
- 138 767 for (int i = 0; i < max; i++) {
- 139 678 final String thisPart = this .versionParts.get(i);
- 140 678 final String otherPart = other.versionParts.get(i);
- 141 678 if (!thisPart.equals(otherPart)) {
- 142 264 return false ;
+ 138 936 for (int i = 0; i < max; i++) {
+ 139 829 final String thisPart = this .versionParts.get(i);
+ 140 829 final String otherPart = other.versionParts.get(i);
+ 141 829 if (!thisPart.equals(otherPart)) {
+ 142 324 return false ;
143
}
144
}
- 145 89 if (this .versionParts.size() > max) {
+ 145 107 if (this .versionParts.size() > max) {
146 0 for (int i = max; i < this .versionParts.size(); i++) {
147 0 if (!"0" .equals(this .versionParts.get(i))) {
148 0 return false ;
@@ -291,10 +291,10 @@
}
152
- 153 89 if (other.versionParts.size() > max) {
- 154 65 for (int i = max; i < other.versionParts.size(); i++) {
- 155 65 if (!"0" .equals(other.versionParts.get(i))) {
- 156 65 return false ;
+ 153 107 if (other.versionParts.size() > max) {
+ 154 81 for (int i = max; i < other.versionParts.size(); i++) {
+ 155 81 if (!"0" .equals(other.versionParts.get(i))) {
+ 156 81 return false ;
157
}
158
@@ -313,7 +313,7 @@
165
- 166 24 return true ;
+ 166 26 return true ;
167
}
168
@@ -355,41 +355,41 @@
188
public boolean matchesAtLeastThreeLevels(DependencyVersion version) {
- 189 304 if (version == null ) {
+ 189 379 if (version == null ) {
190 0 return false ;
191
}
- 192 304 if (Math.abs(this .versionParts.size() - version.versionParts.size()) >= 3) {
+ 192 379 if (Math.abs(this .versionParts.size() - version.versionParts.size()) >= 3) {
193 1 return false ;
194
}
195
- 196 303 final int max = (this .versionParts.size() < version.versionParts.size())
+ 196 378 final int max = (this .versionParts.size() < version.versionParts.size())
197
? this .versionParts.size() : version.versionParts.size();
198
- 199 303 boolean ret = true ;
- 200 652 for (int i = 0; i < max; i++) {
- 201 586 String thisVersion = this .versionParts.get(i);
- 202 586 String otherVersion = version.getVersionParts().get(i);
- 203 586 if (i >= 3) {
+ 199 378 boolean ret = true ;
+ 200 812 for (int i = 0; i < max; i++) {
+ 201 730 final String thisVersion = this .versionParts.get(i);
+ 202 730 final String otherVersion = version.getVersionParts().get(i);
+ 203 730 if (i >= 3) {
204 2 if (thisVersion.compareToIgnoreCase(otherVersion) >= 0) {
205 1 ret = false ;
206 1 break ;
207
}
- 208 584 } else if (!thisVersion.equals(otherVersion)) {
- 209 236 ret = false ;
- 210 236 break ;
+ 208 728 } else if (!thisVersion.equals(otherVersion)) {
+ 209 295 ret = false ;
+ 210 295 break ;
211
}
212
}
213
- 214 303 return ret;
+ 214 378 return ret;
215
}
216
@@ -398,25 +398,25 @@
@Override
218
public int compareTo(DependencyVersion version) {
- 219 19 if (version == null ) {
+ 219 22 if (version == null ) {
220 0 return 1;
221
}
- 222 19 final List<String> left = this .getVersionParts();
- 223 19 final List<String> right = version.getVersionParts();
- 224 19 final int max = left.size() < right.size() ? left.size() : right.size();
+ 222 22 final List<String> left = this .getVersionParts();
+ 223 22 final List<String> right = version.getVersionParts();
+ 224 22 final int max = left.size() < right.size() ? left.size() : right.size();
225
- 226 45 for (int i = 0; i < max; i++) {
- 227 38 final String lStr = left.get(i);
- 228 38 final String rStr = right.get(i);
- 229 38 if (lStr.equals(rStr)) {
- 230 26 continue ;
+ 226 55 for (int i = 0; i < max; i++) {
+ 227 47 final String lStr = left.get(i);
+ 228 47 final String rStr = right.get(i);
+ 229 47 if (lStr.equals(rStr)) {
+ 230 33 continue ;
231
}
232
try {
- 233 12 final int l = Integer.parseInt(lStr);
+ 233 14 final int l = Integer.parseInt(lStr);
234 7 final int r = Integer.parseInt(rStr);
235 7 if (l < r) {
236 5 return -1;
@@ -424,24 +424,24 @@
238 2 return 1;
239
}
- 240 5 } catch (NumberFormatException ex) {
- 241 5 final int comp = left.get(i).compareTo(right.get(i));
- 242 5 if (comp < 0) {
- 243 5 return -1;
- 244 0 } else if (comp > 0) {
- 245 0 return 1;
+ 240 7 } catch (NumberFormatException ex) {
+ 241 7 final int comp = left.get(i).compareTo(right.get(i));
+ 242 7 if (comp < 0) {
+ 243 6 return -1;
+ 244 1 } else if (comp > 0) {
+ 245 1 return 1;
246
}
247 0 }
248
}
- 249 7 if (left.size() < right.size()) {
+ 249 8 if (left.size() < right.size()) {
250 3 return -1;
- 251 4 } else if (left.size() > right.size()) {
+ 251 5 } else if (left.size() > right.size()) {
252 3 return 1;
253
} else {
- 254 1 return 0;
+ 254 2 return 0;
255
}
256
@@ -450,6 +450,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
index 383d9600d..afdeb2940 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.DependencyVersionUtil.html
@@ -85,7 +85,7 @@
34
- 35 1 private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha)|[a-zA-Z_-]{1,3}\\d{1,8}))?" );
+ 35 1 private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha|\\d+)|[a-zA-Z_-]{1,3}\\d{0,8}))?" );
36
37
@@ -131,13 +131,13 @@
58
public static DependencyVersion parseVersion(String text) {
- 59 375 if (text == null ) {
+ 59 457 if (text == null ) {
60 0 return null ;
61
}
62
- 63 375 if ("-" .equals(text)) {
+ 63 457 if ("-" .equals(text)) {
64 1 final DependencyVersion dv = new DependencyVersion();
65 1 final ArrayList<String> list = new ArrayList<String>();
66 1 list.add(text);
@@ -145,19 +145,19 @@
68 1 return dv;
69
}
- 70 374 String version = null ;
- 71 374 Matcher matcher = RX_VERSION.matcher(text);
- 72 374 if (matcher.find()) {
- 73 370 version = matcher.group();
+ 70 456 String version = null ;
+ 71 456 Matcher matcher = RX_VERSION.matcher(text);
+ 72 456 if (matcher.find()) {
+ 73 452 version = matcher.group();
74
}
75
- 76 374 if (matcher.find()) {
+ 76 456 if (matcher.find()) {
77 2 return null ;
78
}
- 79 372 if (version == null ) {
+ 79 454 if (version == null ) {
80 4 matcher = RX_SINGLE_VERSION.matcher(text);
81 4 if (matcher.find()) {
82 2 version = matcher.group();
@@ -174,13 +174,13 @@
}
90
}
- 91 369 return new DependencyVersion(version);
+ 91 451 return new DependencyVersion(version);
92
}
93
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
index 2c0e9f017..20462296d 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.ExtractionUtil.html
@@ -258,6 +258,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
index 64378d995..a2d3bdc34 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Filter.html
@@ -95,20 +95,20 @@
42
public boolean hasNext() {
- 43 359 return next != null ;
+ 43 412 return next != null ;
44
}
45
46
public T next() {
- 47 309 if (next == null ) {
+ 47 362 if (next == null ) {
48 0 throw new NoSuchElementException();
49
}
- 50 309 T returnValue = next;
- 51 309 toNext();
- 52 309 return returnValue;
+ 50 362 T returnValue = next;
+ 51 362 toNext();
+ 52 362 return returnValue;
53
}
54
@@ -122,22 +122,22 @@
59
private void toNext() {
- 60 387 next = null ;
- 61 659 while (iterator.hasNext()) {
- 62 608 T item = iterator.next();
- 63 608 if (item != null && passes(item)) {
- 64 336 next = item;
- 65 336 break ;
+ 60 440 next = null ;
+ 61 722 while (iterator.hasNext()) {
+ 62 671 T item = iterator.next();
+ 63 671 if (item != null && passes(item)) {
+ 64 389 next = item;
+ 65 389 break ;
66
}
- 67 272 }
- 68 387 }
+ 67 282 }
+ 68 440 }
69
}
70
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
index baecdc637..19aa78201 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.NonClosingStream.html
@@ -112,6 +112,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
index 49247e8b3..b427d0313 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.Pair.html
@@ -259,6 +259,6 @@
}
-
+
diff --git a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
index 7223e3f0e..add04d621 100644
--- a/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
+++ b/dependency-check-core/cobertura/org.owasp.dependencycheck.utils.UrlStringUtils.html
@@ -125,7 +125,7 @@
55
public static boolean containsUrl(String text) {
- 56 21961 return CONTAINS_URL_TEST.matcher(text).matches();
+ 56 13495 return CONTAINS_URL_TEST.matcher(text).matches();
57
}
58
@@ -222,6 +222,6 @@
}
-
+
diff --git a/dependency-check-core/cpd.html b/dependency-check-core/cpd.html
index 1d0595d69..59f9717fd 100644
--- a/dependency-check-core/cpd.html
+++ b/dependency-check-core/cpd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - CPD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -251,7 +251,7 @@
165
org\owasp\dependencycheck\analyzer\JarAnalyzer.java
-986
+1036
@Override
diff --git a/dependency-check-core/dependency-updates-report.html b/dependency-check-core/dependency-updates-report.html
index 72f1c82fb..859262736 100644
--- a/dependency-check-core/dependency-updates-report.html
+++ b/dependency-check-core/dependency-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Dependency Updates Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2014-09-16
+
| Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -244,7 +244,7 @@
# of dependencies using the latest version available
-8
+
5
# of dependencies where the next version available is smaller than an incremental version update
@@ -256,7 +256,7 @@
# of dependencies where the next version available is a minor version update
-11
+13
# of dependencies where the next version available is a major version update
@@ -292,7 +292,7 @@
3.0.0
-
+
com.google.inject
guice
3.0
@@ -301,7 +301,7 @@
jar
-
+4.0-beta
@@ -412,7 +412,7 @@
1.5
-
+
org.apache.commons
commons-compress
1.8.1
@@ -421,7 +421,7 @@
jar
-
+1.9
@@ -532,18 +532,6 @@
-
-org.apache.velocity
-velocity-tools
-2.0
-compile
-
-jar
-
-
-
-
-
org.dojotoolkit
dojo-war
@@ -555,7 +543,7 @@
1.3.1
1.4.2
-
+
org.glassfish.main.admingui
war
@@ -567,7 +555,7 @@
4.1
-
+
org.jsoup
jsoup
@@ -577,9 +565,9 @@
jar
1.7.3
-
+1.8.1
-
+
org.mortbay.jetty
jetty
@@ -591,11 +579,11 @@
6.1.17
-
+
org.owasp
dependency-check-utils
-1.2.5
+1.2.6
compile
jar
@@ -603,7 +591,7 @@
-
+
org.springframework
spring-webmvc
@@ -615,7 +603,7 @@
2.5.6
3.0.0.RELEASE
-
+
org.springframework.retry
spring-retry
@@ -627,7 +615,7 @@
1.1.1.RELEASE
-
+
org.springframework.security
spring-security-web
@@ -639,7 +627,7 @@
3.0.1.RELEASE
-
+
Status
Group Id
Artifact Id
@@ -657,28 +645,28 @@
com.google.code.findbugs:annotations
-
+
Status
There is at least one newer incremental version available. Incremental updates are typically passive.
-
+
Group Id
com.google.code.findbugs
-
+
Artifact Id
annotations
-
+
Current Version
2.0.1
-
+
Scope
compile
-
+
Classifier
-
+
Type
jar
-
+
Newer versions
2.0.2 Next Incremental 2.0.3 Latest Incremental 3.0.0 Next Major
@@ -686,7 +674,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
com.google.inject
@@ -704,7 +692,10 @@
Type
-jar
+jar
+
+Newer versions
+4.0-beta Next Minor 4.0-beta44.0-beta5 Latest Minor
com.h2database:h2
@@ -731,7 +722,7 @@
jar
Newer versions
-1.3.173 Next Incremental 1.3.174 1.3.1751.3.176 Latest Incremental 1.4.177 Next Minor 1.4.178 1.4.179 1.4.1801.4.181 Latest Minor
+1.3.173 Next Incremental 1.3.174 1.3.1751.3.176 Latest Incremental 1.4.177 Next Minor 1.4.178 1.4.179 1.4.180 1.4.1811.4.182 Latest Minor
com.hazelcast:hazelcast
@@ -758,7 +749,7 @@
jar
Newer versions
-2.5.1 Next Incremental 2.6 Next Minor 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 3.0-RC13.0-RC2 Latest Minor 3.0 Next Major 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2-RC1 3.2-RC2 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3-RC1 3.3-RC2 3.3-RC3 3.3 3.3-EA3.3-EA2 Latest Major
+2.5.1 Next Incremental 2.6 Next Minor 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 3.0-RC13.0-RC2 Latest Minor 3.0 Next Major 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2-RC1 3.2-RC2 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3-RC1 3.3-RC2 3.3-RC3 3.3 3.3-EA 3.3-EA2 3.3.1 3.3.2 3.3.33.4-EA Latest Major
commons-cli:commons-cli
@@ -860,7 +851,7 @@
jar
Newer versions
-4.12-beta-1 Next Incremental
+4.12-beta-1 Next Incremental 4.12-beta-24.12-beta-3 Latest Incremental
net.sf.ehcache:ehcache-core
@@ -947,7 +938,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.commons
@@ -965,7 +956,10 @@
Type
-jar
+jar
+
+Newer versions
+1.9 Next Minor
org.apache.geronimo.daytrader:daytrader-ear
@@ -1016,7 +1010,7 @@
jar
Newer versions
-4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.04.10.0 Latest Minor
+4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.0 4.9.1 4.10.0 4.10.14.10.2 Latest Minor
org.apache.lucene:lucene-core
@@ -1043,7 +1037,7 @@
jar
Newer versions
-4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.04.10.0 Latest Minor
+4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.0 4.9.1 4.10.0 4.10.14.10.2 Latest Minor
org.apache.lucene:lucene-queryparser
@@ -1070,7 +1064,7 @@
jar
Newer versions
-4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.04.10.0 Latest Minor
+4.6.0 Next Minor 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.0 4.9.1 4.10.0 4.10.14.10.2 Latest Minor
org.apache.lucene:lucene-test-framework
@@ -1097,7 +1091,7 @@
jar
Newer versions
-4.4.0 Next Minor 4.5.0 4.5.1 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.04.10.0 Latest Minor
+4.4.0 Next Minor 4.5.0 4.5.1 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.9.0 4.9.1 4.10.0 4.10.14.10.2 Latest Minor
org.apache.maven.scm:maven-scm-provider-cvsexe
@@ -1124,7 +1118,7 @@
jar
Newer versions
-1.9 Next Minor 1.9.1 Latest Minor
+1.9 Next Minor 1.9.11.9.2 Latest Minor
org.apache.openjpa:openjpa
@@ -1204,30 +1198,6 @@
Type
jar
-
org.apache.velocity:velocity-tools
-
-
-Status
- No newer versions available.
-
-Group Id
-org.apache.velocity
-
-Artifact Id
-velocity-tools
-
-Current Version
-2.0
-
-Scope
-compile
-
-Classifier
-
-
-Type
-jar
-
org.dojotoolkit:dojo-war
@@ -1253,7 +1223,7 @@
war
Newer versions
-1.3.1 Next Incremental 1.3.2 Latest Incremental 1.4.2 Next Minor 1.4.3 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0b2 1.9.0 1.9.1 1.9.2 1.9.31.10.0 Latest Minor
+1.3.1 Next Incremental 1.3.2 Latest Incremental 1.4.2 Next Minor 1.4.3 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0b2 1.9.0 1.9.1 1.9.2 1.9.3 1.10.0 1.10.11.10.2 Latest Minor
org.glassfish.main.admingui:war
@@ -1307,7 +1277,7 @@
jar
Newer versions
-1.7.3 Next Incremental
+1.7.3 Next Incremental 1.8.1 Next Minor
org.mortbay.jetty:jetty
@@ -1349,7 +1319,7 @@
dependency-check-utils
Current Version
-1.2.5
+1.2.6
Scope
compile
@@ -1385,7 +1355,7 @@
jar
Newer versions
-2.5.6 Next Incremental 2.5.6.SEC01 2.5.6.SEC022.5.6.SEC03 Latest Incremental 3.0.0.RELEASE Next Major 3.0.1.RELEASE 3.0.2.RELEASE 3.0.3.RELEASE 3.0.4.RELEASE 3.0.5.RELEASE 3.0.6.RELEASE 3.0.7.RELEASE 3.1.0.RELEASE 3.1.1.RELEASE 3.1.2.RELEASE 3.2.0.RELEASE 3.2.1.RELEASE 3.2.2.RELEASE 3.2.3.RELEASE 3.2.4.RELEASE 3.2.5.RELEASE 3.2.6.RELEASE 3.2.7.RELEASE 3.2.8.RELEASE 3.2.9.RELEASE 3.2.10.RELEASE 3.2.11.RELEASE 4.0.0.RELEASE 4.0.1.RELEASE 4.0.2.RELEASE 4.0.3.RELEASE 4.0.4.RELEASE 4.0.5.RELEASE 4.0.6.RELEASE 4.0.7.RELEASE4.1.0.RELEASE Latest Major
+2.5.6 Next Incremental 2.5.6.SEC01 2.5.6.SEC022.5.6.SEC03 Latest Incremental 3.0.0.RELEASE Next Major 3.0.1.RELEASE 3.0.2.RELEASE 3.0.3.RELEASE 3.0.4.RELEASE 3.0.5.RELEASE 3.0.6.RELEASE 3.0.7.RELEASE 3.1.0.RELEASE 3.1.1.RELEASE 3.1.2.RELEASE 3.2.0.RELEASE 3.2.1.RELEASE 3.2.2.RELEASE 3.2.3.RELEASE 3.2.4.RELEASE 3.2.5.RELEASE 3.2.6.RELEASE 3.2.7.RELEASE 3.2.8.RELEASE 3.2.9.RELEASE 3.2.10.RELEASE 3.2.11.RELEASE 3.2.12.RELEASE 4.0.0.RELEASE 4.0.1.RELEASE 4.0.2.RELEASE 4.0.3.RELEASE 4.0.4.RELEASE 4.0.5.RELEASE 4.0.6.RELEASE 4.0.7.RELEASE 4.0.8.RELEASE 4.1.0.RELEASE 4.1.1.RELEASE4.1.2.RELEASE Latest Major
org.springframework.retry:spring-retry
@@ -1412,7 +1382,7 @@
jar
Newer versions
-1.1.1.RELEASE Next Major
+1.1.1.RELEASE Next Major 1.1.2.RELEASE Latest Major
org.springframework.security:spring-security-web
diff --git a/dependency-check-core/failsafe-report.html b/dependency-check-core/failsafe-report.html
index 01500cf46..286f851f4 100644
--- a/dependency-check-core/failsafe-report.html
+++ b/dependency-check-core/failsafe-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Surefire Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -268,12 +268,12 @@ function toggleDisplay(elementId) {
Success Rate
Time
-33
+34
0
0
0
100%
-214.202
+
172.021
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
org.owasp.dependencycheck
+35.85
org.owasp.dependencycheck.analyzer
+8.101
org.owasp.dependencycheck.data.update
@@ -429,7 +429,7 @@ function toggleDisplay(elementId) {
0
0
100%
-26.184
+27.313
StandardUpdateIntegrationTest
@@ -438,7 +438,7 @@ function toggleDisplay(elementId) {
0
0
100%
-30.571
+27.009
org.owasp.dependencycheck.data.nvdcve
+10.24
Test Cases
[Summary ] [Package List ] [Test Cases ]
@@ -478,15 +478,15 @@ function toggleDisplay(elementId) {
testAnalyzeTar
-6.076
+
8.089
testAnalyzeTgz
-13.247
+
15.088
testAnalyze
-1.312
+
2.446
testGetAnalysisPhase
@@ -494,19 +494,19 @@ function toggleDisplay(elementId) {
testGetName
-0.001
+
0
testAnalyze_badZip
-0.641
+
0.896
testInitialize
-0.001
+
0
testAnalyzeTarGz
-7.341
+
8.45
testSupportsExtension
@@ -514,33 +514,37 @@ function toggleDisplay(elementId) {
testGetSupportedExtensions
-0
+0.001
CPEAnalyzerIntegrationTest
testSearchCPE
-2.74
+3.169
testDetermineCPE
-3.227
+3.482
-testDetermineCPE_full
-2.907
+testDetermineIdentifiers
+2.096
+testDetermineCPE_full
+3.074
+
+
testBuildSearch
-0
+0.001
VulnerabilitySuppressionAnalyzerIntegrationTest
testAnalyze
-6.762
+8.101
testGetAnalysisPhase
@@ -555,78 +559,78 @@ function toggleDisplay(elementId) {
testOpen
-2.048
+2.343
-testGetCPEs
-1.496
+testIsAffected
+0.534
+testGetCPEs
+2.016
+
+
testGetVulnerabilities
-1.811
+1.783
DatabasePropertiesIntegrationTest
testSave
-3.94
+3.225
testGetProperty_String_String
-1.547
+1.625
testGetProperties
-1.625
+2.412
testGetProperty_String
-1.671
+1.511
testIsEmpty
-1.637
+1.467
NvdCveUpdaterIntegrationTest
testUpdate
-26.184
+27.313
StandardUpdateIntegrationTest
testOpenDataStores
-3.042
+2.458
testUpdatesNeeded
-25.95
+1.619
testWithinRange
-1.579
+22.932
EngineIntegrationTest
-testScan
-7.952
-
-
testEngine
-77.898
+35.85
ReportGeneratorIntegrationTest
testGenerateXMLReport
-11.567
+10.04
testGenerateReport
diff --git a/dependency-check-core/findbugs.html b/dependency-check-core/findbugs.html
index 84a69745d..21a2318ae 100644
--- a/dependency-check-core/findbugs.html
+++ b/dependency-check-core/findbugs.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - FindBugs Bug Detector Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -252,8 +252,8 @@
Errors
Missing Classes
-198
-8
+200
+11
0
0
+1
+
+org.owasp.dependencycheck.data.update.task.DownloadTask
+2
org.owasp.dependencycheck.Engine
+
+
org.owasp.dependencycheck.analyzer.ArchiveAnalyzer
+
+
+Bug
+Category
+Details
+Line
+Priority
+
+Redundant nullcheck of org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.tempFileLocation, which is known to be non-null in org.owasp.dependencycheck.analyzer.ArchiveAnalyzer.close()
+STYLE
+RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
+189
Medium
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer
@@ -314,7 +335,7 @@
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.initializeFileTypeAnalyzer() discards result of readLine after checking if it is nonnull
STYLE
RV_DONT_JUST_NULL_CHECK_READLINE
-
236
+
239
Medium
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
@@ -329,13 +350,13 @@
Possible null pointer dereference of currentVersion on branch that might be infeasible in org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.removeSpuriousCPE(Dependency)
STYLE
NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE
-
175
+
179
Medium
Possible null pointer dereference of nextVersion on branch that might be infeasible in org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.removeSpuriousCPE(Dependency)
STYLE
NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE
-175
+179
Medium
+High
+
+
org.owasp.dependencycheck.data.update.task.DownloadTask
+
+
+Bug
+Category
+Details
+Line
+Priority
+
+org.owasp.dependencycheck.data.update.task.DownloadTask.extractGzip(File) may fail to clean up java.io.OutputStream on checked exception
+EXPERIMENTAL
+OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE
+279
+Medium
+
+exceptional return value of java.io.File.delete() ignored in org.owasp.dependencycheck.data.update.task.DownloadTask.extractGzip(File)
+BAD_PRACTICE
+RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
+266
+Medium
diff --git a/dependency-check-core/index.html b/dependency-check-core/index.html
index e5bdb434c..56658985c 100644
--- a/dependency-check-core/index.html
+++ b/dependency-check-core/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - About
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-core/javancss.html b/dependency-check-core/javancss.html
index 8457915eb..1b218c092 100644
--- a/dependency-check-core/javancss.html
+++ b/dependency-check-core/javancss.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - JavaNCSS Metric Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -257,13 +257,13 @@
Multi lines comment
org.owasp.dependencycheck.analyzer
-23
-172
-2250
-189
-1278
-158
-654
+24
+185
+2382
+204
+1368
+160
+697
org.owasp.dependencycheck.jaxb.pom.generated
86
@@ -276,10 +276,10 @@
org.owasp.dependencycheck.dependency
14
-176
-811
-173
-1097
+177
+831
+174
+1104
17
231
@@ -295,16 +295,16 @@
org.owasp.dependencycheck.suppression
6
55
-402
+401
61
-379
+383
5
-154
+151
org.owasp.dependencycheck.utils
10
43
-348
+349
40
238
6
@@ -349,9 +349,9 @@
org.owasp.dependencycheck
1
22
-224
+241
22
-124
+133
6
48
@@ -366,17 +366,17 @@
org.owasp.dependencycheck.data.update.task
2
-17
-173
18
-132
+207
+19
+140
0
60
org.owasp.dependencycheck.reporting
3
14
-159
+169
17
118
2
@@ -400,15 +400,24 @@
0
85
+org.owasp.dependencycheck.data.central
+1
+2
+69
+3
+23
+8
+36
+
org.owasp.dependencycheck.data.cwe
2
5
-48
+49
6
29
1
53
-
+
org.owasp.dependencycheck.exception
2
8
@@ -417,7 +426,7 @@
48
0
50
-
+
org.owasp.dependencycheck.analyzer.exception
2
8
@@ -426,7 +435,7 @@
48
0
51
-
+
org.owasp.dependencycheck.data.update.exception
2
6
@@ -435,7 +444,7 @@
40
0
50
-
+
org.owasp.dependencycheck.jaxb.pom
1
4
@@ -445,7 +454,7 @@
0
30
-
+
Classes total
Methods total
NCSS total
@@ -453,49 +462,55 @@
Javadoc lines
Single lines comment
Multi lines comment
-
-195
-1361
-8617
-1505
-12585
-495
-2680
+
+197
+1378
+8900
+1525
+12726
+505
+2756
[ package ] [ object ] [ method ] [ explanation ]
TOP 30 classes containing the most NCSS.
-
+
Object
NCSS
Methods
Classes
Javadocs
-
-org.owasp.dependencycheck.analyzer.JarAnalyzer
-629
-30
-1
-36
+org.owasp.dependencycheck.analyzer.JarAnalyzer
+664
+31
+1
+37
+
org.owasp.dependencycheck.data.nvdcve.CveDB
406
20
0
21
-
+
org.owasp.dependencycheck.agent.DependencyCheckScanAgent
281
66
0
67
-
+
org.owasp.dependencycheck.analyzer.CPEAnalyzer
-263
+274
16
2
29
+
+org.owasp.dependencycheck.dependency.Dependency
+218
+51
+0
+52
org.owasp.dependencycheck.jaxb.pom.generated.Model
217
@@ -509,35 +524,35 @@
0
13
+org.owasp.dependencycheck.Engine
+211
+22
+0
+22
+
org.owasp.dependencycheck.data.update.xml.NvdCve20Handler
209
8
1
24
-
-org.owasp.dependencycheck.dependency.Dependency
-199
-50
-0
-51
-org.owasp.dependencycheck.Engine
-194
-22
-0
-22
-
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
179
13
0
-13
-
+14
+
org.owasp.dependencycheck.jaxb.pom.generated.ObjectFactory
175
87
0
88
+
+org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer
+173
+13
+0
+14
org.owasp.dependencycheck.suppression.SuppressionRule
167
@@ -545,53 +560,53 @@
0
31
-org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer
-157
-11
-0
-12
-
org.owasp.dependencycheck.data.update.StandardUpdate
143
8
0
9
-
+
org.owasp.dependencycheck.data.nvdcve.ConnectionFactory
138
7
0
8
-
+
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer
134
8
0
8
-
+
org.owasp.dependencycheck.dependency.EvidenceCollection
128
19
5
20
-
+
org.owasp.dependencycheck.dependency.VulnerableSoftware
117
19
0
20
-
+
org.owasp.dependencycheck.dependency.Vulnerability
108
36
0
35
-
+
org.owasp.dependencycheck.data.cpe.CpeMemoryIndex
107
14
0
15
+
+org.owasp.dependencycheck.data.update.task.DownloadTask
+106
+12
+0
+12
org.owasp.dependencycheck.dependency.Evidence
102
@@ -605,23 +620,23 @@
5
39
+org.owasp.dependencycheck.reporting.ReportGenerator
+98
+6
+1
+7
+
org.owasp.dependencycheck.utils.DependencyVersion
98
11
0
11
-
+
org.owasp.dependencycheck.jaxb.pom.generated.Profile
97
24
6
37
-
-org.owasp.dependencycheck.reporting.ReportGenerator
-88
-6
-1
-7
org.owasp.dependencycheck.data.update.xml.NvdCve12Handler
80
@@ -629,24 +644,18 @@
1
10
-org.owasp.dependencycheck.data.update.task.DownloadTask
-77
-11
-0
-11
-
org.owasp.dependencycheck.jaxb.pom.generated.Plugin
70
18
4
27
-
+
org.owasp.dependencycheck.suppression.SuppressionHandler
67
5
0
6
-
+
org.owasp.dependencycheck.jaxb.pom.generated.BuildBase
65
16
@@ -654,174 +663,180 @@
25
TOP 30 classes containing the most methods.
+
11
Averages.
-
+
NCSS average
Program NCSS
Classes average
Methods average
Javadocs average
-
-40.76
-8,617.00
+
+41.58
+8,900.00
0.32
-6.98
-8.17
+6.99
+8.19
[ package ] [ object ] [ method ] [ explanation ]
TOP 30 Methods containing the most NCSS.
-
+
Methods
NCSS
CCN
Javadocs
-
+
org.owasp.dependencycheck.analyzer.JarAnalyzer.parseManifest(Dependency,ClassNameInformation)
118
45
1
-
+
org.owasp.dependencycheck.data.nvdcve.CveDB.updateVulnerability(Vulnerability)
116
17
1
-
-org.owasp.dependencycheck.analyzer.JarAnalyzer.setPomEvidence(Dependency,Model,Properties,ClassNameInformation)
-87
-47
-1
+org.owasp.dependencycheck.analyzer.JarAnalyzer.setPomEvidence(Dependency,Model,Properties,ClassNameInformation)
+85
+45
+1
+
org.owasp.dependencycheck.data.update.xml.NvdCve20Handler.endElement(String,String,String)
71
27
0
-
+
org.owasp.dependencycheck.data.update.StandardUpdate.update()
62
25
1
-
+
org.owasp.dependencycheck.analyzer.CPEAnalyzer.determineIdentifiers(Dependency,String,String,Confidence)
60
23
1
-
+
org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.initialize()
60
25
1
+
+org.owasp.dependencycheck.analyzer.JarAnalyzer.analyzePOM(Dependency,ClassNameInformation,Engine)
+56
+16
+1
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer.initializeFileTypeAnalyzer()
55
@@ -961,30 +975,30 @@
12
1
-org.owasp.dependencycheck.analyzer.JarAnalyzer.analyzePOM(Dependency,ClassNameInformation,Engine)
-42
-11
-1
-
org.owasp.dependencycheck.data.update.StandardUpdate.updatesNeeded()
42
17
1
-
+
org.owasp.dependencycheck.reporting.ReportGenerator.generateReport(String,String)
41
16
1
-
+
org.owasp.dependencycheck.analyzer.JarAnalyzer.addDescription(Dependency,String,String,String)
40
11
1
-
+
org.owasp.dependencycheck.data.update.xml.NvdCve12Handler.startElement(String,String,String,Attributes)
40
14
0
+
+org.owasp.dependencycheck.data.central.CentralSearch.searchSha1(String)
+38
+13
+1
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer.removeSpuriousCPE(Dependency)
35
@@ -1006,27 +1020,22 @@
14
1
-org.owasp.dependencycheck.utils.DependencyVersion.compareTo(DependencyVersion)
+org.owasp.dependencycheck.data.update.task.DownloadTask.call()
32
-19
-0
-
-org.owasp.dependencycheck.suppression.SuppressionRule.toString()
-31
-16
-1
+
10
+
0
Averages.
-
+
Program NCSS
NCSS average
CCN average
Javadocs average
-
-8,617.00
-4.87
-2.36
+
+8,900.00
+4.97
+2.39
0.97
@@ -1035,46 +1044,46 @@
Statements for JavaNCSS are not statements as specified in the Java Language Specification but include all kinds of declarations too. Roughly spoken, NCSS is approximately equivalent to counting ';' and '{' characters in Java source files.
Not counted are empty statements, empty blocks or semicolons after closing brackets. Of course, comments don't get counted too. Closing brackets also never get counted, the same applies to blocks in general.
-
+
Examples
-
+
Package declaration
package java.lang;
-
+
Import declaration
import java.awt.*;
-
+
Class declaration
public class Foo {
public class Foo extends Bla {
-
+
Interface declaration
public interface Able ; {
-
+
Field declaration
int a;
int a, b, c = 5, d = 6;
-
+
Method declaration
public void cry();
public void gib() throws DeadException {
-
+
Constructor declaration
public Foo() {
-
+
Constructor invocation
-
+
Statement declaration
@@ -1084,7 +1093,7 @@
if (3 == 4);
if (4 == 4) { ;
} else {
-
+
Label declaration
fine :
In some cases consecutive semicolons are illegal according to the JLS but JavaNCSS still tolerates them (thought JavaNCSS is still more strict as 'javac'). Nevertheless they are never counted as two statements.
diff --git a/dependency-check-core/license.html b/dependency-check-core/license.html
index 8df58a9e6..f84d09fa2 100644
--- a/dependency-check-core/license.html
+++ b/dependency-check-core/license.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Project License
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2014-09-16
+
| Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-core/plugin-updates-report.html b/dependency-check-core/plugin-updates-report.html
index 11ccb82b7..e88deb03f 100644
--- a/dependency-check-core/plugin-updates-report.html
+++ b/dependency-check-core/plugin-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Plugin Updates Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2014-09-16
+
| Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -244,7 +244,7 @@
# of plugins using the latest version available
-6
+
1
# of plugins where the next version available is smaller than an incremental version update
@@ -256,7 +256,7 @@
# of plugins where the next version available is a minor version update
-8
+
13
# of plugins where the next version available is a major version update
@@ -342,13 +342,13 @@
Next Major
Dependency status
-
+
com.github.github
site-maven-plugin
-0.9
-
+0.9
+0.10
@@ -362,13 +362,13 @@
-
+
org.apache.maven.plugins
maven-compiler-plugin
-3.1
-
+3.1
+3.2
@@ -382,13 +382,13 @@
-
+
org.apache.maven.plugins
maven-failsafe-plugin
-2.16
-
+2.16
+2.17
@@ -402,13 +402,13 @@
-
+
org.apache.maven.plugins
maven-jar-plugin
-2.4
-
+2.4
+2.5
@@ -432,13 +432,13 @@
-
+
org.apache.maven.plugins
maven-surefire-plugin
-2.16
-
+2.16
+2.17
@@ -469,7 +469,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
com.github.github
@@ -478,7 +478,10 @@
site-maven-plugin
Current Version
-0.9
+0.9
+
+Newer versions
+0.10 Next Minor
Plugin org.apache.maven.plugins:maven-antrun-plugin
@@ -514,7 +517,7 @@
2.2-beta-5
Newer versions
-2.2 Next Version 2.2.1 Next Incremental 2.2.2 Latest Incremental 2.3 Next Minor 2.4 Latest Minor
+2.2 Next Version 2.2.1 Next Incremental 2.2.2 Latest Incremental 2.3 Next Minor 2.4 2.4.1 2.52.5.1 Latest Minor
Plugin org.apache.maven.plugins:maven-clean-plugin
@@ -532,13 +535,13 @@
2.4.1
Newer versions
-2.5 Next Minor
+2.5 Next Minor 2.62.6.1 Latest Minor
Plugin org.apache.maven.plugins:maven-compiler-plugin
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -547,7 +550,10 @@
maven-compiler-plugin
Current Version
-3.1
+3.1
+
+Newer versions
+3.2 Next Minor
Plugin org.apache.maven.plugins:maven-dependency-plugin
@@ -565,7 +571,7 @@
2.1
Newer versions
-2.2 Next Minor 2.3 2.4 2.5 2.5.1 2.6 2.72.8 Latest Minor
+2.2 Next Minor 2.3 2.4 2.5 2.5.1 2.6 2.7 2.82.9 Latest Minor
Plugin org.apache.maven.plugins:maven-deploy-plugin
@@ -583,13 +589,13 @@
2.7
Newer versions
-2.8 Next Minor 2.8.1 Latest Minor
+2.8 Next Minor 2.8.12.8.2 Latest Minor
Plugin org.apache.maven.plugins:maven-failsafe-plugin
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -598,7 +604,10 @@
maven-failsafe-plugin
Current Version
-2.16
+2.16
+
+Newer versions
+2.17 Next Minor 2.18 Latest Minor
Plugin org.apache.maven.plugins:maven-install-plugin
@@ -616,13 +625,13 @@
2.3.1
Newer versions
-2.4 Next Minor 2.52.5.1 Latest Minor
+2.4 Next Minor 2.5 2.5.12.5.2 Latest Minor
Plugin org.apache.maven.plugins:maven-jar-plugin
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -631,7 +640,10 @@
maven-jar-plugin
Current Version
-2.4
+2.4
+
+Newer versions
+2.5 Next Minor
Plugin org.apache.maven.plugins:maven-release-plugin
@@ -649,7 +661,7 @@
2.0
Newer versions
-2.1 Next Minor 2.2 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.12.4.2 Latest Minor
+2.1 Next Minor 2.2 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.52.5.1 Latest Minor
Plugin org.apache.maven.plugins:maven-resources-plugin
@@ -667,7 +679,7 @@
2.5
Newer versions
-2.6 Next Minor
+2.6 Next Minor 2.7 Latest Minor
Plugin org.apache.maven.plugins:maven-site-plugin
@@ -751,7 +763,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -760,7 +772,10 @@
maven-surefire-plugin
Current Version
-2.16
+2.16
+
+Newer versions
+2.17 Next Minor 2.18 Latest Minor
Plugin org.codehaus.mojo:cobertura-maven-plugin
diff --git a/dependency-check-core/pmd.html b/dependency-check-core/pmd.html
index 734676cae..6abdd8c17 100644
--- a/dependency-check-core/pmd.html
+++ b/dependency-check-core/pmd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - PMD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -250,10 +250,10 @@
Line
These nested if statements could be combined
-362–365
+361–364
These nested if statements could be combined
-376–379
+375–378
org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java
@@ -262,7 +262,7 @@
Line
Avoid empty while statements
-236–238
+239–241
org/owasp/dependencycheck/analyzer/CPEAnalyzer.java
@@ -271,215 +271,221 @@
Line
Useless parentheses.
-219
-
-Avoid unused method parameters such as 'currentConfidence'.
-495
-
-These nested if statements could be combined
-530–535
+221
These nested if statements could be combined
-531–534
+541–546
These nested if statements could be combined
-540–543
+542–545
+
+These nested if statements could be combined
+551–554
org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
-
+
Violation
Line
-
+
These nested if statements could be combined
228–230
org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.java
-
+
Violation
Line
-
-These nested if statements could be combined
-100–106
These nested if statements could be combined
-164–184
+105–111
+
+These nested if statements could be combined
+168–188
org/owasp/dependencycheck/analyzer/JarAnalyzer.java
-
+
Violation
Line
-
+
Useless parentheses.
-383
+401
org/owasp/dependencycheck/analyzer/JavaScriptAnalyzer.java
-
+
Violation
Line
-
+
Avoid unused local variables such as 'extractComments'.
113
-
org/owasp/dependencycheck/analyzer/NvdCveAnalyzer.java
+
org/owasp/dependencycheck/analyzer/NexusAnalyzer.java
-
+
Violation
Line
+
+Useless parentheses.
+99
+
+
org/owasp/dependencycheck/analyzer/NvdCveAnalyzer.java
+
+Violation
+Line
+
Useless parentheses.
76
org/owasp/dependencycheck/data/cpe/IndexEntry.java
-
+
Violation
Line
-
+
Useless parentheses.
172
-
+
Useless parentheses.
175
org/owasp/dependencycheck/data/nvdcve/CveDB.java
-
+
Violation
Line
-
+
Useless parentheses.
745
org/owasp/dependencycheck/data/nvdcve/DriverShim.java
-
+
Violation
Line
-
+
Useless parentheses.
192
org/owasp/dependencycheck/data/update/StandardUpdate.java
-
+
Violation
Line
-
+
Useless parentheses.
118
org/owasp/dependencycheck/dependency/Dependency.java
-
+
Violation
Line
-
-Useless parentheses.
-600
Useless parentheses.
-603
+641
Useless parentheses.
-606
+644
Useless parentheses.
-609
+647
Useless parentheses.
-612
+650
Useless parentheses.
-615
+653
Useless parentheses.
-630
+656
Useless parentheses.
-633
+671
+
+Useless parentheses.
+674
org/owasp/dependencycheck/dependency/Evidence.java
-
+
Violation
Line
-
+
Useless parentheses.
204
org/owasp/dependencycheck/dependency/Identifier.java
-
+
Violation
Line
-
+
Useless parentheses.
177
-
+
Useless parentheses.
180
org/owasp/dependencycheck/dependency/Reference.java
-
+
Violation
Line
-
-Useless parentheses.
-109
Useless parentheses.
-112
+109
Useless parentheses.
+112
+
+Useless parentheses.
115
org/owasp/dependencycheck/dependency/Vulnerability.java
-
+
Violation
Line
-
+
Useless parentheses.
373
org/owasp/dependencycheck/dependency/VulnerableSoftware.java
-
+
Violation
Line
-
-Useless parentheses.
-143
Useless parentheses.
-182
+143
Useless parentheses.
+182
+
+Useless parentheses.
187
org/owasp/dependencycheck/suppression/PropertyType.java
-
+
Violation
Line
-
+
Useless parentheses.
161
org/owasp/dependencycheck/utils/DependencyVersion.java
-
+
Violation
Line
-
+
Useless parentheses.
135
-
+
Useless parentheses.
196
diff --git a/dependency-check-core/project-info.html b/dependency-check-core/project-info.html
index ad8c05ad6..557f22f7c 100644
--- a/dependency-check-core/project-info.html
+++ b/dependency-check-core/project-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Project Information
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-core/project-reports.html b/dependency-check-core/project-reports.html
index d5df97f18..8096d4dfe 100644
--- a/dependency-check-core/project-reports.html
+++ b/dependency-check-core/project-reports.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Generated Reports
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-core/project-summary.html b/dependency-check-core/project-summary.html
index 4b34e7cfa..506e8a05c 100644
--- a/dependency-check-core/project-summary.html
+++ b/dependency-check-core/project-summary.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Project Summary
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -203,7 +203,7 @@
dependency-check-core
Version
-1.2.5
+1.2.6
Type
jar
diff --git a/dependency-check-core/surefire-report.html b/dependency-check-core/surefire-report.html
index 784edd865..ab62e272d 100644
--- a/dependency-check-core/surefire-report.html
+++ b/dependency-check-core/surefire-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Surefire Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -268,12 +268,12 @@ function toggleDisplay(elementId) {
Success Rate
Time
-149
+158
0
0
1
-99.329%
-19.855
+99.367%
+40.427
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
Package List
@@ -296,29 +296,77 @@ function toggleDisplay(elementId) {
100%
0
-org.owasp.dependencycheck.data.nuget
-3
-0
-0
-0
-100%
-0
-
org.owasp.dependencycheck.data.nexus
4
0
0
0
100%
-1.553
-
+0.893
+
org.owasp.dependencycheck.dependency
-23
+25
0
0
0
100%
-0.033
+
0.006
+
+org.owasp.dependencycheck.data.central
+5
+0
+0
+0
+100%
+0.166
+
+org.owasp.dependencycheck.analyzer
+43
+0
+0
+1
+97.674%
+15.847
+
+org.owasp.dependencycheck.data.update.xml
+2
+0
+0
+0
+100%
+0.155
+
+org.owasp.dependencycheck.data.update
+10
+0
+0
+0
+100%
+0
+
+org.owasp.dependencycheck.suppression
+37
+0
+0
+0
+100%
+0
+
+org.owasp.dependencycheck.data.cpe
+1
+0
+0
+0
+100%
+0
+
+org.owasp.dependencycheck.data.nuget
+3
+0
+0
+0
+100%
+0.02
org.owasp.dependencycheck.utils
10
@@ -328,29 +376,13 @@ function toggleDisplay(elementId) {
100%
0
-org.owasp.dependencycheck.data.update.xml
-2
-0
-0
-0
-100%
-0.349
-
-org.owasp.dependencycheck.analyzer
-42
-0
-0
+org.owasp.dependencycheck.data.update.task
1
-97.619%
-16.787
-
-org.owasp.dependencycheck.data.update
-10
0
0
0
100%
-0
+
22.211
org.owasp.dependencycheck.data.nvdcve
6
@@ -358,31 +390,15 @@ function toggleDisplay(elementId) {
0
0
100%
-0.039
+
0.046
-org.owasp.dependencycheck.suppression
-37
-0
-0
-0
-100%
-0.005
-
org.owasp.dependencycheck.data.lucene
10
0
0
0
100%
-1.089
-
-org.owasp.dependencycheck.data.cpe
-1
-0
-0
-0
-100%
-0
+
1.083
Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
org.owasp.dependencycheck.data.cwe
@@ -406,27 +422,6 @@ function toggleDisplay(elementId) {
100%
0
-
org.owasp.dependencycheck.data.nuget
-
-
-
-Class
-Tests
-Errors
-Failures
-Skipped
-Success Rate
-Time
-
-
-XPathNuspecParserTest
-3
-0
-0
-0
-100%
-0
-
org.owasp.dependencycheck.data.nexus
@@ -446,7 +441,7 @@ function toggleDisplay(elementId) {
0
0
100%
-1.553
+
0.893
org.owasp.dependencycheck.dependency
@@ -462,12 +457,12 @@ function toggleDisplay(elementId) {
DependencyTest
-20
+22
0
0
0
100%
-0.033
+0.006
VulnerableSoftwareTest
@@ -478,7 +473,7 @@ function toggleDisplay(elementId) {
100%
0
-
org.owasp.dependencycheck.utils
+
org.owasp.dependencycheck.data.central
+
+
org.owasp.dependencycheck.analyzer
+
-
-
org.owasp.dependencycheck.analyzer
-
+0.154
org.owasp.dependencycheck.data.update
@@ -688,27 +665,6 @@ function toggleDisplay(elementId) {
100%
0
-
org.owasp.dependencycheck.data.nvdcve
-
-
-
-Class
-Tests
-Errors
-Failures
-Skipped
-Success Rate
-Time
-
-
-DriverLoaderTest
-6
-0
-0
-0
-100%
-0.039
-
org.owasp.dependencycheck.suppression
@@ -755,7 +711,130 @@ function toggleDisplay(elementId) {
0
0
100%
-0.005
+0
+
+
org.owasp.dependencycheck.data.cpe
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+IndexEntryTest
+1
+0
+0
+0
+100%
+0
+
+
org.owasp.dependencycheck.data.nuget
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+XPathNuspecParserTest
+3
+0
+0
+0
+100%
+0.02
+
+
org.owasp.dependencycheck.utils
+
+
+
org.owasp.dependencycheck.data.update.task
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+DownloadTaskTest
+1
+0
+0
+0
+100%
+22.211
+
+
org.owasp.dependencycheck.data.nvdcve
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+DriverLoaderTest
+6
+0
+0
+0
+100%
+0.046
org.owasp.dependencycheck.data.lucene
@@ -785,7 +864,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.001
+0
TokenPairConcatenatingFilterTest
@@ -794,7 +873,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.141
+0.073
UrlTokenizingFilterTest
@@ -803,28 +882,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.947
-
-
org.owasp.dependencycheck.data.cpe
-
-
-
-Class
-Tests
-Errors
-Failures
-Skipped
-Success Rate
-Time
-
-
-IndexEntryTest
-1
-0
-0
-0
-100%
-0
+1.01
+0.023
AbstractSuppressionAnalyzerTest
testFailureToLocateSuppressionFileAnywhere
-0.524
+0.399
testGetRulesFromSuppressionFileFromURL
-0.112
+0.148
testGetRulesFromSuppressionFileInClasspath
-0.045
+0.018
testGetSupportedExtensions
-0
+0.001
AnalyzerServiceTest
testGetAnalyzers
-0.684
+0.583
AssemblyAnalyzerTest
testGetName
-0.328
+0.281
testAnalysis
-0.398
+0.167
testWithSettingMono
@@ -884,11 +942,11 @@ function toggleDisplay(elementId) {
testNonexistent
-0.264
+0.18
testLog4Net
-0.399
+0.372
DependencyBundlingAnalyzerTest
@@ -906,6 +964,10 @@ function toggleDisplay(elementId) {
0
+testFirstPathIsShortest
+0
+
+
testIsCore
0
@@ -929,68 +991,7 @@ function toggleDisplay(elementId) {
testAnalyze
-0.004
-
-
-testClose
-0
-
-
-testGetAnalysisPhase
-0
-
-
-testGetName
-0
-
-
-testInitialize
-0
-
-
HintAnalyzerTest
-
-
-
-testAnalyze
-12.3
-
-
-testGetAnalysisPhase
-0.017
-
-
-testGetName
-0
-
-
-
JavaScriptAnalyzerTest
-
-
-
-testAnalyze
-0.058
+0.033
testClose
@@ -1006,6 +1007,67 @@ function toggleDisplay(elementId) {
testInitialize
+0
+
+
HintAnalyzerTest
+
+
+
+testAnalyze
+11.292
+
+
+testGetAnalysisPhase
+0
+
+
+testGetName
+0
+
+
+
IndexEntryTest
@@ -1073,67 +1158,67 @@ function toggleDisplay(elementId) {
testAppendEscapedLuceneQuery_null
-0.001
+0
TokenPairConcatenatingFilterTest
-testClear
-0.131
+testExamples
+0.073
-testExamples
-0.01
+testClear
+0
UrlTokenizingFilterTest
testRandomStrings
-0.92
+0.994
testExamples
-0.01
+0.008
testEmptyTerm
-0.017
+0.008
NexusSearchTest
testNullSha1
-1.175
+0.675
testMalformedSha1
-0.071
+0.041
testValidSha1
-0.155
+0.099
testMissingSha1
-0.152
+0.078
XPathNuspecParserTest
testGoodDocument
-0
+0.007
testMissingDocument
-0
+0.005
testNotNuspec
-0
+0.008
DriverLoaderTest
@@ -1156,11 +1241,11 @@ function toggleDisplay(elementId) {
testLoad_String_String
-0
+0.023
testLoad_String_String_multiple_paths
-0.039
+0.023
NvdCveInfoTest
@@ -1185,6 +1270,13 @@ function toggleDisplay(elementId) {
testSetGetId
0
+
DownloadTaskTest
+
+
+
+testCall
+22.211
+
UpdateableNvdCveTest
@@ -1213,14 +1305,14 @@ function toggleDisplay(elementId) {
testParse
-0.121
+0.001
NvdCve_2_0_HandlerTest
testParse
-0.228
+0.154
DependencyTest
@@ -1239,11 +1331,19 @@ function toggleDisplay(elementId) {
testGetActualFilePath
+0.001
+
+
+testAddAsEvidence
+0
+
+
+testAddAsEvidenceWithEmptyArtefact
0
testSetFileExtension
-0.001
+0
testGetIdentifiers
@@ -1259,7 +1359,7 @@ function toggleDisplay(elementId) {
testGetVendorEvidence
-0
+0.001
testSetFileName
@@ -1287,7 +1387,7 @@ function toggleDisplay(elementId) {
testGetMd5sum
-0.008
+0
testGetEvidence
@@ -1303,7 +1403,7 @@ function toggleDisplay(elementId) {
testSetActualFilePath
-0.024
+0.004
VulnerableSoftwareTest
@@ -1378,11 +1478,11 @@ function toggleDisplay(elementId) {
testSha1
-0.001
+0
testCpeMatches
-0.001
+0
testHasCvssBelow
@@ -1390,7 +1490,7 @@ function toggleDisplay(elementId) {
testProcess
-0.001
+0
testGetSha1
@@ -1398,11 +1498,11 @@ function toggleDisplay(elementId) {
testProcessGAV
-0.001
+0
testAddCvssBelow
-0.001
+0
testFilePath
@@ -1515,7 +1615,7 @@ function toggleDisplay(elementId) {
-testParseVersionFromFileName
+testParseVersion
0
FilterTest
diff --git a/dependency-check-core/taglist.html b/dependency-check-core/taglist.html
index bc7039c63..4cd758645 100644
--- a/dependency-check-core/taglist.html
+++ b/dependency-check-core/taglist.html
@@ -1,13 +1,13 @@
-
+
dependency-check-core - Tag List report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
-
| Last Published: 2014-09-16
+
| Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -247,12 +247,12 @@
Tag strings used by tag class
Todo Work
-22
+20
todo, FIXME
Each tag is detailed below:
-
Number of occurrences found in the code: 22
+
Number of occurrences found in the code: 20
org.owasp.dependencycheck.analyzer.ArchiveAnalyzer
@@ -262,7 +262,7 @@
108
- can we get more evidence from the parent? EAR contains module name, etc. analyze the dependency (i.e. extract files) if it is a supported type.
-231
+230
org.owasp.dependencycheck.analyzer.CPEAnalyzer
Line
@@ -271,95 +271,86 @@
173
- likely need to change the split... not sure if this will work for CPE with special chars
-432
+441
the following isn't quite right is it? need to think about this guessing game a bit more.
-527
+538
-org.owasp.dependencycheck.analyzer.CPEAnalyzerIntegrationTest
-Line
-
-- yeah, not a very good test as the results are the same with or without weighting...
-201
-
-fix this assert Assert.assertEquals(expResult, result.get(0).getName());
-209
-
org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzerTest
Line
-
+
review the generated test code and remove the default call to fail. fail("The test case is a prototype.");
62
-
+
org.owasp.dependencycheck.analyzer.FalsePositiveAnalyzer
Line
-
+
fix the version problem below
-162
-
+166
+
- can we utilize the pom's groupid and artifactId to filter??? most of these are due to low quality data. Other idea would be to say any CPE found based on LOW confidence evidence should have a different CPE type? (this might be a better solution then just removing the URL for "best-guess" matches).
-263
-
-move this startsWith expression to a configuration file?
-272
+267
-move this to the hint analyzer
-360
+move this startsWith expression to a configuration file?
+276
+move this to the hint analyzer
+364
+
org.owasp.dependencycheck.analyzer.JarAnalyzer
Line
-
-remove weighting
-712
-change this to a regex?
-830
+remove weighting
+762
+change this to a regex?
+880
+
org.owasp.dependencycheck.analyzer.JavaScriptAnalyzerTest
Line
-
+
improve the assertions assertTrue(depJQ6.getEvidence().size() > 0); assertTrue(depJQ10.getEvidence().size() > 0); assertTrue(depJQ10min.getEvidence().size() > 0);
103
-
+
org.owasp.dependencycheck.data.lucene.SearchVersionAnalyzer
Line
-
+
consider implementing payloads/custom attributes... use custom attributes for major, minor, x, x, x, rcx these can then be used to weight the score for searches on the version. see http://lucene.apache.org/core/3_6_1/api/core/org/apache/lucene/analysis/package-summary.html#package_description look at this article to implement http://www.codewrecks.com/blog/index.php/2012/08/25/index-your-blog-using-tags-and-lucene-net/
36
-
+
org.owasp.dependencycheck.data.lucene.VersionAnalyzer
Line
-
+
consider implementing payloads/custom attributes... use custom attributes for major, minor, x, x, x, rcx these can then be used to weight the score for searches on the version. see http://lucene.apache.org/core/3_6_1/api/core/org/apache/lucene/analysis/package-summary.html#package_description look at this article to implement http://www.codewrecks.com/blog/index.php/2012/08/25/index-your-blog-using-tags-and-lucene-net/
36
-
+
org.owasp.dependencycheck.data.lucene.VersionTokenizingFilter
Line
-
+
should we also be splitting on dash or underscore? we would need to incorporate the dash or underscore back in...
81
-
+
org.owasp.dependencycheck.data.nvdcve.CveDB
Line
-
+
consider utilizing the matchThreeVersion method to get additional results. However, this might also introduce false positives.
755
-
+
org.owasp.dependencycheck.data.update.StandardUpdateIntegrationTest
Line
-
+
make this an actual test }
78
-
+
org.owasp.dependencycheck.dependency.EvidenceCollection
Line
-
+
consider changing the regex to only compare alpha-numeric (i.e. strip everything else)
238
-
+
org.owasp.dependencycheck.utils.DependencyVersion
Line
-
+
steal better version of code from compareTo
137
diff --git a/dependency-check-core/xref-test/allclasses-frame.html b/dependency-check-core/xref-test/allclasses-frame.html
index 49690cb03..09ac46d4a 100644
--- a/dependency-check-core/xref-test/allclasses-frame.html
+++ b/dependency-check-core/xref-test/allclasses-frame.html
@@ -40,6 +40,9 @@
CPEAnalyzerIntegrationTest
+
+
+ CentralSearchTest
CveDBIntegrationTest
@@ -64,6 +67,9 @@
DependencyVersionUtilTest
+
+
+ DownloadTaskTest
DriverLoaderTest
diff --git a/dependency-check-core/xref-test/index.html b/dependency-check-core/xref-test/index.html
index 5151839d8..af28ffc0a 100644
--- a/dependency-check-core/xref-test/index.html
+++ b/dependency-check-core/xref-test/index.html
@@ -4,7 +4,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html
index 04d741229..a3382acbe 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/EngineIntegrationTest.html
@@ -31,70 +31,48 @@
23 import org.junit.Test;
24 import org.owasp.dependencycheck.data.nvdcve.CveDB;
25 import org.owasp.dependencycheck.data.nvdcve.DatabaseProperties;
-26 import org.owasp.dependencycheck.dependency.Dependency;
-27 import org.owasp.dependencycheck.reporting.ReportGenerator;
-28 import org.owasp.dependencycheck.utils.Settings;
-29
-30
-31
-32
-33
-34 public class EngineIntegrationTest extends BaseTest {
-35
-36 @Before
-37 public void setUp() throws Exception {
-38 org.owasp.dependencycheck.data.nvdcve.BaseDBTestCase.ensureDBExists();
-39 }
-40
-41 @After
-42 public void tearDown() {
-43 }
-44
-45
-46
-47
-48
-49
-50 @Test
-51 public void testScan() throws Exception {
-52 String testClasses = "target/test-classes/*.zip" ;
-53 boolean autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
-54 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
-55 Engine instance = new Engine();
-56 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
-57 instance.scan(testClasses);
-58 assertTrue(instance.getDependencies().size() > 0);
-59 for (Dependency d : instance.getDependencies()) {
-60 assertTrue("non-zip file collected " + d.getFileName(), d.getFileName().toLowerCase().endsWith(".zip" ));
-61 }
-62 instance.cleanup();
-63 }
-64
-65
-66
-67
-68
-69
-70 @Test
-71 public void testEngine() throws Exception {
-72 String testClasses = "target/test-classes" ;
-73 boolean autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
-74 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
-75 Engine instance = new Engine();
-76 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
-77 instance.scan(testClasses);
-78 assertTrue(instance.getDependencies().size() > 0);
-79 instance.analyzeDependencies();
-80 CveDB cveDB = new CveDB();
-81 cveDB.open();
-82 DatabaseProperties dbProp = cveDB.getDatabaseProperties();
-83 cveDB.close();
-84 ReportGenerator rg = new ReportGenerator("DependencyCheck" ,
-85 instance.getDependencies(), instance.getAnalyzers(), dbProp);
-86 rg.generateReports("./target/" , "ALL" );
-87 instance.cleanup();
-88 }
-89 }
+26 import org.owasp.dependencycheck.reporting.ReportGenerator;
+27 import org.owasp.dependencycheck.utils.Settings;
+28
+29
+30
+31
+32
+33 public class EngineIntegrationTest extends BaseTest {
+34
+35 @Before
+36 public void setUp() throws Exception {
+37 org.owasp.dependencycheck.data.nvdcve.BaseDBTestCase.ensureDBExists();
+38 }
+39
+40 @After
+41 public void tearDown() {
+42 }
+43
+44
+45
+46
+47
+48
+49 @Test
+50 public void testEngine() throws Exception {
+51 String testClasses = "target/test-classes" ;
+52 boolean autoUpdate = Settings.getBoolean(Settings.KEYS.AUTO_UPDATE);
+53 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, false);
+54 Engine instance = new Engine();
+55 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
+56 instance.scan(testClasses);
+57 assertTrue(instance.getDependencies().size() > 0);
+58 instance.analyzeDependencies();
+59 CveDB cveDB = new CveDB();
+60 cveDB.open();
+61 DatabaseProperties dbProp = cveDB.getDatabaseProperties();
+62 cveDB.close();
+63 ReportGenerator rg = new ReportGenerator("DependencyCheck" , instance.getDependencies(), instance.getAnalyzers(), dbProp);
+64 rg.generateReports("./target/" , "ALL" );
+65 instance.cleanup();
+66 }
+67 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerIntegrationTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerIntegrationTest.html
index 081edc1c9..dfca7c047 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerIntegrationTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/ArchiveAnalyzerIntegrationTest.html
@@ -48,7 +48,7 @@
40 @Test
41 public void testGetSupportedExtensions() {
42 ArchiveAnalyzer instance = new ArchiveAnalyzer();
-43 Set expResult = new HashSet<String>();
+43 Set<String> expResult = new HashSet<String>();
44 expResult.add("zip" );
45 expResult.add("war" );
46 expResult.add("ear" );
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/CPEAnalyzerIntegrationTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/CPEAnalyzerIntegrationTest.html
index 2f39f1d7c..5fdad0d76 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/CPEAnalyzerIntegrationTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/CPEAnalyzerIntegrationTest.html
@@ -33,193 +33,226 @@
25 import org.apache.lucene.index.CorruptIndexException;
26 import org.apache.lucene.queryparser.classic.ParseException;
27 import org.junit.Assert;
-28 import org.junit.Test;
-29 import org.owasp.dependencycheck.data.cpe.AbstractDatabaseTestCase;
-30 import org.owasp.dependencycheck.data.cpe.IndexEntry;
-31 import org.owasp.dependencycheck.dependency.Dependency;
-32 import org.owasp.dependencycheck.dependency.Identifier;
-33
-34
-35
-36
-37
-38 public class CPEAnalyzerIntegrationTest extends AbstractDatabaseTestCase {
-39
-40
-41
-42
-43
-44
-45
-46
-47 @Test
-48 public void testBuildSearch() throws IOException, CorruptIndexException, ParseException {
-49 Set<String> productWeightings = new HashSet<String>(1);
-50 productWeightings.add("struts2" );
-51
-52 Set<String> vendorWeightings = new HashSet<String>(1);
-53 vendorWeightings.add("apache" );
-54
-55 String vendor = "apache software foundation" ;
-56 String product = "struts 2 core" ;
-57 String version = "2.1.2" ;
-58 CPEAnalyzer instance = new CPEAnalyzer();
-59
-60 String queryText = instance.buildSearch(vendor, product, null , null );
-61 String expResult = " product:( struts 2 core ) AND vendor:( apache software foundation ) " ;
-62 Assert.assertTrue(expResult.equals(queryText));
-63
-64 queryText = instance.buildSearch(vendor, product, null , productWeightings);
-65 expResult = " product:( struts^5 struts2^5 2 core ) AND vendor:( apache software foundation ) " ;
-66 Assert.assertTrue(expResult.equals(queryText));
-67
-68 queryText = instance.buildSearch(vendor, product, vendorWeightings, null );
-69 expResult = " product:( struts 2 core ) AND vendor:( apache^5 software foundation ) " ;
-70 Assert.assertTrue(expResult.equals(queryText));
-71
-72 queryText = instance.buildSearch(vendor, product, vendorWeightings, productWeightings);
-73 expResult = " product:( struts^5 struts2^5 2 core ) AND vendor:( apache^5 software foundation ) " ;
-74 Assert.assertTrue(expResult.equals(queryText));
-75 }
-76
-77
-78
-79
-80
-81
-82 @Test
-83 public void testDetermineCPE_full() throws Exception {
-84 CPEAnalyzer instance = new CPEAnalyzer();
-85 instance.open();
-86 FileNameAnalyzer fnAnalyzer = new FileNameAnalyzer();
-87 JarAnalyzer jarAnalyzer = new JarAnalyzer();
-88 HintAnalyzer hAnalyzer = new HintAnalyzer();
-89 FalsePositiveAnalyzer fp = new FalsePositiveAnalyzer();
-90
-91 try {
-92
-93 callDetermineCPE_full("hazelcast-2.5.jar" , null , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
-94 callDetermineCPE_full("spring-context-support-2.5.5.jar" , "cpe:/a:vmware:springsource_spring_framework:2.5.5" , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
-95 callDetermineCPE_full("spring-core-3.0.0.RELEASE.jar" , "cpe:/a:vmware:springsource_spring_framework:3.0.0" , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
-96 callDetermineCPE_full("org.mortbay.jetty.jar" , "cpe:/a:mortbay_jetty:jetty:4.2" , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
-97 callDetermineCPE_full("jaxb-xercesImpl-1.5.jar" , null , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
-98 callDetermineCPE_full("ehcache-core-2.2.0.jar" , null , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
-99 } finally {
-100 instance.close();
-101 }
-102 }
-103
-104
-105
-106
-107
-108
-109 public void callDetermineCPE_full(String depName, String expResult, CPEAnalyzer instance, FileNameAnalyzer fnAnalyzer, JarAnalyzer jarAnalyzer, HintAnalyzer hAnalyzer, FalsePositiveAnalyzer fp) throws Exception {
-110
-111 File file = new File(this .getClass().getClassLoader().getResource(depName).getPath());
+28 import static org.junit.Assert.assertTrue;
+29 import org.junit.Test;
+30 import org.owasp.dependencycheck.data.cpe.AbstractDatabaseTestCase;
+31 import org.owasp.dependencycheck.data.cpe.IndexEntry;
+32 import org.owasp.dependencycheck.dependency.Confidence;
+33 import org.owasp.dependencycheck.dependency.Dependency;
+34 import org.owasp.dependencycheck.dependency.Identifier;
+35
+36
+37
+38
+39
+40 public class CPEAnalyzerIntegrationTest extends AbstractDatabaseTestCase {
+41
+42
+43
+44
+45
+46
+47
+48
+49 @Test
+50 public void testBuildSearch() throws IOException, CorruptIndexException, ParseException {
+51 Set<String> productWeightings = new HashSet<String>(1);
+52 productWeightings.add("struts2" );
+53
+54 Set<String> vendorWeightings = new HashSet<String>(1);
+55 vendorWeightings.add("apache" );
+56
+57 String vendor = "apache software foundation" ;
+58 String product = "struts 2 core" ;
+59 String version = "2.1.2" ;
+60 CPEAnalyzer instance = new CPEAnalyzer();
+61
+62 String queryText = instance.buildSearch(vendor, product, null , null );
+63 String expResult = " product:( struts 2 core ) AND vendor:( apache software foundation ) " ;
+64 Assert.assertTrue(expResult.equals(queryText));
+65
+66 queryText = instance.buildSearch(vendor, product, null , productWeightings);
+67 expResult = " product:( struts^5 struts2^5 2 core ) AND vendor:( apache software foundation ) " ;
+68 Assert.assertTrue(expResult.equals(queryText));
+69
+70 queryText = instance.buildSearch(vendor, product, vendorWeightings, null );
+71 expResult = " product:( struts 2 core ) AND vendor:( apache^5 software foundation ) " ;
+72 Assert.assertTrue(expResult.equals(queryText));
+73
+74 queryText = instance.buildSearch(vendor, product, vendorWeightings, productWeightings);
+75 expResult = " product:( struts^5 struts2^5 2 core ) AND vendor:( apache^5 software foundation ) " ;
+76 Assert.assertTrue(expResult.equals(queryText));
+77 }
+78
+79
+80
+81
+82
+83
+84 @Test
+85 public void testDetermineCPE_full() throws Exception {
+86 CPEAnalyzer instance = new CPEAnalyzer();
+87 instance.open();
+88 FileNameAnalyzer fnAnalyzer = new FileNameAnalyzer();
+89 JarAnalyzer jarAnalyzer = new JarAnalyzer();
+90 HintAnalyzer hAnalyzer = new HintAnalyzer();
+91 FalsePositiveAnalyzer fp = new FalsePositiveAnalyzer();
+92
+93 try {
+94
+95 callDetermineCPE_full("hazelcast-2.5.jar" , null , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
+96 callDetermineCPE_full("spring-context-support-2.5.5.jar" , "cpe:/a:vmware:springsource_spring_framework:2.5.5" , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
+97 callDetermineCPE_full("spring-core-3.0.0.RELEASE.jar" , "cpe:/a:vmware:springsource_spring_framework:3.0.0" , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
+98 callDetermineCPE_full("org.mortbay.jetty.jar" , "cpe:/a:mortbay_jetty:jetty:4.2" , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
+99 callDetermineCPE_full("jaxb-xercesImpl-1.5.jar" , null , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
+100 callDetermineCPE_full("ehcache-core-2.2.0.jar" , null , instance, fnAnalyzer, jarAnalyzer, hAnalyzer, fp);
+101 } finally {
+102 instance.close();
+103 }
+104 }
+105
+106
+107
+108
+109
+110
+111 public void callDetermineCPE_full(String depName, String expResult, CPEAnalyzer instance, FileNameAnalyzer fnAnalyzer, JarAnalyzer jarAnalyzer, HintAnalyzer hAnalyzer, FalsePositiveAnalyzer fp) throws Exception {
112
-113 Dependency dep = new Dependency(file);
+113 File file = new File(this .getClass().getClassLoader().getResource(depName).getPath());
114
-115 fnAnalyzer.analyze(dep, null );
-116 jarAnalyzer.analyze(dep, null );
-117 hAnalyzer.analyze(dep, null );
-118 instance.analyze(dep, null );
-119 fp.analyze(dep, null );
-120
-121 if (expResult != null ) {
-122 Identifier expIdentifier = new Identifier("cpe" , expResult, expResult);
-123 Assert.assertTrue("Incorrect match: { dep:'" + dep.getFileName() + "' }" , dep.getIdentifiers().contains(expIdentifier));
-124 } else {
-125 for (Identifier i : dep.getIdentifiers()) {
-126 Assert.assertFalse(String.format("%s - found a CPE identifier when should have been none (found '%s')" , dep.getFileName(), i.getValue()), "cpe" .equals(i.getType()));
-127 }
-128 }
-129 }
-130
-131
-132
-133
-134
-135
-136 @Test
-137 public void testDetermineCPE() throws Exception {
-138 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
-139
-140 Dependency struts = new Dependency(file);
-141
-142 FileNameAnalyzer fnAnalyzer = new FileNameAnalyzer();
-143 fnAnalyzer.analyze(struts, null );
-144
-145 JarAnalyzer jarAnalyzer = new JarAnalyzer();
-146 jarAnalyzer.analyze(struts, null );
-147
-148 File fileCommonValidator = new File(this .getClass().getClassLoader().getResource("commons-validator-1.4.0.jar" ).getPath());
-149 Dependency commonValidator = new Dependency(fileCommonValidator);
-150 jarAnalyzer.analyze(commonValidator, null );
-151
-152 File fileSpring = new File(this .getClass().getClassLoader().getResource("spring-core-2.5.5.jar" ).getPath());
-153 Dependency spring = new Dependency(fileSpring);
-154 jarAnalyzer.analyze(spring, null );
-155
-156 File fileSpring3 = new File(this .getClass().getClassLoader().getResource("spring-core-3.0.0.RELEASE.jar" ).getPath());
-157 Dependency spring3 = new Dependency(fileSpring3);
-158 jarAnalyzer.analyze(spring3, null );
-159
-160 CPEAnalyzer instance = new CPEAnalyzer();
-161 instance.open();
-162 instance.determineCPE(commonValidator);
-163 instance.determineCPE(struts);
-164 instance.determineCPE(spring);
-165 instance.determineCPE(spring3);
-166 instance.close();
-167
-168 String expResult = "cpe:/a:apache:struts:2.1.2" ;
-169 Identifier expIdentifier = new Identifier("cpe" , expResult, expResult);
-170 String expResultSpring = "cpe:/a:springsource:spring_framework:2.5.5" ;
-171 String expResultSpring3 = "cpe:/a:vmware:springsource_spring_framework:3.0.0" ;
-172
-173 for (Identifier i : commonValidator.getIdentifiers()) {
-174 Assert.assertFalse("Apache Common Validator - found a CPE identifier?" , "cpe" .equals(i.getType()));
-175 }
-176
-177 Assert.assertTrue("Incorrect match size - struts" , struts.getIdentifiers().size() >= 1);
-178 Assert.assertTrue("Incorrect match - struts" , struts.getIdentifiers().contains(expIdentifier));
-179 Assert.assertTrue("Incorrect match size - spring3 - " + spring3.getIdentifiers().size(), spring3.getIdentifiers().size() >= 1);
-180
-181
-182
-183
-184 }
-185
-186
-187
-188
-189
-190
-191 @Test
-192 public void testSearchCPE() throws Exception {
-193 String vendor = "apache software foundation" ;
-194 String product = "struts 2 core" ;
-195 String version = "2.1.2" ;
-196 String expResult = "cpe:/a:apache:struts:2.1.2" ;
-197
-198 CPEAnalyzer instance = new CPEAnalyzer();
-199 instance.open();
-200
-201
-202 Set<String> productWeightings = new HashSet<String>(1);
-203 productWeightings.add("struts2" );
+115 Dependency dep = new Dependency(file);
+116
+117 fnAnalyzer.analyze(dep, null );
+118 jarAnalyzer.analyze(dep, null );
+119 hAnalyzer.analyze(dep, null );
+120 instance.analyze(dep, null );
+121 fp.analyze(dep, null );
+122
+123 if (expResult != null ) {
+124 Identifier expIdentifier = new Identifier("cpe" , expResult, expResult);
+125 Assert.assertTrue("Incorrect match: { dep:'" + dep.getFileName() + "' }" , dep.getIdentifiers().contains(expIdentifier));
+126 } else {
+127 for (Identifier i : dep.getIdentifiers()) {
+128 Assert.assertFalse(String.format("%s - found a CPE identifier when should have been none (found '%s')" , dep.getFileName(), i.getValue()), "cpe" .equals(i.getType()));
+129 }
+130 }
+131 }
+132
+133
+134
+135
+136
+137
+138 @Test
+139 public void testDetermineCPE() throws Exception {
+140 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
+141
+142 Dependency struts = new Dependency(file);
+143
+144 FileNameAnalyzer fnAnalyzer = new FileNameAnalyzer();
+145 fnAnalyzer.analyze(struts, null );
+146
+147 JarAnalyzer jarAnalyzer = new JarAnalyzer();
+148 jarAnalyzer.analyze(struts, null );
+149
+150 File fileCommonValidator = new File(this .getClass().getClassLoader().getResource("commons-validator-1.4.0.jar" ).getPath());
+151 Dependency commonValidator = new Dependency(fileCommonValidator);
+152 jarAnalyzer.analyze(commonValidator, null );
+153
+154 File fileSpring = new File(this .getClass().getClassLoader().getResource("spring-core-2.5.5.jar" ).getPath());
+155 Dependency spring = new Dependency(fileSpring);
+156 jarAnalyzer.analyze(spring, null );
+157
+158 File fileSpring3 = new File(this .getClass().getClassLoader().getResource("spring-core-3.0.0.RELEASE.jar" ).getPath());
+159 Dependency spring3 = new Dependency(fileSpring3);
+160 jarAnalyzer.analyze(spring3, null );
+161
+162 CPEAnalyzer instance = new CPEAnalyzer();
+163 instance.open();
+164 instance.determineCPE(commonValidator);
+165 instance.determineCPE(struts);
+166 instance.determineCPE(spring);
+167 instance.determineCPE(spring3);
+168 instance.close();
+169
+170 String expResult = "cpe:/a:apache:struts:2.1.2" ;
+171 Identifier expIdentifier = new Identifier("cpe" , expResult, expResult);
+172 String expResultSpring = "cpe:/a:springsource:spring_framework:2.5.5" ;
+173 String expResultSpring3 = "cpe:/a:vmware:springsource_spring_framework:3.0.0" ;
+174
+175 for (Identifier i : commonValidator.getIdentifiers()) {
+176 Assert.assertFalse("Apache Common Validator - found a CPE identifier?" , "cpe" .equals(i.getType()));
+177 }
+178
+179 Assert.assertTrue("Incorrect match size - struts" , struts.getIdentifiers().size() >= 1);
+180 Assert.assertTrue("Incorrect match - struts" , struts.getIdentifiers().contains(expIdentifier));
+181 Assert.assertTrue("Incorrect match size - spring3 - " + spring3.getIdentifiers().size(), spring3.getIdentifiers().size() >= 1);
+182
+183
+184
+185
+186 }
+187
+188
+189
+190
+191
+192
+193 @Test
+194 public void testDetermineIdentifiers() throws Exception {
+195 Dependency openssl = new Dependency();
+196 openssl.getVendorEvidence().addEvidence("test" , "vendor" , "openssl" , Confidence.HIGHEST);
+197 openssl.getProductEvidence().addEvidence("test" , "product" , "openssl" , Confidence.HIGHEST);
+198 openssl.getVersionEvidence().addEvidence("test" , "version" , "1.0.1c" , Confidence.HIGHEST);
+199
+200 CPEAnalyzer instance = new CPEAnalyzer();
+201 instance.open();
+202 instance.determineIdentifiers(openssl, "openssl" , "openssl" , Confidence.HIGHEST);
+203 instance.close();
204
-205 Set<String> vendorWeightings = new HashSet<String>(1);
-206 vendorWeightings.add("apache" );
+205 String expResult = "cpe:/a:openssl:openssl:1.0.1c" ;
+206 Identifier expIdentifier = new Identifier("cpe" , expResult, expResult);
207
-208 List<IndexEntry> result = instance.searchCPE(vendor, product, productWeightings, vendorWeightings);
-209
-210
+208 assertTrue(openssl.getIdentifiers().contains(expIdentifier));
+209
+210 }
211
-212 instance.close();
-213 }
-214 }
+212
+213
+214
+215
+216
+217 @Test
+218 public void testSearchCPE() throws Exception {
+219 String vendor = "apache software foundation" ;
+220 String product = "struts 2 core" ;
+221 String version = "2.1.2" ;
+222 String expVendor = "apache" ;
+223 String expProduct = "struts" ;
+224
+225 CPEAnalyzer instance = new CPEAnalyzer();
+226 instance.open();
+227
+228 Set<String> productWeightings = new HashSet<String>(1);
+229 productWeightings.add("struts2" );
+230
+231 Set<String> vendorWeightings = new HashSet<String>(1);
+232 vendorWeightings.add("apache" );
+233
+234 List<IndexEntry> result = instance.searchCPE(vendor, product, productWeightings, vendorWeightings);
+235 instance.close();
+236
+237 boolean found = false;
+238 for (IndexEntry entry : result) {
+239 if (expVendor.equals(entry.getVendor()) && expProduct.equals(entry.getProduct())) {
+240 found = true ;
+241 break ;
+242 }
+243 }
+244 assertTrue("apache:struts was not identified" , found);
+245
+246 }
+247 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html
index 21c8f9093..9cf377956 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzerTest.html
@@ -94,7 +94,43 @@
86 assertEquals(expResult, result);
87 }
88
-89 }
+89 @Test
+90 public void testFirstPathIsShortest() {
+91 DependencyBundlingAnalyzer instance = new DependencyBundlingAnalyzer();
+92
+93 String left = "./a/c.jar" ;
+94 String right = "./d/e/f.jar" ;
+95 boolean expResult = true ;
+96 boolean result = instance.firstPathIsShortest(left, right);
+97 assertEquals(expResult, result);
+98
+99 left = "./a/b/c.jar" ;
+100 right = "./d/e/f.jar" ;
+101 expResult = true ;
+102 result = instance.firstPathIsShortest(left, right);
+103 assertEquals(expResult, result);
+104
+105 left = "./d/b/c.jar" ;
+106 right = "./a/e/f.jar" ;
+107 expResult = false;
+108 result = instance.firstPathIsShortest(left, right);
+109 assertEquals(expResult, result);
+110
+111 left = "./a/b/c.jar" ;
+112 right = "./d/f.jar" ;
+113 expResult = false;
+114 result = instance.firstPathIsShortest(left, right);
+115 assertEquals(expResult, result);
+116
+117 left = "./a/b/c.jar" ;
+118 right = "./a/b/c.jar" ;
+119 expResult = true ;
+120 result = instance.firstPathIsShortest(left, right);
+121 assertEquals(expResult, result);
+122
+123 }
+124
+125 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html
index f3a8d55fc..d7d38a172 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JarAnalyzerTest.html
@@ -101,7 +101,7 @@
93 @Test
94 public void testGetSupportedExtensions() {
95 JarAnalyzer instance = new JarAnalyzer();
-96 Set expResult = new HashSet();
+96 Set<String> expResult = new HashSet<String>();
97 expResult.add("jar" );
98 expResult.add("war" );
99 Set result = instance.getSupportedExtensions();
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html
index 7ce034ce8..75bfe5635 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/JavaScriptAnalyzerTest.html
@@ -46,7 +46,7 @@
38 @Test
39 public void testGetSupportedExtensions() {
40 JavaScriptAnalyzer instance = new JavaScriptAnalyzer();
-41 Set expResult = new HashSet<String>();
+41 Set<String> expResult = new HashSet<String>();
42 expResult.add("js" );
43 Set result = instance.getSupportedExtensions();
44 assertEquals(expResult, result);
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html
index 514ebb8c7..02a974bb0 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.analyzer
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html
index e37f7f4ea..1aca86223 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/analyzer/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.analyzer
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/CentralSearchTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/CentralSearchTest.html
new file mode 100644
index 000000000..13d8de9f5
--- /dev/null
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/CentralSearchTest.html
@@ -0,0 +1,76 @@
+
+
+
+CentralSearchTest xref
+
+
+
+
+1 package org.owasp.dependencycheck.data.central;
+2
+3 import org.junit.Before;
+4 import org.junit.Test;
+5 import org.owasp.dependencycheck.BaseTest;
+6 import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+7 import org.owasp.dependencycheck.utils.Settings;
+8
+9 import java.io.FileNotFoundException;
+10 import java.net.URL;
+11 import java.util.List;
+12 import java.util.logging.Logger;
+13
+14 import static org.junit.Assert.*;
+15
+16
+17
+18
+19 public class CentralSearchTest extends BaseTest {
+20 private static final Logger LOGGER = Logger.getLogger(CentralSearchTest.class .getName());
+21 private CentralSearch searcher;
+22
+23 @Before
+24 public void setUp() throws Exception {
+25 String centralUrl = Settings.getString(Settings.KEYS.ANALYZER_CENTRAL_URL);
+26 LOGGER.fine(centralUrl);
+27 searcher = new CentralSearch(new URL(centralUrl));
+28 }
+29
+30 @Test(expected = IllegalArgumentException.class )
+31 public void testNullSha1() throws Exception { searcher.searchSha1(null ); }
+32
+33 @Test(expected = IllegalArgumentException.class )
+34 public void testMalformedSha1() throws Exception {
+35 searcher.searchSha1("invalid" );
+36 }
+37
+38
+39
+40
+41 @Test
+42 public void testValidSha1() throws Exception {
+43 List<MavenArtifact> ma = searcher.searchSha1("9977a8d04e75609cf01badc4eb6a9c7198c4c5ea" );
+44 assertEquals("Incorrect group" , "org.apache.maven.plugins" , ma.get(0).getGroupId());
+45 assertEquals("Incorrect artifact" , "maven-compiler-plugin" , ma.get(0).getArtifactId());
+46 assertEquals("Incorrect version" , "3.1" , ma.get(0).getVersion());
+47 }
+48
+49
+50
+51
+52 @Test(expected = FileNotFoundException.class )
+53 public void testMissingSha1() throws Exception {
+54 searcher.searchSha1("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" );
+55 }
+56
+57
+58 @Test
+59 public void testMultipleReturns() throws Exception {
+60 List<MavenArtifact> ma = searcher.searchSha1("94A9CE681A42D0352B3AD22659F67835E560D107" );
+61 assertTrue(ma.size() > 1);
+62 }
+63 }
+
+
+
+
+
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/package-frame.html
new file mode 100644
index 000000000..cecf08096
--- /dev/null
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.central
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/package-summary.html
new file mode 100644
index 000000000..b92ac4577
--- /dev/null
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/central/package-summary.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.central
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.data.central
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html
index 590053314..e1e9999f4 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html
index 88291a15a..cb573483e 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cpe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html
index 3d23d6097..fac7ed0d4 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html
index 8d2746271..19c1dee6e 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/cwe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html
index 53dae718b..8f69a8852 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html
index 79c4c5b23..3eb440002 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/lucene/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-frame.html
index 6fd716b3a..9a2a77d1a 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nexus
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nexus
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-summary.html
index fe24f2848..303382582 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nexus/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nexus
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nexus
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-frame.html
index 926fe7df8..62367f0b7 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nuget
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nuget
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-summary.html
index 59e4ba290..78c632c63 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nuget/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nuget
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nuget
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/CveDBIntegrationTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/CveDBIntegrationTest.html
index 362a9e408..de480ce66 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/CveDBIntegrationTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/CveDBIntegrationTest.html
@@ -27,60 +27,79 @@
19
20 import java.util.List;
21 import java.util.Set;
-22 import static org.junit.Assert.assertTrue;
-23 import org.junit.Test;
-24 import org.owasp.dependencycheck.dependency.VulnerableSoftware;
-25
-26
-27
-28
-29
-30 public class CveDBIntegrationTest extends BaseDBTestCase {
-31
-32
-33
-34
-35 @Test
-36 public void testOpen() throws Exception {
-37 CveDB instance = new CveDB();
-38 instance.open();
-39 instance.commit();
-40 instance.close();
-41 }
-42
-43
-44
-45
-46 @Test
-47 public void testGetCPEs() throws Exception {
-48 CveDB instance = new CveDB();
-49 try {
-50 String vendor = "apache" ;
-51 String product = "struts" ;
-52 instance.open();
-53 Set<VulnerableSoftware> result = instance.getCPEs(vendor, product);
-54 assertTrue(result.size() > 5);
-55 } finally {
-56 instance.close();
-57 }
-58 }
-59
-60
-61
-62
-63 @Test
-64 public void testGetVulnerabilities() throws Exception {
-65 String cpeStr = "cpe:/a:apache:struts:2.1.2" ;
-66 CveDB instance = new CveDB();
-67 try {
-68 instance.open();
-69 List result = instance.getVulnerabilities(cpeStr);
-70 assertTrue(result.size() > 5);
-71 } finally {
-72 instance.close();
-73 }
-74 }
-75 }
+22 import static org.junit.Assert.assertFalse;
+23 import static org.junit.Assert.assertTrue;
+24 import org.junit.Test;
+25 import org.owasp.dependencycheck.dependency.VulnerableSoftware;
+26 import org.owasp.dependencycheck.utils.DependencyVersion;
+27
+28
+29
+30
+31
+32 public class CveDBIntegrationTest extends BaseDBTestCase {
+33
+34
+35
+36
+37 @Test
+38 public void testOpen() throws Exception {
+39 CveDB instance = new CveDB();
+40 instance.open();
+41 instance.commit();
+42 instance.close();
+43 }
+44
+45
+46
+47
+48 @Test
+49 public void testGetCPEs() throws Exception {
+50 CveDB instance = new CveDB();
+51 try {
+52 String vendor = "apache" ;
+53 String product = "struts" ;
+54 instance.open();
+55 Set<VulnerableSoftware> result = instance.getCPEs(vendor, product);
+56 assertTrue(result.size() > 5);
+57 } finally {
+58 instance.close();
+59 }
+60 }
+61
+62
+63
+64
+65 @Test
+66 public void testGetVulnerabilities() throws Exception {
+67 String cpeStr = "cpe:/a:apache:struts:2.1.2" ;
+68 CveDB instance = new CveDB();
+69 try {
+70 instance.open();
+71 List result = instance.getVulnerabilities(cpeStr);
+72 assertTrue(result.size() > 5);
+73 } finally {
+74 instance.close();
+75 }
+76 }
+77
+78
+79
+80
+81 @Test
+82 public void testIsAffected() throws Exception {
+83 String vendor = "openssl" ;
+84 String product = "openssl" ;
+85 DependencyVersion identifiedVersion = new DependencyVersion("1.0.1o" );
+86 String cpeId = "cpe:/a:openssl:openssl:1.0.1e" ;
+87 String previous = "y" ;
+88
+89 CveDB instance = new CveDB();
+90 assertFalse(instance.isAffected(vendor, product, identifiedVersion, cpeId, previous));
+91
+92 }
+93
+94 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html
index e79892253..11c7c83eb 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html
index 6457995d4..2d69772f7 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/nvdcve/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html
index a135a7e4a..0ac9289d2 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html
index 60a756137..88dd39c77 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/DownloadTaskTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/DownloadTaskTest.html
new file mode 100644
index 000000000..0f1a8d459
--- /dev/null
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/DownloadTaskTest.html
@@ -0,0 +1,88 @@
+
+
+
+DownloadTaskTest xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.data.update.task;
+19
+20 import java.util.concurrent.ExecutorService;
+21 import java.util.concurrent.Future;
+22 import org.junit.After;
+23 import org.junit.AfterClass;
+24 import static org.junit.Assert.assertNull;
+25 import org.junit.Before;
+26 import org.junit.BeforeClass;
+27 import org.junit.Test;
+28 import org.owasp.dependencycheck.data.nvdcve.CveDB;
+29 import org.owasp.dependencycheck.data.update.NvdCveInfo;
+30 import org.owasp.dependencycheck.utils.Settings;
+31
+32
+33
+34
+35
+36 public class DownloadTaskTest {
+37
+38 public DownloadTaskTest () {
+39 }
+40
+41 @BeforeClass
+42 public static void setUpClass() {
+43 }
+44
+45 @AfterClass
+46 public static void tearDownClass() {
+47 }
+48
+49 @Before
+50 public void setUp() {
+51 Settings.initialize();
+52 }
+53
+54 @After
+55 public void tearDown() {
+56 Settings.cleanup();
+57 }
+58
+59
+60
+61
+62 @Test
+63 public void testCall() throws Exception {
+64 NvdCveInfo cve = new NvdCveInfo();
+65 cve.setId("modified" );
+66 cve.setNeedsUpdate(true );
+67 cve.setUrl(Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL));
+68 cve.setOldSchemaVersionUrl(Settings.getString(Settings.KEYS.CVE_MODIFIED_12_URL));
+69 ExecutorService processExecutor = null ;
+70 CveDB cveDB = null ;
+71 DownloadTask instance = new DownloadTask(cve, processExecutor, cveDB, Settings.getInstance());;
+72 Future<ProcessTask> result = instance.call();
+73 assertNull(result);
+74 }
+75 }
+
+
+
+
+
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/package-frame.html
new file mode 100644
index 000000000..da087ead8
--- /dev/null
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.task
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/package-summary.html
new file mode 100644
index 000000000..ac8afd5ce
--- /dev/null
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/task/package-summary.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.task
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.data.update.task
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-frame.html
index 5b4319d59..0c8983b70 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.xml
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.xml
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-summary.html
index 337dd64d1..7a3096981 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/data/update/xml/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.xml
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.xml
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/DependencyTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/DependencyTest.html
index 3fb60c569..37346fde4 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/DependencyTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/DependencyTest.html
@@ -31,278 +31,310 @@
23 import org.junit.After;
24 import org.junit.AfterClass;
25 import static org.junit.Assert.assertEquals;
-26 import static org.junit.Assert.assertTrue;
-27 import org.junit.Before;
-28 import org.junit.BeforeClass;
-29 import org.junit.Test;
-30
-31
-32
-33
-34
-35 public class DependencyTest {
-36
-37 public DependencyTest () {
-38 }
-39
-40 @BeforeClass
-41 public static void setUpClass() throws Exception {
-42 }
-43
-44 @AfterClass
-45 public static void tearDownClass() throws Exception {
-46 }
-47
-48 @Before
-49 public void setUp() {
-50 }
-51
-52 @After
-53 public void tearDown() {
-54 }
-55
-56
-57
-58
-59 @Test
-60 public void testGetFileName() {
-61 Dependency instance = new Dependency();
-62 String expResult = "filename" ;
-63 instance.setFileName(expResult);
-64 String result = instance.getFileName();
-65 assertEquals(expResult, result);
-66 }
-67
-68
-69
-70
-71 @Test
-72 public void testSetFileName() {
-73 String fileName = "file.tar" ;
-74 Dependency instance = new Dependency();
-75 instance.setFileName(fileName);
-76 assertEquals(fileName, instance.getFileName());
-77 }
-78
-79
-80
-81
-82 @Test
-83 public void testSetActualFilePath() {
-84 String actualFilePath = "file.tar" ;
-85 Dependency instance = new Dependency();
-86 instance.setActualFilePath(actualFilePath);
-87 assertEquals(actualFilePath, instance.getActualFilePath());
-88 }
-89
-90
-91
-92
-93 @Test
-94 public void testGetActualFilePath() {
-95 Dependency instance = new Dependency();
-96 String expResult = "file.tar" ;
-97 instance.setActualFilePath(expResult);
-98 String result = instance.getActualFilePath();
-99 assertEquals(expResult, result);
-100 }
-101
-102
-103
-104
-105 @Test
-106 public void testSetFilePath() {
-107 String filePath = "file.tar" ;
-108 Dependency instance = new Dependency();
-109 instance.setFilePath(filePath);
-110 assertEquals(filePath, instance.getFilePath());
-111 }
-112
-113
-114
-115
-116 @Test
-117 public void testGetFilePath() {
-118 Dependency instance = new Dependency();
-119 String expResult = "file.tar" ;
-120 instance.setFilePath(expResult);
-121 String result = instance.getFilePath();
-122 assertEquals(expResult, result);
-123 }
-124
-125
-126
-127
-128 @Test
-129 public void testSetFileExtension() {
-130 String fileExtension = "jar" ;
-131 Dependency instance = new Dependency();
-132 instance.setFileExtension(fileExtension);
-133 assertEquals(fileExtension, instance.getFileExtension());
-134 }
-135
-136
-137
-138
-139 @Test
-140 public void testGetFileExtension() {
-141 Dependency instance = new Dependency();
-142 String expResult = "jar" ;
-143 instance.setFileExtension(expResult);
-144 String result = instance.getFileExtension();
-145 assertEquals(expResult, result);
-146 }
-147
-148
-149
-150
-151 @Test
-152 public void testGetMd5sum() {
-153 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
-154 Dependency instance = new Dependency(file);
-155
-156 String expResult = "C30B57142E1CCBC1EFD5CD15F307358F" ;
-157 String result = instance.getMd5sum();
-158 assertEquals(expResult, result);
-159 }
-160
-161
-162
-163
-164 @Test
-165 public void testSetMd5sum() {
-166 String md5sum = "test" ;
-167 Dependency instance = new Dependency();
-168 instance.setMd5sum(md5sum);
-169 assertEquals(md5sum, instance.getMd5sum());
-170 }
-171
-172
-173
-174
-175 @Test
-176 public void testGetSha1sum() {
-177 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
-178 Dependency instance = new Dependency(file);
-179 String expResult = "89CE9E36AA9A9E03F1450936D2F4F8DD0F961F8B" ;
-180 String result = instance.getSha1sum();
-181 assertEquals(expResult, result);
-182 }
-183
-184
-185
-186
-187 @Test
-188 public void testSetSha1sum() {
-189 String sha1sum = "test" ;
-190 Dependency instance = new Dependency();
-191 instance.setSha1sum(sha1sum);
-192 assertEquals(sha1sum, instance.getSha1sum());
-193 }
-194
-195
-196
-197
-198 @Test
-199 public void testGetIdentifiers() {
-200 Dependency instance = new Dependency();
-201 List expResult = null ;
-202 Set<Identifier> result = instance.getIdentifiers();
-203
-204 assertTrue(true );
-205 }
-206
-207
-208
-209
-210 @Test
-211 public void testSetIdentifiers() {
-212 Set<Identifier> identifiers = null ;
-213 Dependency instance = new Dependency();
-214 instance.setIdentifiers(identifiers);
-215 assertTrue(true );
-216 }
-217
-218
-219
-220
-221 @Test
-222 public void testAddIdentifier() {
-223 String type = "cpe" ;
-224 String value = "cpe:/a:apache:struts:2.1.2" ;
-225 String url = "http://somewhere" ;
-226 Identifier expResult = new Identifier(type, value, url);
-227
-228 Dependency instance = new Dependency();
-229 instance.addIdentifier(type, value, url);
-230 assertEquals(1, instance.getIdentifiers().size());
-231 assertTrue("Identifier doesn't contain expected result." , instance.getIdentifiers().contains(expResult));
-232 }
-233
-234
-235
-236
-237 @Test
-238 public void testGetEvidence() {
-239 Dependency instance = new Dependency();
-240 EvidenceCollection expResult = null ;
-241 EvidenceCollection result = instance.getEvidence();
-242 assertTrue(true );
-243 }
-244
-245
-246
-247
-248 @Test
-249 public void testGetEvidenceUsed() {
-250 Dependency instance = new Dependency();
-251 String expResult = "used" ;
-252
-253 instance.getProductEvidence().addEvidence("used" , "used" , "used" , Confidence.HIGH);
-254 instance.getProductEvidence().addEvidence("not" , "not" , "not" , Confidence.MEDIUM);
-255 for (Evidence e : instance.getProductEvidence().iterator(Confidence.HIGH)) {
-256 String use = e.getValue();
-257 }
-258
-259 EvidenceCollection result = instance.getEvidenceUsed();
+26 import static org.junit.Assert.assertFalse;
+27 import static org.junit.Assert.assertTrue;
+28 import org.junit.Before;
+29 import org.junit.BeforeClass;
+30 import org.junit.Test;
+31 import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+32
+33
+34
+35
+36
+37 public class DependencyTest {
+38
+39 public DependencyTest () {
+40 }
+41
+42 @BeforeClass
+43 public static void setUpClass() throws Exception {
+44 }
+45
+46 @AfterClass
+47 public static void tearDownClass() throws Exception {
+48 }
+49
+50 @Before
+51 public void setUp() {
+52 }
+53
+54 @After
+55 public void tearDown() {
+56 }
+57
+58
+59
+60
+61 @Test
+62 public void testGetFileName() {
+63 Dependency instance = new Dependency();
+64 String expResult = "filename" ;
+65 instance.setFileName(expResult);
+66 String result = instance.getFileName();
+67 assertEquals(expResult, result);
+68 }
+69
+70
+71
+72
+73 @Test
+74 public void testSetFileName() {
+75 String fileName = "file.tar" ;
+76 Dependency instance = new Dependency();
+77 instance.setFileName(fileName);
+78 assertEquals(fileName, instance.getFileName());
+79 }
+80
+81
+82
+83
+84 @Test
+85 public void testSetActualFilePath() {
+86 String actualFilePath = "file.tar" ;
+87 Dependency instance = new Dependency();
+88 instance.setActualFilePath(actualFilePath);
+89 assertEquals(actualFilePath, instance.getActualFilePath());
+90 }
+91
+92
+93
+94
+95 @Test
+96 public void testGetActualFilePath() {
+97 Dependency instance = new Dependency();
+98 String expResult = "file.tar" ;
+99 instance.setActualFilePath(expResult);
+100 String result = instance.getActualFilePath();
+101 assertEquals(expResult, result);
+102 }
+103
+104
+105
+106
+107 @Test
+108 public void testSetFilePath() {
+109 String filePath = "file.tar" ;
+110 Dependency instance = new Dependency();
+111 instance.setFilePath(filePath);
+112 assertEquals(filePath, instance.getFilePath());
+113 }
+114
+115
+116
+117
+118 @Test
+119 public void testGetFilePath() {
+120 Dependency instance = new Dependency();
+121 String expResult = "file.tar" ;
+122 instance.setFilePath(expResult);
+123 String result = instance.getFilePath();
+124 assertEquals(expResult, result);
+125 }
+126
+127
+128
+129
+130 @Test
+131 public void testSetFileExtension() {
+132 String fileExtension = "jar" ;
+133 Dependency instance = new Dependency();
+134 instance.setFileExtension(fileExtension);
+135 assertEquals(fileExtension, instance.getFileExtension());
+136 }
+137
+138
+139
+140
+141 @Test
+142 public void testGetFileExtension() {
+143 Dependency instance = new Dependency();
+144 String expResult = "jar" ;
+145 instance.setFileExtension(expResult);
+146 String result = instance.getFileExtension();
+147 assertEquals(expResult, result);
+148 }
+149
+150
+151
+152
+153 @Test
+154 public void testGetMd5sum() {
+155 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
+156 Dependency instance = new Dependency(file);
+157
+158 String expResult = "C30B57142E1CCBC1EFD5CD15F307358F" ;
+159 String result = instance.getMd5sum();
+160 assertEquals(expResult, result);
+161 }
+162
+163
+164
+165
+166 @Test
+167 public void testSetMd5sum() {
+168 String md5sum = "test" ;
+169 Dependency instance = new Dependency();
+170 instance.setMd5sum(md5sum);
+171 assertEquals(md5sum, instance.getMd5sum());
+172 }
+173
+174
+175
+176
+177 @Test
+178 public void testGetSha1sum() {
+179 File file = new File(this .getClass().getClassLoader().getResource("struts2-core-2.1.2.jar" ).getPath());
+180 Dependency instance = new Dependency(file);
+181 String expResult = "89CE9E36AA9A9E03F1450936D2F4F8DD0F961F8B" ;
+182 String result = instance.getSha1sum();
+183 assertEquals(expResult, result);
+184 }
+185
+186
+187
+188
+189 @Test
+190 public void testSetSha1sum() {
+191 String sha1sum = "test" ;
+192 Dependency instance = new Dependency();
+193 instance.setSha1sum(sha1sum);
+194 assertEquals(sha1sum, instance.getSha1sum());
+195 }
+196
+197
+198
+199
+200 @Test
+201 public void testGetIdentifiers() {
+202 Dependency instance = new Dependency();
+203 List expResult = null ;
+204 Set<Identifier> result = instance.getIdentifiers();
+205
+206 assertTrue(true );
+207 }
+208
+209
+210
+211
+212 @Test
+213 public void testSetIdentifiers() {
+214 Set<Identifier> identifiers = null ;
+215 Dependency instance = new Dependency();
+216 instance.setIdentifiers(identifiers);
+217 assertTrue(true );
+218 }
+219
+220
+221
+222
+223 @Test
+224 public void testAddIdentifier() {
+225 String type = "cpe" ;
+226 String value = "cpe:/a:apache:struts:2.1.2" ;
+227 String url = "http://somewhere" ;
+228 Identifier expResult = new Identifier(type, value, url);
+229
+230 Dependency instance = new Dependency();
+231 instance.addIdentifier(type, value, url);
+232 assertEquals(1, instance.getIdentifiers().size());
+233 assertTrue("Identifier doesn't contain expected result." , instance.getIdentifiers().contains(expResult));
+234 }
+235
+236
+237
+238
+239 @Test
+240 public void testGetEvidence() {
+241 Dependency instance = new Dependency();
+242 EvidenceCollection expResult = null ;
+243 EvidenceCollection result = instance.getEvidence();
+244 assertTrue(true );
+245 }
+246
+247
+248
+249
+250 @Test
+251 public void testGetEvidenceUsed() {
+252 Dependency instance = new Dependency();
+253 String expResult = "used" ;
+254
+255 instance.getProductEvidence().addEvidence("used" , "used" , "used" , Confidence.HIGH);
+256 instance.getProductEvidence().addEvidence("not" , "not" , "not" , Confidence.MEDIUM);
+257 for (Evidence e : instance.getProductEvidence().iterator(Confidence.HIGH)) {
+258 String use = e.getValue();
+259 }
260
-261 assertEquals(1, result.size());
-262 assertTrue(result.containsUsedString(expResult));
-263 }
-264
-265
-266
-267
-268 @Test
-269 public void testGetVendorEvidence() {
-270 Dependency instance = new Dependency();
-271 EvidenceCollection expResult = null ;
-272 EvidenceCollection result = instance.getVendorEvidence();
-273 assertTrue(true );
-274 }
-275
-276
-277
-278
-279 @Test
-280 public void testGetProductEvidence() {
-281 Dependency instance = new Dependency();
-282 EvidenceCollection expResult = null ;
-283 EvidenceCollection result = instance.getProductEvidence();
-284 assertTrue(true );
-285 }
-286
-287
-288
-289
-290 @Test
-291 public void testGetVersionEvidence() {
-292 Dependency instance = new Dependency();
-293 EvidenceCollection expResult = null ;
-294 EvidenceCollection result = instance.getVersionEvidence();
-295 assertTrue(true );
-296 }
-297 }
+261 EvidenceCollection result = instance.getEvidenceUsed();
+262
+263 assertEquals(1, result.size());
+264 assertTrue(result.containsUsedString(expResult));
+265 }
+266
+267
+268
+269
+270 @Test
+271 public void testGetVendorEvidence() {
+272 Dependency instance = new Dependency();
+273 EvidenceCollection expResult = null ;
+274 EvidenceCollection result = instance.getVendorEvidence();
+275 assertTrue(true );
+276 }
+277
+278
+279
+280
+281 @Test
+282 public void testGetProductEvidence() {
+283 Dependency instance = new Dependency();
+284 EvidenceCollection expResult = null ;
+285 EvidenceCollection result = instance.getProductEvidence();
+286 assertTrue(true );
+287 }
+288
+289
+290
+291
+292 @Test
+293 public void testGetVersionEvidence() {
+294 Dependency instance = new Dependency();
+295 EvidenceCollection expResult = null ;
+296 EvidenceCollection result = instance.getVersionEvidence();
+297 assertTrue(true );
+298 }
+299
+300
+301
+302
+303 @Test
+304 public void testAddAsEvidence() {
+305 Dependency instance = new Dependency();
+306 MavenArtifact mavenArtifact = new MavenArtifact("group" , "artifact" , "version" , "url" );
+307 instance.addAsEvidence("pom" , mavenArtifact, Confidence.HIGH);
+308 assertTrue(instance.getEvidence().contains(Confidence.HIGH));
+309 assertFalse(instance.getEvidence().getEvidence("pom" , "groupid" ).isEmpty());
+310 assertFalse(instance.getEvidence().getEvidence("pom" , "artifactid" ).isEmpty());
+311 assertFalse(instance.getEvidence().getEvidence("pom" , "version" ).isEmpty());
+312 assertFalse(instance.getIdentifiers().isEmpty());
+313 }
+314
+315
+316
+317
+318 @Test
+319 public void testAddAsEvidenceWithEmptyArtefact() {
+320 Dependency instance = new Dependency();
+321 MavenArtifact mavenArtifact = new MavenArtifact(null , null , null , null );
+322 instance.addAsEvidence("pom" , mavenArtifact, Confidence.HIGH);
+323 assertFalse(instance.getEvidence().contains(Confidence.HIGH));
+324 assertTrue(instance.getEvidence().getEvidence("pom" , "groupid" ).isEmpty());
+325 assertTrue(instance.getEvidence().getEvidence("pom" , "artifactid" ).isEmpty());
+326 assertTrue(instance.getEvidence().getEvidence("pom" , "version" ).isEmpty());
+327 assertTrue(instance.getIdentifiers().isEmpty());
+328 }
+329 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html
index 3fc08ba78..570d6c96c 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html
index 927ec0f2a..7f5eb6caa 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/dependency/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html
index 22eb6dcce..aec93b7c2 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html
index 8df6b8874..d087cc76a 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html
index 480a9e72d..6f7abcd12 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html
index 68b24947b..a78ddfa7e 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/reporting/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-frame.html
index 094e59d01..72650ffbb 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.suppression
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.suppression
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-summary.html
index 3f8ca7a60..66fd0feac 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/suppression/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.suppression
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.suppression
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionTest.html
index 9842c1845..7b441bf17 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionTest.html
@@ -173,28 +173,36 @@
165 version = new DependencyVersion("1.2.3.1" );
166 assertEquals(-1, instance.compareTo(version));
167
-168 DependencyVersion[] dv = new DependencyVersion[7];
-169 dv[0] = new DependencyVersion("2.1.3" );
-170 dv[1] = new DependencyVersion("2.1.3.r2" );
-171 dv[2] = new DependencyVersion("2.1.3.r1" );
-172 dv[3] = new DependencyVersion("1.2.3.1" );
-173 dv[4] = new DependencyVersion("1.2.3" );
-174 dv[5] = new DependencyVersion("2" );
-175 dv[6] = new DependencyVersion("-" );
-176
-177 DependencyVersion[] expected = new DependencyVersion[7];
-178 expected[0] = new DependencyVersion("-" );
-179 expected[1] = new DependencyVersion("1.2.3" );
-180 expected[2] = new DependencyVersion("1.2.3.1" );
-181 expected[3] = new DependencyVersion("2" );
-182 expected[4] = new DependencyVersion("2.1.3" );
-183 expected[5] = new DependencyVersion("2.1.3.r1" );
-184 expected[6] = new DependencyVersion("2.1.3.r2" );
-185 java.util.Arrays.sort(dv);
-186
-187 assertArrayEquals(expected, dv);
-188 }
-189 }
+168 instance = new DependencyVersion("1.0.1n" );
+169 version = new DependencyVersion("1.0.1m" );
+170 assertEquals(1, instance.compareTo(version));
+171 version = new DependencyVersion("1.0.1n" );
+172 assertEquals(0, instance.compareTo(version));
+173 version = new DependencyVersion("1.0.1o" );
+174 assertEquals(-1, instance.compareTo(version));
+175
+176 DependencyVersion[] dv = new DependencyVersion[7];
+177 dv[0] = new DependencyVersion("2.1.3" );
+178 dv[1] = new DependencyVersion("2.1.3.r2" );
+179 dv[2] = new DependencyVersion("2.1.3.r1" );
+180 dv[3] = new DependencyVersion("1.2.3.1" );
+181 dv[4] = new DependencyVersion("1.2.3" );
+182 dv[5] = new DependencyVersion("2" );
+183 dv[6] = new DependencyVersion("-" );
+184
+185 DependencyVersion[] expected = new DependencyVersion[7];
+186 expected[0] = new DependencyVersion("-" );
+187 expected[1] = new DependencyVersion("1.2.3" );
+188 expected[2] = new DependencyVersion("1.2.3.1" );
+189 expected[3] = new DependencyVersion("2" );
+190 expected[4] = new DependencyVersion("2.1.3" );
+191 expected[5] = new DependencyVersion("2.1.3.r1" );
+192 expected[6] = new DependencyVersion("2.1.3.r2" );
+193 java.util.Arrays.sort(dv);
+194
+195 assertArrayEquals(expected, dv);
+196 }
+197 }
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionUtilTest.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionUtilTest.html
index 2d2a06302..022eca57e 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionUtilTest.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/DependencyVersionUtilTest.html
@@ -62,13 +62,13 @@
54
55
56 @Test
-57 public void testParseVersionFromFileName() {
+57 public void testParseVersion() {
58 final String[] fileName = {"something-0.9.5.jar" , "lib2-1.1.jar" , "lib1.5r4-someflag-R26.jar" ,
59 "lib-1.2.5-dev-20050313.jar" , "testlib_V4.4.0.jar" , "lib-core-2.0.0-RC1-SNAPSHOT.jar" ,
60 "lib-jsp-2.0.1_R114940.jar" , "dev-api-2.3.11_R121413.jar" , "lib-api-3.7-SNAPSHOT.jar" ,
-61 "-" , "" , "1.3-beta" , "6" };
+61 "-" , "" , "1.3-beta" , "6" , "openssl1.0.1c" , "jsf-impl-2.2.8-02.jar" };
62 final String[] expResult = {"0.9.5" , "1.1" , "1.5.r4" , "1.2.5" , "4.4.0" , "2.0.0.rc1" ,
-63 "2.0.1.r114940" , "2.3.11.r121413" , "3.7" , "-" , null , "1.3.beta" , "6" };
+63 "2.0.1.r114940" , "2.3.11.r121413" , "3.7" , "-" , null , "1.3.beta" , "6" , "1.0.1c" , "2.2.8.02" };
64
65 for (int i = 0; i < fileName.length; i++) {
66 final DependencyVersion version = DependencyVersionUtil.parseVersion(fileName[i]);
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html
index 2f4cfd696..f9317d4a0 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html
index 3c02ba0a8..a4b45f99f 100644
--- a/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html
+++ b/dependency-check-core/xref-test/org/owasp/dependencycheck/utils/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref-test/overview-frame.html b/dependency-check-core/xref-test/overview-frame.html
index b3a9b883b..a5830d8e9 100644
--- a/dependency-check-core/xref-test/overview-frame.html
+++ b/dependency-check-core/xref-test/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
@@ -20,6 +20,9 @@
org.owasp.dependencycheck.analyzer
+
+
+ org.owasp.dependencycheck.data.central
org.owasp.dependencycheck.data.cpe
@@ -41,6 +44,9 @@
org.owasp.dependencycheck.data.update
+
+
+ org.owasp.dependencycheck.data.update.task
org.owasp.dependencycheck.data.update.xml
diff --git a/dependency-check-core/xref-test/overview-summary.html b/dependency-check-core/xref-test/overview-summary.html
index d1af66637..2edda9873 100644
--- a/dependency-check-core/xref-test/overview-summary.html
+++ b/dependency-check-core/xref-test/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
@@ -42,6 +42,11 @@
org.owasp.dependencycheck.analyzer
+
+
+
+ org.owasp.dependencycheck.data.central
+
@@ -77,6 +82,11 @@
org.owasp.dependencycheck.data.update
+
+
+
+ org.owasp.dependencycheck.data.update.task
+
diff --git a/dependency-check-core/xref/allclasses-frame.html b/dependency-check-core/xref/allclasses-frame.html
index 2acc71243..4b234079a 100644
--- a/dependency-check-core/xref/allclasses-frame.html
+++ b/dependency-check-core/xref/allclasses-frame.html
@@ -70,6 +70,12 @@
CachedWebDataSource
+
+
+ CentralAnalyzer
+
+
+ CentralSearch
CiManagement
diff --git a/dependency-check-core/xref/index.html b/dependency-check-core/xref/index.html
index 5151839d8..af28ffc0a 100644
--- a/dependency-check-core/xref/index.html
+++ b/dependency-check-core/xref/index.html
@@ -4,7 +4,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html b/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html
index 4d4039934..e95ef55e8 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/Engine.html
@@ -70,11 +70,11 @@
62
63
64
-65 private transient final EnumMap<AnalysisPhase, List<Analyzer>> analyzers;
+65 private final transient EnumMap<AnalysisPhase, List<Analyzer>> analyzers;
66
67
68
-69 private transient final Set<FileTypeAnalyzer> fileTypeAnalyzers;
+69 private final transient Set<FileTypeAnalyzer> fileTypeAnalyzers;
70
71
72
@@ -82,7 +82,7 @@
74
75
76
-77 private transient static final Logger LOGGER = Logger.getLogger(Engine.class .getName());
+77 private static final transient Logger LOGGER = Logger.getLogger(Engine.class .getName());
78
79
80
@@ -176,342 +176,370 @@
168
169
170
-171
-172
-173
-174
-175 public void scan(String[] paths) {
-176 for (String path : paths) {
-177 final File file = new File(path);
-178 scan(file);
-179 }
-180 }
-181
-182
-183
-184
-185
-186
-187
-188 public void scan(String path) {
-189 if (path.matches("^.*[\\/]\\*\\.[^\\/:*|?<>\"]+$" )) {
-190 final String[] parts = path.split("\\*\\." );
-191 final String[] ext = new String[]{parts[parts.length - 1]};
-192 final File dir = new File(path.substring(0, path.length() - ext[0].length() - 2));
-193 if (dir.isDirectory()) {
-194 final List<File> files = (List<File>) org.apache.commons.io.FileUtils.listFiles(dir, ext, true );
-195 scan(files);
-196 } else {
-197 final String msg = String.format("Invalid file path provided to scan '%s'" , path);
-198 LOGGER.log(Level.SEVERE, msg);
-199 }
-200 } else {
-201 final File file = new File(path);
-202 scan(file);
-203 }
-204 }
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214 public void scan(File[] files) {
-215 for (File file : files) {
-216 scan(file);
-217 }
+171
+172
+173
+174
+175
+176 public List<Dependency> scan(String[] paths) {
+177 final List<Dependency> deps = new ArrayList<Dependency>();
+178 for (String path : paths) {
+179 final File file = new File(path);
+180 final List<Dependency> d = scan(file);
+181 if (d != null ) {
+182 deps.addAll(d);
+183 }
+184 }
+185 return deps;
+186 }
+187
+188
+189
+190
+191
+192
+193
+194
+195 public List<Dependency> scan(String path) {
+196 final File file = new File(path);
+197 return scan(file);
+198 }
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209 public List<Dependency> scan(File[] files) {
+210 final List<Dependency> deps = new ArrayList<Dependency>();
+211 for (File file : files) {
+212 final List<Dependency> d = scan(file);
+213 if (d != null ) {
+214 deps.addAll(d);
+215 }
+216 }
+217 return deps;
218 }
219
220
221
222
223
-224
-225
-226
-227
-228 public void scan(Set<File> files) {
-229 for (File file : files) {
-230 scan(file);
-231 }
-232 }
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242 public void scan(List<File> files) {
-243 for (File file : files) {
-244 scan(file);
-245 }
-246 }
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256 public void scan(File file) {
-257 if (file.exists()) {
-258 if (file.isDirectory()) {
-259 scanDirectory(file);
-260 } else {
-261 scanFile(file);
-262 }
-263 }
-264 }
-265
-266
-267
+224
+225
+226
+227
+228
+229 public List<Dependency> scan(Set<File> files) {
+230 final List<Dependency> deps = new ArrayList<Dependency>();
+231 for (File file : files) {
+232 final List<Dependency> d = scan(file);
+233 if (d != null ) {
+234 deps.addAll(d);
+235 }
+236 }
+237 return deps;
+238 }
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249 public List<Dependency> scan(List<File> files) {
+250 final List<Dependency> deps = new ArrayList<Dependency>();
+251 for (File file : files) {
+252 final List<Dependency> d = scan(file);
+253 if (d != null ) {
+254 deps.addAll(d);
+255 }
+256 }
+257 return deps;
+258 }
+259
+260
+261
+262
+263
+264
+265
+266
+267
268
-269
-270
-271 protected void scanDirectory(File dir) {
-272 final File[] files = dir.listFiles();
-273 if (files != null ) {
-274 for (File f : files) {
-275 if (f.isDirectory()) {
-276 scanDirectory(f);
-277 } else {
-278 scanFile(f);
-279 }
-280 }
-281 }
-282 }
-283
-284
-285
-286
-287
-288
-289 protected void scanFile(File file) {
-290 if (!file.isFile()) {
-291 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
-292 LOGGER.log(Level.FINE, msg);
-293 return ;
-294 }
-295 final String fileName = file.getName();
-296 final String extension = FileUtils.getFileExtension(fileName);
-297 if (extension != null ) {
-298 if (supportsExtension(extension)) {
-299 final Dependency dependency = new Dependency (file);
-300 dependencies.add(dependency);
-301 }
-302 } else {
-303 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." ,
-304 file.toString());
-305 LOGGER.log(Level.FINEST, msg);
-306 }
-307 }
-308
-309
-310
-311
-312 public void analyzeDependencies() {
-313
-314 try {
-315 ensureDataExists();
-316 } catch (NoDataException ex) {
-317 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
-318 LOGGER.log(Level.SEVERE, msg);
-319 LOGGER.log(Level.FINE, null , ex);
-320 return ;
-321 } catch (DatabaseException ex) {
-322 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
-323 LOGGER.log(Level.SEVERE, msg);
-324 LOGGER.log(Level.FINE, null , ex);
-325 return ;
-326
-327 }
-328
-329 final String logHeader = String.format("%n"
-330 + "----------------------------------------------------%n"
-331 + "BEGIN ANALYSIS%n"
-332 + "----------------------------------------------------" );
-333 LOGGER.log(Level.FINE, logHeader);
-334 LOGGER.log(Level.INFO, "Analysis Starting" );
-335
-336
-337 for (AnalysisPhase phase : AnalysisPhase.values()) {
-338 final List<Analyzer> analyzerList = analyzers.get(phase);
-339
-340 for (Analyzer a : analyzerList) {
-341 initializeAnalyzer(a);
-342
-343
-344
-345
-346
-347 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
-348 LOGGER.log(Level.FINE, msg);
-349 final Set<Dependency> dependencySet = new HashSet<Dependency>();
-350 dependencySet.addAll(dependencies);
-351 for (Dependency d : dependencySet) {
-352 boolean shouldAnalyze = true ;
-353 if (a instanceof FileTypeAnalyzer) {
-354 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
-355 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
-356 }
-357 if (shouldAnalyze) {
-358 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
-359 LOGGER.log(Level.FINE, msgFile);
-360 try {
-361 a.analyze(d, this );
-362 } catch (AnalysisException ex) {
-363 final String exMsg = String.format("An error occurred while analyzing '%s'." , d.getActualFilePath());
-364 LOGGER.log(Level.WARNING, exMsg);
-365 LOGGER.log(Level.FINE, "" , ex);
-366 } catch (Throwable ex) {
-367 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
-368
-369 LOGGER.log(Level.WARNING, axMsg);
-370 LOGGER.log(Level.FINE, "" , ex);
-371 }
-372 }
-373 }
-374 }
-375 }
-376 for (AnalysisPhase phase : AnalysisPhase.values()) {
-377 final List<Analyzer> analyzerList = analyzers.get(phase);
-378
-379 for (Analyzer a : analyzerList) {
-380 closeAnalyzer(a);
-381 }
-382 }
-383
-384 final String logFooter = String.format("%n"
-385 + "----------------------------------------------------%n"
-386 + "END ANALYSIS%n"
-387 + "----------------------------------------------------" );
-388 LOGGER.log(Level.FINE, logFooter);
-389 LOGGER.log(Level.INFO, "Analysis Complete" );
-390 }
-391
-392
-393
-394
-395
-396
-397 private void initializeAnalyzer(Analyzer analyzer) {
-398 try {
-399 final String msg = String.format("Initializing %s" , analyzer.getName());
-400 LOGGER.log(Level.FINE, msg);
-401 analyzer.initialize();
-402 } catch (Throwable ex) {
-403 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
-404 LOGGER.log(Level.SEVERE, msg);
-405 LOGGER.log(Level.FINE, null , ex);
-406 try {
-407 analyzer.close();
-408 } catch (Throwable ex1) {
-409 LOGGER.log(Level.FINEST, null , ex1);
+269
+270 public List<Dependency> scan(File file) {
+271 if (file.exists()) {
+272 if (file.isDirectory()) {
+273 return scanDirectory(file);
+274 } else {
+275 final Dependency d = scanFile(file);
+276 if (d != null ) {
+277 final List<Dependency> deps = new ArrayList<Dependency>();
+278 deps.add(d);
+279 return deps;
+280 }
+281 }
+282 }
+283 return null ;
+284 }
+285
+286
+287
+288
+289
+290
+291
+292 protected List<Dependency> scanDirectory(File dir) {
+293 final File[] files = dir.listFiles();
+294 final List<Dependency> deps = new ArrayList<Dependency>();
+295 if (files != null ) {
+296 for (File f : files) {
+297 if (f.isDirectory()) {
+298 final List<Dependency> d = scanDirectory(f);
+299 if (d != null ) {
+300 deps.addAll(d);
+301 }
+302 } else {
+303 final Dependency d = scanFile(f);
+304 deps.add(d);
+305 }
+306 }
+307 }
+308 return deps;
+309 }
+310
+311
+312
+313
+314
+315
+316
+317 protected Dependency scanFile(File file) {
+318 if (!file.isFile()) {
+319 final String msg = String.format("Path passed to scanFile(File) is not a file: %s. Skipping the file." , file.toString());
+320 LOGGER.log(Level.FINE, msg);
+321 return null ;
+322 }
+323 final String fileName = file.getName();
+324 final String extension = FileUtils.getFileExtension(fileName);
+325 Dependency dependency = null ;
+326 if (extension != null ) {
+327 if (supportsExtension(extension)) {
+328 dependency = new Dependency (file);
+329 dependencies.add(dependency);
+330 }
+331 } else {
+332 final String msg = String.format("No file extension found on file '%s'. The file was not analyzed." , file.toString());
+333 LOGGER.log(Level.FINEST, msg);
+334 }
+335 return dependency;
+336 }
+337
+338
+339
+340
+341 public void analyzeDependencies() {
+342
+343 try {
+344 ensureDataExists();
+345 } catch (NoDataException ex) {
+346 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+347 LOGGER.log(Level.SEVERE, msg);
+348 LOGGER.log(Level.FINE, null , ex);
+349 return ;
+350 } catch (DatabaseException ex) {
+351 final String msg = String.format("%s%n%nUnable to continue dependency-check analysis." , ex.getMessage());
+352 LOGGER.log(Level.SEVERE, msg);
+353 LOGGER.log(Level.FINE, null , ex);
+354 return ;
+355
+356 }
+357
+358 final String logHeader = String.format("%n"
+359 + "----------------------------------------------------%n"
+360 + "BEGIN ANALYSIS%n"
+361 + "----------------------------------------------------" );
+362 LOGGER.log(Level.FINE, logHeader);
+363 LOGGER.log(Level.INFO, "Analysis Starting" );
+364
+365
+366 for (AnalysisPhase phase : AnalysisPhase.values()) {
+367 final List<Analyzer> analyzerList = analyzers.get(phase);
+368
+369 for (Analyzer a : analyzerList) {
+370 initializeAnalyzer(a);
+371
+372
+373
+374
+375
+376 final String msg = String.format("Begin Analyzer '%s'" , a.getName());
+377 LOGGER.log(Level.FINE, msg);
+378 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+379 dependencySet.addAll(dependencies);
+380 for (Dependency d : dependencySet) {
+381 boolean shouldAnalyze = true ;
+382 if (a instanceof FileTypeAnalyzer) {
+383 final FileTypeAnalyzer fAnalyzer = (FileTypeAnalyzer) a;
+384 shouldAnalyze = fAnalyzer.supportsExtension(d.getFileExtension());
+385 }
+386 if (shouldAnalyze) {
+387 final String msgFile = String.format("Begin Analysis of '%s'" , d.getActualFilePath());
+388 LOGGER.log(Level.FINE, msgFile);
+389 try {
+390 a.analyze(d, this );
+391 } catch (AnalysisException ex) {
+392 final String exMsg = String.format("An error occurred while analyzing '%s'." , d.getActualFilePath());
+393 LOGGER.log(Level.WARNING, exMsg);
+394 LOGGER.log(Level.FINE, "" , ex);
+395 } catch (Throwable ex) {
+396 final String axMsg = String.format("An unexpected error occurred during analysis of '%s'" , d.getActualFilePath());
+397
+398 LOGGER.log(Level.WARNING, axMsg);
+399 LOGGER.log(Level.FINE, "" , ex);
+400 }
+401 }
+402 }
+403 }
+404 }
+405 for (AnalysisPhase phase : AnalysisPhase.values()) {
+406 final List<Analyzer> analyzerList = analyzers.get(phase);
+407
+408 for (Analyzer a : analyzerList) {
+409 closeAnalyzer(a);
410 }
411 }
-412 }
-413
-414
-415
-416
-417
-418
-419 private void closeAnalyzer(Analyzer analyzer) {
-420 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
-421 LOGGER.log(Level.FINE, msg);
-422 try {
-423 analyzer.close();
-424 } catch (Throwable ex) {
-425 LOGGER.log(Level.FINEST, null , ex);
-426 }
-427 }
-428
-429
-430
-431
-432 private void doUpdates() {
-433 final UpdateService service = new UpdateService (serviceClassLoader);
-434 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
-435 while (iterator.hasNext()) {
-436 final CachedWebDataSource source = iterator.next();
-437 try {
-438 source.update();
-439 } catch (UpdateException ex) {
-440 LOGGER.log(Level.WARNING,
-441 "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
-442 LOGGER.log(Level.FINE,
-443 String.format("Unable to update details for %s" , source.getClass().getName()), ex);
-444 }
-445 }
-446 }
-447
-448
-449
-450
-451
-452
-453 public List<Analyzer> getAnalyzers() {
-454 final List<Analyzer> ret = new ArrayList<Analyzer>();
-455 for (AnalysisPhase phase : AnalysisPhase.values()) {
-456 final List<Analyzer> analyzerList = analyzers.get(phase);
-457 ret.addAll(analyzerList);
-458 }
-459 return ret;
-460 }
-461
-462
-463
-464
-465
-466
-467
-468 public boolean supportsExtension(String ext) {
-469 if (ext == null ) {
-470 return false;
-471 }
-472 boolean scan = false;
-473 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
-474
-475
-476 scan |= a.supportsExtension(ext);
-477 }
-478 return scan;
-479 }
-480
-481
-482
-483
-484
-485
-486
-487 private void ensureDataExists() throws NoDataException, DatabaseException {
-488 final CpeMemoryIndex cpe = CpeMemoryIndex.getInstance();
-489 final CveDB cve = new CveDB ();
-490
-491 try {
-492 cve.open();
-493 cpe.open(cve);
-494 } catch (IndexException ex) {
-495 throw new NoDataException (ex.getMessage(), ex);
-496 } catch (DatabaseException ex) {
-497 throw new NoDataException (ex.getMessage(), ex);
-498 } finally {
-499 cve.close();
-500 }
-501 if (cpe.numDocs() <= 0) {
-502 cpe.close();
-503 throw new NoDataException ("No documents exist" );
-504 }
-505 }
-506 }
+412
+413 final String logFooter = String.format("%n"
+414 + "----------------------------------------------------%n"
+415 + "END ANALYSIS%n"
+416 + "----------------------------------------------------" );
+417 LOGGER.log(Level.FINE, logFooter);
+418 LOGGER.log(Level.INFO, "Analysis Complete" );
+419 }
+420
+421
+422
+423
+424
+425
+426 private void initializeAnalyzer(Analyzer analyzer) {
+427 try {
+428 final String msg = String.format("Initializing %s" , analyzer.getName());
+429 LOGGER.log(Level.FINE, msg);
+430 analyzer.initialize();
+431 } catch (Throwable ex) {
+432 final String msg = String.format("Exception occurred initializing %s." , analyzer.getName());
+433 LOGGER.log(Level.SEVERE, msg);
+434 LOGGER.log(Level.FINE, null , ex);
+435 try {
+436 analyzer.close();
+437 } catch (Throwable ex1) {
+438 LOGGER.log(Level.FINEST, null , ex1);
+439 }
+440 }
+441 }
+442
+443
+444
+445
+446
+447
+448 private void closeAnalyzer(Analyzer analyzer) {
+449 final String msg = String.format("Closing Analyzer '%s'" , analyzer.getName());
+450 LOGGER.log(Level.FINE, msg);
+451 try {
+452 analyzer.close();
+453 } catch (Throwable ex) {
+454 LOGGER.log(Level.FINEST, null , ex);
+455 }
+456 }
+457
+458
+459
+460
+461 private void doUpdates() {
+462 final UpdateService service = new UpdateService (serviceClassLoader);
+463 final Iterator<CachedWebDataSource> iterator = service.getDataSources();
+464 while (iterator.hasNext()) {
+465 final CachedWebDataSource source = iterator.next();
+466 try {
+467 source.update();
+468 } catch (UpdateException ex) {
+469 LOGGER.log(Level.WARNING,
+470 "Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities." );
+471 LOGGER.log(Level.FINE, String.format("Unable to update details for %s" , source.getClass().getName()), ex);
+472 }
+473 }
+474 }
+475
+476
+477
+478
+479
+480
+481 public List<Analyzer> getAnalyzers() {
+482 final List<Analyzer> ret = new ArrayList<Analyzer>();
+483 for (AnalysisPhase phase : AnalysisPhase.values()) {
+484 final List<Analyzer> analyzerList = analyzers.get(phase);
+485 ret.addAll(analyzerList);
+486 }
+487 return ret;
+488 }
+489
+490
+491
+492
+493
+494
+495
+496 public boolean supportsExtension(String ext) {
+497 if (ext == null ) {
+498 return false;
+499 }
+500 boolean scan = false;
+501 for (FileTypeAnalyzer a : this .fileTypeAnalyzers) {
+502
+503
+504 scan |= a.supportsExtension(ext);
+505 }
+506 return scan;
+507 }
+508
+509
+510
+511
+512
+513
+514
+515 private void ensureDataExists() throws NoDataException, DatabaseException {
+516 final CpeMemoryIndex cpe = CpeMemoryIndex.getInstance();
+517 final CveDB cve = new CveDB ();
+518
+519 try {
+520 cve.open();
+521 cpe.open(cve);
+522 } catch (IndexException ex) {
+523 throw new NoDataException (ex.getMessage(), ex);
+524 } catch (DatabaseException ex) {
+525 throw new NoDataException (ex.getMessage(), ex);
+526 } finally {
+527 cve.close();
+528 }
+529 if (cpe.numDocs() <= 0) {
+530 cpe.close();
+531 throw new NoDataException ("No documents exist" );
+532 }
+533 }
+534 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-frame.html
index 44045661c..e05497be0 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.agent
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.agent
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-summary.html
index 6f82bb9c6..2d8fe026f 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/agent/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.agent
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.agent
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html
index 51bf73a16..2f94a7c27 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.html
@@ -118,7 +118,7 @@
110 static {
111 final String additionalZipExt = Settings.getString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS);
112 if (additionalZipExt != null ) {
-113 final HashSet ext = new HashSet<String>(Arrays.asList(additionalZipExt));
+113 final HashSet<String> ext = new HashSet<String>(Arrays.asList(additionalZipExt));
114 ZIPPABLES.addAll(ext);
115 }
116 EXTENSIONS.addAll(ZIPPABLES);
@@ -194,7 +194,7 @@
186 if (tempFileLocation != null && tempFileLocation.exists()) {
187 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
188 final boolean success = FileUtils.delete(tempFileLocation);
-189 if (!success && tempFileLocation != null & tempFileLocation.exists()) {
+189 if (!success && tempFileLocation != null && tempFileLocation.exists() && tempFileLocation.list().length > 0) {
190 LOGGER.log(Level.WARNING, "Failed to delete some temporary files, see the log for more details" );
191 }
192 }
@@ -229,273 +229,272 @@
221 final String displayPath = String.format("%s%s" ,
222 dependency.getFilePath(),
223 d.getActualFilePath().substring(tmpDir.getAbsolutePath().length()));
-224 final String displayName = String.format("%s%s%s" ,
+224 final String displayName = String.format("%s: %s" ,
225 dependency.getFileName(),
-226 File.separator,
-227 d.getFileName());
-228 d.setFilePath(displayPath);
-229 d.setFileName(displayName);
-230
-231
-232
-233 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
-234 scanDepth += 1;
-235 analyze(d, engine);
-236 scanDepth -= 1;
-237 }
-238 }
-239 }
-240 if (this .REMOVE_FROM_ANALYSIS.contains(dependency.getFileExtension())) {
-241 if ("zip" .equals(dependency.getFileExtension()) && isZipFileActuallyJarFile(dependency)) {
-242 final File tdir = getNextTempDirectory();
-243 final String fileName = dependency.getFileName();
-244
-245 LOGGER.info(String.format("The zip file '%s' appears to be a JAR file, making a copy and analyzing it as a JAR." , fileName));
-246
-247 final File tmpLoc = new File(tdir, fileName.substring(0, fileName.length() - 3) + "jar" );
-248 try {
-249 org.apache.commons.io.FileUtils.copyFile(tdir, tmpLoc);
-250 dependencies = new ArrayList<Dependency>(engine.getDependencies());
-251 engine.scan(tmpLoc);
-252 newDependencies = engine.getDependencies();
-253 if (dependencies.size() != newDependencies.size()) {
-254
-255 final Set<Dependency> dependencySet = new HashSet<Dependency>();
-256 dependencySet.addAll(newDependencies);
-257 dependencySet.removeAll(dependencies);
-258 if (dependencySet.size() != 1) {
-259 LOGGER.info("Deep copy of ZIP to JAR file resulted in more then one dependency?" );
-260 }
-261 for (Dependency d : dependencySet) {
-262
-263 d.setFilePath(dependency.getFilePath());
-264 d.setDisplayFileName(dependency.getFileName());
-265 }
-266 }
-267 } catch (IOException ex) {
-268 final String msg = String.format("Unable to perform deep copy on '%s'" , dependency.getActualFile().getPath());
-269 LOGGER.log(Level.FINE, msg, ex);
-270 }
-271 }
-272 engine.getDependencies().remove(dependency);
-273 }
-274 Collections.sort(engine.getDependencies());
-275 }
-276
-277
-278
-279
-280
-281
-282
-283 private File getNextTempDirectory() throws AnalysisException {
-284 dirCount += 1;
-285 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
-286
-287 if (directory.exists()) {
-288 return getNextTempDirectory();
-289 }
-290 if (!directory.mkdirs()) {
-291 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
-292 throw new AnalysisException (msg);
-293 }
-294 return directory;
-295 }
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305 private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
-306 if (archive == null || destination == null ) {
-307 return ;
-308 }
-309
-310 FileInputStream fis = null ;
-311 try {
-312 fis = new FileInputStream(archive);
-313 } catch (FileNotFoundException ex) {
-314 LOGGER.log(Level.FINE, null , ex);
-315 throw new AnalysisException ("Archive file was not found." , ex);
-316 }
-317 final String archiveExt = FileUtils.getFileExtension(archive.getName()).toLowerCase();
-318 try {
-319 if (ZIPPABLES.contains(archiveExt)) {
-320 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
-321 } else if ("tar" .equals(archiveExt)) {
-322 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
-323 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
-324 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
-325 final String uncompressedExt = FileUtils.getFileExtension(uncompressedName).toLowerCase();
-326 if (engine.supportsExtension(uncompressedExt)) {
-327 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
-328 }
-329 }
-330 } catch (ArchiveExtractionException ex) {
-331 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
-332 LOGGER.log(Level.WARNING, msg);
-333 LOGGER.log(Level.FINE, null , ex);
-334 } catch (IOException ex) {
-335 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
-336 LOGGER.log(Level.WARNING, msg);
-337 LOGGER.log(Level.FINE, null , ex);
-338 } finally {
-339 try {
-340 fis.close();
-341 } catch (IOException ex) {
-342 LOGGER.log(Level.FINEST, null , ex);
-343 }
-344 }
-345 }
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355 private void extractArchive(ArchiveInputStream input, File destination, Engine engine) throws ArchiveExtractionException {
-356 ArchiveEntry entry;
-357 try {
-358 while ((entry = input.getNextEntry()) != null ) {
-359 if (entry.isDirectory()) {
-360 final File d = new File(destination, entry.getName());
-361 if (!d.exists()) {
-362 if (!d.mkdirs()) {
-363 final String msg = String.format("Unable to create directory '%s'." , d.getAbsolutePath());
-364 throw new AnalysisException (msg);
-365 }
-366 }
-367 } else {
-368 final File file = new File(destination, entry.getName());
-369 final String ext = FileUtils.getFileExtension(file.getName());
-370 if (engine.supportsExtension(ext)) {
-371 BufferedOutputStream bos = null ;
-372 FileOutputStream fos;
-373 try {
-374 final File parent = file.getParentFile();
-375 if (!parent.isDirectory()) {
-376 if (!parent.mkdirs()) {
-377 final String msg = String.format("Unable to build directory '%s'." , parent.getAbsolutePath());
-378 throw new AnalysisException (msg);
-379 }
-380 }
-381 fos = new FileOutputStream(file);
-382 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
-383 int count;
-384 final byte data[] = new byte[BUFFER_SIZE];
-385 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
-386 bos.write(data, 0, count);
-387 }
-388 bos.flush();
-389 } catch (FileNotFoundException ex) {
-390 LOGGER.log(Level.FINE, null , ex);
-391 final String msg = String.format("Unable to find file '%s'." , file.getName());
-392 throw new AnalysisException (msg, ex);
-393 } catch (IOException ex) {
-394 LOGGER.log(Level.FINE, null , ex);
-395 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
-396 throw new AnalysisException (msg, ex);
-397 } finally {
-398 if (bos != null ) {
-399 try {
-400 bos.close();
-401 } catch (IOException ex) {
-402 LOGGER.log(Level.FINEST, null , ex);
-403 }
-404 }
-405 }
-406 }
-407 }
-408 }
-409 } catch (IOException ex) {
-410 throw new ArchiveExtractionException (ex);
-411 } catch (Throwable ex) {
-412 throw new ArchiveExtractionException (ex);
-413 } finally {
-414 if (input != null ) {
-415 try {
-416 input.close();
-417 } catch (IOException ex) {
-418 LOGGER.log(Level.FINEST, null , ex);
-419 }
-420 }
-421 }
-422 }
-423
-424
-425
-426
-427
-428
-429
-430
-431 private void decompressFile(CompressorInputStream inputStream, File outputFile) throws ArchiveExtractionException {
-432 FileOutputStream out = null ;
-433 try {
-434 out = new FileOutputStream(outputFile);
-435 final byte[] buffer = new byte[BUFFER_SIZE];
-436 int n = 0;
-437 while (-1 != (n = inputStream.read(buffer))) {
-438 out.write(buffer, 0, n);
-439 }
-440 } catch (FileNotFoundException ex) {
-441 LOGGER.log(Level.FINE, null , ex);
-442 throw new ArchiveExtractionException (ex);
-443 } catch (IOException ex) {
-444 LOGGER.log(Level.FINE, null , ex);
-445 throw new ArchiveExtractionException (ex);
-446 } finally {
-447 if (out != null ) {
-448 try {
-449 out.close();
-450 } catch (IOException ex) {
-451 LOGGER.log(Level.FINEST, null , ex);
-452 }
-453 }
-454 }
-455 }
-456
-457
-458
-459
-460
-461
-462
-463 private boolean isZipFileActuallyJarFile(Dependency dependency) {
-464 boolean isJar = false;
-465 ZipFile zip = null ;
-466 try {
-467 zip = new ZipFile(dependency.getActualFilePath());
-468 if (zip.getEntry("META-INF/MANIFEST.MF" ) != null
-469 || zip.getEntry("META-INF/maven" ) != null ) {
-470 final Enumeration<ZipArchiveEntry> entries = zip.getEntries();
-471 while (entries.hasMoreElements()) {
-472 final ZipArchiveEntry entry = entries.nextElement();
-473 if (!entry.isDirectory()) {
-474 final String name = entry.getName().toLowerCase();
-475 if (name.endsWith(".class" )) {
-476 isJar = true ;
-477 break ;
-478 }
-479 }
-480 }
-481 }
-482 } catch (IOException ex) {
-483 LOGGER.log(Level.FINE, String.format("Unable to unzip zip file '%s'" , dependency.getFilePath()), ex);
-484 } finally {
-485 ZipFile.closeQuietly(zip);
-486 }
-487
-488 return isJar;
-489 }
-490 }
+226 d.getFileName());
+227 d.setFilePath(displayPath);
+228 d.setFileName(displayName);
+229
+230
+231
+232 if (this .supportsExtension(d.getFileExtension()) && scanDepth < MAX_SCAN_DEPTH) {
+233 scanDepth += 1;
+234 analyze(d, engine);
+235 scanDepth -= 1;
+236 }
+237 }
+238 }
+239 if (this .REMOVE_FROM_ANALYSIS.contains(dependency.getFileExtension())) {
+240 if ("zip" .equals(dependency.getFileExtension()) && isZipFileActuallyJarFile(dependency)) {
+241 final File tdir = getNextTempDirectory();
+242 final String fileName = dependency.getFileName();
+243
+244 LOGGER.info(String.format("The zip file '%s' appears to be a JAR file, making a copy and analyzing it as a JAR." , fileName));
+245
+246 final File tmpLoc = new File(tdir, fileName.substring(0, fileName.length() - 3) + "jar" );
+247 try {
+248 org.apache.commons.io.FileUtils.copyFile(tdir, tmpLoc);
+249 dependencies = new ArrayList<Dependency>(engine.getDependencies());
+250 engine.scan(tmpLoc);
+251 newDependencies = engine.getDependencies();
+252 if (dependencies.size() != newDependencies.size()) {
+253
+254 final Set<Dependency> dependencySet = new HashSet<Dependency>();
+255 dependencySet.addAll(newDependencies);
+256 dependencySet.removeAll(dependencies);
+257 if (dependencySet.size() != 1) {
+258 LOGGER.info("Deep copy of ZIP to JAR file resulted in more then one dependency?" );
+259 }
+260 for (Dependency d : dependencySet) {
+261
+262 d.setFilePath(dependency.getFilePath());
+263 d.setDisplayFileName(dependency.getFileName());
+264 }
+265 }
+266 } catch (IOException ex) {
+267 final String msg = String.format("Unable to perform deep copy on '%s'" , dependency.getActualFile().getPath());
+268 LOGGER.log(Level.FINE, msg, ex);
+269 }
+270 }
+271 engine.getDependencies().remove(dependency);
+272 }
+273 Collections.sort(engine.getDependencies());
+274 }
+275
+276
+277
+278
+279
+280
+281
+282 private File getNextTempDirectory() throws AnalysisException {
+283 dirCount += 1;
+284 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+285
+286 if (directory.exists()) {
+287 return getNextTempDirectory();
+288 }
+289 if (!directory.mkdirs()) {
+290 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+291 throw new AnalysisException (msg);
+292 }
+293 return directory;
+294 }
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304 private void extractFiles(File archive, File destination, Engine engine) throws AnalysisException {
+305 if (archive == null || destination == null ) {
+306 return ;
+307 }
+308
+309 FileInputStream fis = null ;
+310 try {
+311 fis = new FileInputStream(archive);
+312 } catch (FileNotFoundException ex) {
+313 LOGGER.log(Level.FINE, null , ex);
+314 throw new AnalysisException ("Archive file was not found." , ex);
+315 }
+316 final String archiveExt = FileUtils.getFileExtension(archive.getName()).toLowerCase();
+317 try {
+318 if (ZIPPABLES.contains(archiveExt)) {
+319 extractArchive(new ZipArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+320 } else if ("tar" .equals(archiveExt)) {
+321 extractArchive(new TarArchiveInputStream(new BufferedInputStream(fis)), destination, engine);
+322 } else if ("gz" .equals(archiveExt) || "tgz" .equals(archiveExt)) {
+323 final String uncompressedName = GzipUtils.getUncompressedFilename(archive.getName());
+324 final String uncompressedExt = FileUtils.getFileExtension(uncompressedName).toLowerCase();
+325 if (engine.supportsExtension(uncompressedExt)) {
+326 decompressFile(new GzipCompressorInputStream(new BufferedInputStream(fis)), new File(destination, uncompressedName));
+327 }
+328 }
+329 } catch (ArchiveExtractionException ex) {
+330 final String msg = String.format("Exception extracting archive '%s'." , archive.getName());
+331 LOGGER.log(Level.WARNING, msg);
+332 LOGGER.log(Level.FINE, null , ex);
+333 } catch (IOException ex) {
+334 final String msg = String.format("Exception reading archive '%s'." , archive.getName());
+335 LOGGER.log(Level.WARNING, msg);
+336 LOGGER.log(Level.FINE, null , ex);
+337 } finally {
+338 try {
+339 fis.close();
+340 } catch (IOException ex) {
+341 LOGGER.log(Level.FINEST, null , ex);
+342 }
+343 }
+344 }
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354 private void extractArchive(ArchiveInputStream input, File destination, Engine engine) throws ArchiveExtractionException {
+355 ArchiveEntry entry;
+356 try {
+357 while ((entry = input.getNextEntry()) != null ) {
+358 if (entry.isDirectory()) {
+359 final File d = new File(destination, entry.getName());
+360 if (!d.exists()) {
+361 if (!d.mkdirs()) {
+362 final String msg = String.format("Unable to create directory '%s'." , d.getAbsolutePath());
+363 throw new AnalysisException (msg);
+364 }
+365 }
+366 } else {
+367 final File file = new File(destination, entry.getName());
+368 final String ext = FileUtils.getFileExtension(file.getName());
+369 if (engine.supportsExtension(ext)) {
+370 BufferedOutputStream bos = null ;
+371 FileOutputStream fos;
+372 try {
+373 final File parent = file.getParentFile();
+374 if (!parent.isDirectory()) {
+375 if (!parent.mkdirs()) {
+376 final String msg = String.format("Unable to build directory '%s'." , parent.getAbsolutePath());
+377 throw new AnalysisException (msg);
+378 }
+379 }
+380 fos = new FileOutputStream(file);
+381 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+382 int count;
+383 final byte data[] = new byte[BUFFER_SIZE];
+384 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+385 bos.write(data, 0, count);
+386 }
+387 bos.flush();
+388 } catch (FileNotFoundException ex) {
+389 LOGGER.log(Level.FINE, null , ex);
+390 final String msg = String.format("Unable to find file '%s'." , file.getName());
+391 throw new AnalysisException (msg, ex);
+392 } catch (IOException ex) {
+393 LOGGER.log(Level.FINE, null , ex);
+394 final String msg = String.format("IO Exception while parsing file '%s'." , file.getName());
+395 throw new AnalysisException (msg, ex);
+396 } finally {
+397 if (bos != null ) {
+398 try {
+399 bos.close();
+400 } catch (IOException ex) {
+401 LOGGER.log(Level.FINEST, null , ex);
+402 }
+403 }
+404 }
+405 }
+406 }
+407 }
+408 } catch (IOException ex) {
+409 throw new ArchiveExtractionException (ex);
+410 } catch (Throwable ex) {
+411 throw new ArchiveExtractionException (ex);
+412 } finally {
+413 if (input != null ) {
+414 try {
+415 input.close();
+416 } catch (IOException ex) {
+417 LOGGER.log(Level.FINEST, null , ex);
+418 }
+419 }
+420 }
+421 }
+422
+423
+424
+425
+426
+427
+428
+429
+430 private void decompressFile(CompressorInputStream inputStream, File outputFile) throws ArchiveExtractionException {
+431 FileOutputStream out = null ;
+432 try {
+433 out = new FileOutputStream(outputFile);
+434 final byte[] buffer = new byte[BUFFER_SIZE];
+435 int n = 0;
+436 while (-1 != (n = inputStream.read(buffer))) {
+437 out.write(buffer, 0, n);
+438 }
+439 } catch (FileNotFoundException ex) {
+440 LOGGER.log(Level.FINE, null , ex);
+441 throw new ArchiveExtractionException (ex);
+442 } catch (IOException ex) {
+443 LOGGER.log(Level.FINE, null , ex);
+444 throw new ArchiveExtractionException (ex);
+445 } finally {
+446 if (out != null ) {
+447 try {
+448 out.close();
+449 } catch (IOException ex) {
+450 LOGGER.log(Level.FINEST, null , ex);
+451 }
+452 }
+453 }
+454 }
+455
+456
+457
+458
+459
+460
+461
+462 private boolean isZipFileActuallyJarFile(Dependency dependency) {
+463 boolean isJar = false;
+464 ZipFile zip = null ;
+465 try {
+466 zip = new ZipFile(dependency.getActualFilePath());
+467 if (zip.getEntry("META-INF/MANIFEST.MF" ) != null
+468 || zip.getEntry("META-INF/maven" ) != null ) {
+469 final Enumeration<ZipArchiveEntry> entries = zip.getEntries();
+470 while (entries.hasMoreElements()) {
+471 final ZipArchiveEntry entry = entries.nextElement();
+472 if (!entry.isDirectory()) {
+473 final String name = entry.getName().toLowerCase();
+474 if (name.endsWith(".class" )) {
+475 isJar = true ;
+476 break ;
+477 }
+478 }
+479 }
+480 }
+481 } catch (IOException ex) {
+482 LOGGER.log(Level.FINE, String.format("Unable to unzip zip file '%s'" , dependency.getFilePath()), ex);
+483 } finally {
+484 ZipFile.closeQuietly(zip);
+485 }
+486
+487 return isJar;
+488 }
+489 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.html
index 560bb0433..289e21f35 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.html
@@ -128,205 +128,209 @@
120
121 rdr = new BufferedReader(new InputStreamReader(proc.getErrorStream(), "UTF-8" ));
122 String line = null ;
-123 while (rdr.ready() && (line = rdr.readLine()) != null ) {
-124 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.stderr" , line);
-125 }
-126 int rc = 0;
-127 doc = builder.parse(proc.getInputStream());
-128
-129 try {
-130 rc = proc.waitFor();
-131 } catch (InterruptedException ie) {
-132 return ;
-133 }
-134 if (rc == 3) {
-135 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.notassembly" , dependency.getActualFilePath());
-136 return ;
-137 } else if (rc != 0) {
-138 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.rc" , rc);
-139 }
-140
-141 final XPath xpath = XPathFactory.newInstance().newXPath();
+123
+124 while (rdr.ready() && (line = rdr.readLine()) != null ) {
+125 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.stderr" , line);
+126 }
+127
+128 int rc = 0;
+129 doc = builder.parse(proc.getInputStream());
+130
+131 try {
+132 rc = proc.waitFor();
+133 } catch (InterruptedException ie) {
+134 return ;
+135 }
+136 if (rc == 3) {
+137 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.notassembly" , dependency.getActualFilePath());
+138 return ;
+139 } else if (rc != 0) {
+140 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.rc" , rc);
+141 }
142
-143
-144 final String error = xpath.evaluate("/assembly/error" , doc);
-145 if (error != null && !"" .equals(error)) {
-146 throw new AnalysisException (error);
-147 }
-148
-149 final String version = xpath.evaluate("/assembly/version" , doc);
-150 if (version != null ) {
-151 dependency.getVersionEvidence().addEvidence(new Evidence("grokassembly" , "version" ,
-152 version, Confidence.HIGHEST));
-153 }
-154
-155 final String vendor = xpath.evaluate("/assembly/company" , doc);
-156 if (vendor != null ) {
-157 dependency.getVendorEvidence().addEvidence(new Evidence("grokassembly" , "vendor" ,
-158 vendor, Confidence.HIGH));
-159 }
-160
-161 final String product = xpath.evaluate("/assembly/product" , doc);
-162 if (product != null ) {
-163 dependency.getProductEvidence().addEvidence(new Evidence("grokassembly" , "product" ,
-164 product, Confidence.HIGH));
-165 }
-166
-167 } catch (IOException ioe) {
-168 throw new AnalysisException (ioe);
-169 } catch (SAXException saxe) {
-170 throw new AnalysisException ("Couldn't parse GrokAssembly result" , saxe);
-171 } catch (XPathExpressionException xpe) {
-172
-173 throw new AnalysisException (xpe);
-174 } finally {
-175 if (rdr != null ) {
-176 try {
-177 rdr.close();
-178 } catch (IOException ex) {
-179 LOGGER.log(Level.FINEST, "ignore" , ex);
-180 }
-181 }
-182 }
-183 }
-184
-185
-186
-187
-188
-189
-190 @Override
-191 public void initializeFileTypeAnalyzer() throws Exception {
-192 final File tempFile = File.createTempFile("GKA" , ".exe" , Settings.getTempDirectory());
-193 FileOutputStream fos = null ;
-194 InputStream is = null ;
-195 try {
-196 fos = new FileOutputStream(tempFile);
-197 is = AssemblyAnalyzer.class .getClassLoader().getResourceAsStream("GrokAssembly.exe" );
-198 final byte[] buff = new byte[4096];
-199 int bread = -1;
-200 while ((bread = is.read(buff)) >= 0) {
-201 fos.write(buff, 0, bread);
-202 }
-203 grokAssemblyExe = tempFile;
-204
-205 grokAssemblyExe.deleteOnExit();
-206 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.deployed" , grokAssemblyExe.getPath());
-207 } catch (IOException ioe) {
-208 this .setEnabled(false);
-209 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.notdeployed" , ioe.getMessage());
-210 throw new AnalysisException ("Could not extract GrokAssembly.exe" , ioe);
-211 } finally {
-212 if (fos != null ) {
-213 try {
-214 fos.close();
-215 } catch (Throwable e) {
-216 LOGGER.fine("Error closing output stream" );
-217 }
-218 }
-219 if (is != null ) {
-220 try {
-221 is.close();
-222 } catch (Throwable e) {
-223 LOGGER.fine("Error closing input stream" );
-224 }
-225 }
-226 }
-227
-228
-229 final List<String> args = buildArgumentList();
-230 BufferedReader rdr = null ;
-231 try {
-232 final ProcessBuilder pb = new ProcessBuilder(args);
-233 final Process p = pb.start();
-234
-235 rdr = new BufferedReader(new InputStreamReader(p.getErrorStream(), "UTF-8" ));
-236 while (rdr.ready() && rdr.readLine() != null ) {
-237
-238 }
-239 final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
-240 final XPath xpath = XPathFactory.newInstance().newXPath();
-241 final String error = xpath.evaluate("/assembly/error" , doc);
-242 if (p.waitFor() != 1 || error == null || "" .equals(error)) {
-243 LOGGER.warning("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details." );
-244 LOGGER.fine("GrokAssembly.exe is not working properly" );
-245 grokAssemblyExe = null ;
-246 this .setEnabled(false);
-247 throw new AnalysisException ("Could not execute .NET AssemblyAnalyzer" );
-248 }
-249 } catch (Throwable e) {
-250 if (e instanceof AnalysisException) {
-251 throw (AnalysisException) e;
-252 } else {
-253 LOGGER.warning("analyzer.AssemblyAnalyzer.grokassembly.initialization.failed" );
-254 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.initialization.message" , e.getMessage());
-255 this .setEnabled(false);
-256 throw new AnalysisException ("An error occured with the .NET AssemblyAnalyzer" , e);
-257 }
-258 } finally {
-259 if (rdr != null ) {
-260 try {
-261 rdr.close();
-262 } catch (IOException ex) {
-263 LOGGER.log(Level.FINEST, "ignore" , ex);
-264 }
-265 }
-266 }
-267 builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-268 }
-269
-270 @Override
-271 public void close() throws Exception {
-272 super .close();
-273 try {
-274 if (grokAssemblyExe != null && !grokAssemblyExe.delete()) {
-275 grokAssemblyExe.deleteOnExit();
-276 }
-277 } catch (SecurityException se) {
-278 LOGGER.fine("analyzer.AssemblyAnalyzer.grokassembly.notdeleted" );
-279 }
-280 }
-281
-282
-283
-284
-285
-286
-287 @Override
-288 public Set<String> getSupportedExtensions() {
-289 return SUPPORTED_EXTENSIONS;
-290 }
-291
-292
-293
-294
-295
-296
-297 @Override
-298 public String getName() {
-299 return ANALYZER_NAME;
-300 }
-301
-302
-303
-304
-305
-306
-307 @Override
-308 public AnalysisPhase getAnalysisPhase() {
-309 return ANALYSIS_PHASE;
-310 }
-311
-312
-313
-314
-315
-316
-317 @Override
-318 protected String getAnalyzerEnabledSettingKey() {
-319 return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED;
-320 }
-321 }
+143 final XPath xpath = XPathFactory.newInstance().newXPath();
+144
+145
+146 final String error = xpath.evaluate("/assembly/error" , doc);
+147 if (error != null && !"" .equals(error)) {
+148 throw new AnalysisException (error);
+149 }
+150
+151 final String version = xpath.evaluate("/assembly/version" , doc);
+152 if (version != null ) {
+153 dependency.getVersionEvidence().addEvidence(new Evidence("grokassembly" , "version" ,
+154 version, Confidence.HIGHEST));
+155 }
+156
+157 final String vendor = xpath.evaluate("/assembly/company" , doc);
+158 if (vendor != null ) {
+159 dependency.getVendorEvidence().addEvidence(new Evidence("grokassembly" , "vendor" ,
+160 vendor, Confidence.HIGH));
+161 }
+162
+163 final String product = xpath.evaluate("/assembly/product" , doc);
+164 if (product != null ) {
+165 dependency.getProductEvidence().addEvidence(new Evidence("grokassembly" , "product" ,
+166 product, Confidence.HIGH));
+167 }
+168
+169 } catch (IOException ioe) {
+170 throw new AnalysisException (ioe);
+171 } catch (SAXException saxe) {
+172 throw new AnalysisException ("Couldn't parse GrokAssembly result" , saxe);
+173 } catch (XPathExpressionException xpe) {
+174
+175 throw new AnalysisException (xpe);
+176 } finally {
+177 if (rdr != null ) {
+178 try {
+179 rdr.close();
+180 } catch (IOException ex) {
+181 LOGGER.log(Level.FINEST, "ignore" , ex);
+182 }
+183 }
+184 }
+185 }
+186
+187
+188
+189
+190
+191
+192 @Override
+193 public void initializeFileTypeAnalyzer() throws Exception {
+194 final File tempFile = File.createTempFile("GKA" , ".exe" , Settings.getTempDirectory());
+195 FileOutputStream fos = null ;
+196 InputStream is = null ;
+197 try {
+198 fos = new FileOutputStream(tempFile);
+199 is = AssemblyAnalyzer.class .getClassLoader().getResourceAsStream("GrokAssembly.exe" );
+200 final byte[] buff = new byte[4096];
+201 int bread = -1;
+202 while ((bread = is.read(buff)) >= 0) {
+203 fos.write(buff, 0, bread);
+204 }
+205 grokAssemblyExe = tempFile;
+206
+207 grokAssemblyExe.deleteOnExit();
+208 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.deployed" , grokAssemblyExe.getPath());
+209 } catch (IOException ioe) {
+210 this .setEnabled(false);
+211 LOGGER.log(Level.WARNING, "analyzer.AssemblyAnalyzer.grokassembly.notdeployed" , ioe.getMessage());
+212 throw new AnalysisException ("Could not extract GrokAssembly.exe" , ioe);
+213 } finally {
+214 if (fos != null ) {
+215 try {
+216 fos.close();
+217 } catch (Throwable e) {
+218 LOGGER.fine("Error closing output stream" );
+219 }
+220 }
+221 if (is != null ) {
+222 try {
+223 is.close();
+224 } catch (Throwable e) {
+225 LOGGER.fine("Error closing input stream" );
+226 }
+227 }
+228 }
+229
+230
+231 final List<String> args = buildArgumentList();
+232 BufferedReader rdr = null ;
+233 try {
+234 final ProcessBuilder pb = new ProcessBuilder(args);
+235 final Process p = pb.start();
+236
+237 rdr = new BufferedReader(new InputStreamReader(p.getErrorStream(), "UTF-8" ));
+238
+239 while (rdr.ready() && rdr.readLine() != null ) {
+240
+241 }
+242
+243 final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(p.getInputStream());
+244 final XPath xpath = XPathFactory.newInstance().newXPath();
+245 final String error = xpath.evaluate("/assembly/error" , doc);
+246 if (p.waitFor() != 1 || error == null || "" .equals(error)) {
+247 LOGGER.warning("An error occurred with the .NET AssemblyAnalyzer, please see the log for more details." );
+248 LOGGER.fine("GrokAssembly.exe is not working properly" );
+249 grokAssemblyExe = null ;
+250 this .setEnabled(false);
+251 throw new AnalysisException ("Could not execute .NET AssemblyAnalyzer" );
+252 }
+253 } catch (Throwable e) {
+254 if (e instanceof AnalysisException) {
+255 throw (AnalysisException) e;
+256 } else {
+257 LOGGER.warning("analyzer.AssemblyAnalyzer.grokassembly.initialization.failed" );
+258 LOGGER.log(Level.FINE, "analyzer.AssemblyAnalyzer.grokassembly.initialization.message" , e.getMessage());
+259 this .setEnabled(false);
+260 throw new AnalysisException ("An error occured with the .NET AssemblyAnalyzer" , e);
+261 }
+262 } finally {
+263 if (rdr != null ) {
+264 try {
+265 rdr.close();
+266 } catch (IOException ex) {
+267 LOGGER.log(Level.FINEST, "ignore" , ex);
+268 }
+269 }
+270 }
+271 builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+272 }
+273
+274 @Override
+275 public void close() throws Exception {
+276 super .close();
+277 try {
+278 if (grokAssemblyExe != null && !grokAssemblyExe.delete()) {
+279 grokAssemblyExe.deleteOnExit();
+280 }
+281 } catch (SecurityException se) {
+282 LOGGER.fine("analyzer.AssemblyAnalyzer.grokassembly.notdeleted" );
+283 }
+284 }
+285
+286
+287
+288
+289
+290
+291 @Override
+292 public Set<String> getSupportedExtensions() {
+293 return SUPPORTED_EXTENSIONS;
+294 }
+295
+296
+297
+298
+299
+300
+301 @Override
+302 public String getName() {
+303 return ANALYZER_NAME;
+304 }
+305
+306
+307
+308
+309
+310
+311 @Override
+312 public AnalysisPhase getAnalysisPhase() {
+313 return ANALYSIS_PHASE;
+314 }
+315
+316
+317
+318
+319
+320
+321 @Override
+322 protected String getAnalyzerEnabledSettingKey() {
+323 return Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED;
+324 }
+325 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/CPEAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/CPEAnalyzer.html
index fbb019367..f0dd53805 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/CPEAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/CPEAnalyzer.html
@@ -196,576 +196,587 @@
188 if (!vendors.isEmpty() && !products.isEmpty()) {
189 final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
190 dependency.getVendorEvidence().getWeighting());
-191
-192 boolean identifierAdded = false;
-193 for (IndexEntry e : entries) {
-194 if (verifyEntry(e, dependency)) {
-195 final String vendor = e.getVendor();
-196 final String product = e.getProduct();
-197 identifierAdded |= determineIdentifiers(dependency, vendor, product, confidence);
-198 }
-199 }
-200 if (identifierAdded) {
-201 break ;
-202 }
-203 }
-204 }
-205 }
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217 private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
-218 final String txt = (text == null ) ? "" : text;
-219 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
-220 sb.append(' ').append(txt).append(' ');
-221 for (Evidence e : ec.iterator(confidenceFilter)) {
-222 String value = e.getValue();
-223
-224
-225
-226 if (value.startsWith("http://" )) {
-227 value = value.substring(7).replaceAll("\\." , " " );
-228 }
-229 if (value.startsWith("https://" )) {
-230 value = value.substring(8).replaceAll("\\." , " " );
-231 }
-232 if (sb.indexOf(" " + value + " " ) < 0) {
-233 sb.append(value).append(' ');
-234 }
-235 }
-236 return sb.toString().trim();
-237 }
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257 protected List<IndexEntry> searchCPE(String vendor, String product,
-258 Set<String> vendorWeightings, Set<String> productWeightings)
-259 throws CorruptIndexException, IOException, ParseException {
-260 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
-261
-262 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
-263 if (searchString == null ) {
-264 return ret;
-265 }
-266
-267 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
-268 for (ScoreDoc d : docs.scoreDocs) {
-269 if (d.score >= 0.08) {
-270 final Document doc = cpe.getDocument(d.doc);
-271 final IndexEntry entry = new IndexEntry ();
-272 entry.setVendor(doc.get(Fields.VENDOR));
-273 entry.setProduct(doc.get(Fields.PRODUCT));
-274
-275
-276
-277
-278
-279
-280
-281 entry.setSearchScore(d.score);
-282 if (!ret.contains(entry)) {
-283 ret.add(entry);
+191 if (entries == null ) {
+192 continue ;
+193 }
+194 boolean identifierAdded = false;
+195 for (IndexEntry e : entries) {
+196 if (verifyEntry(e, dependency)) {
+197 final String vendor = e.getVendor();
+198 final String product = e.getProduct();
+199 identifierAdded |= determineIdentifiers(dependency, vendor, product, confidence);
+200 }
+201 }
+202 if (identifierAdded) {
+203 break ;
+204 }
+205 }
+206 }
+207 }
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219 private String addEvidenceWithoutDuplicateTerms(final String text, final EvidenceCollection ec, Confidence confidenceFilter) {
+220 final String txt = (text == null ) ? "" : text;
+221 final StringBuilder sb = new StringBuilder(txt.length() + (20 * ec.size()));
+222 sb.append(' ').append(txt).append(' ');
+223 for (Evidence e : ec.iterator(confidenceFilter)) {
+224 String value = e.getValue();
+225
+226
+227
+228 if (value.startsWith("http://" )) {
+229 value = value.substring(7).replaceAll("\\." , " " );
+230 }
+231 if (value.startsWith("https://" )) {
+232 value = value.substring(8).replaceAll("\\." , " " );
+233 }
+234 if (sb.indexOf(" " + value + " " ) < 0) {
+235 sb.append(value).append(' ');
+236 }
+237 }
+238 return sb.toString().trim();
+239 }
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256 protected List<IndexEntry> searchCPE(String vendor, String product,
+257 Set<String> vendorWeightings, Set<String> productWeightings) {
+258
+259 final ArrayList<IndexEntry> ret = new ArrayList<IndexEntry>(MAX_QUERY_RESULTS);
+260
+261 final String searchString = buildSearch(vendor, product, vendorWeightings, productWeightings);
+262 if (searchString == null ) {
+263 return ret;
+264 }
+265 try {
+266 final TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
+267 for (ScoreDoc d : docs.scoreDocs) {
+268 if (d.score >= 0.08) {
+269 final Document doc = cpe.getDocument(d.doc);
+270 final IndexEntry entry = new IndexEntry ();
+271 entry.setVendor(doc.get(Fields.VENDOR));
+272 entry.setProduct(doc.get(Fields.PRODUCT));
+273
+274
+275
+276
+277
+278
+279
+280 entry.setSearchScore(d.score);
+281 if (!ret.contains(entry)) {
+282 ret.add(entry);
+283 }
284 }
285 }
-286 }
-287 return ret;
-288 }
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304 protected String buildSearch(String vendor, String product,
-305 Set<String> vendorWeighting, Set<String> productWeightings) {
-306 final String v = vendor;
-307 final String p = product;
-308 final StringBuilder sb = new StringBuilder(v.length() + p.length()
-309 + Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER);
-310
-311 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
-312 return null ;
-313 }
-314 sb.append(" AND " );
-315 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
-316 return null ;
-317 }
-318 return sb.toString();
-319 }
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332 private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) {
-333 sb.append(" " ).append(field).append(":( " );
-334
-335 final String cleanText = cleanseText(searchText);
-336
-337 if ("" .equals(cleanText)) {
-338 return false;
-339 }
-340
-341 if (weightedText == null || weightedText.isEmpty()) {
-342 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
-343 } else {
-344 final StringTokenizer tokens = new StringTokenizer(cleanText);
-345 while (tokens.hasMoreElements()) {
-346 final String word = tokens.nextToken();
-347 String temp = null ;
-348 for (String weighted : weightedText) {
-349 final String weightedStr = cleanseText(weighted);
-350 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
-351 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
-352 if (!word.equalsIgnoreCase(weightedStr)) {
-353 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
-354 }
-355 }
-356 }
-357 if (temp == null ) {
-358 temp = LuceneUtils.escapeLuceneQuery(word);
-359 }
-360 sb.append(" " ).append(temp);
-361 }
-362 }
-363 sb.append(" ) " );
-364 return true ;
-365 }
-366
-367
-368
-369
-370
-371
-372
-373 private String cleanseText(String text) {
-374 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
-375 }
-376
-377
-378
-379
-380
-381
-382
-383
-384 private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
-385 if (l == null || r == null ) {
-386 return false;
-387 }
-388
-389 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
-390 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
-391 return left.equalsIgnoreCase(right);
-392 }
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402 private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
-403 boolean isValid = false;
-404
-405 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
-406 && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
-407
-408 isValid = true ;
-409 }
-410 return isValid;
-411 }
-412
-413
-414
-415
-416
-417
-418
-419
-420 private boolean collectionContainsString(EvidenceCollection ec, String text) {
+286 return ret;
+287 } catch (ParseException ex) {
+288 final String msg = String.format("Unable to parse: %s" , searchString);
+289 LOGGER.log(Level.WARNING, "An error occured querying the CPE data. See the log for more details." );
+290 LOGGER.log(Level.INFO, msg, ex);
+291 } catch (IOException ex) {
+292 final String msg = String.format("IO Error with search string: %s" , searchString);
+293 LOGGER.log(Level.WARNING, "An error occured reading CPE data. See the log for more details." );
+294 LOGGER.log(Level.INFO, msg, ex);
+295 }
+296 return null ;
+297 }
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313 protected String buildSearch(String vendor, String product,
+314 Set<String> vendorWeighting, Set<String> productWeightings) {
+315 final String v = vendor;
+316 final String p = product;
+317 final StringBuilder sb = new StringBuilder(v.length() + p.length()
+318 + Fields.PRODUCT.length() + Fields.VENDOR.length() + STRING_BUILDER_BUFFER);
+319
+320 if (!appendWeightedSearch(sb, Fields.PRODUCT, p, productWeightings)) {
+321 return null ;
+322 }
+323 sb.append(" AND " );
+324 if (!appendWeightedSearch(sb, Fields.VENDOR, v, vendorWeighting)) {
+325 return null ;
+326 }
+327 return sb.toString();
+328 }
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341 private boolean appendWeightedSearch(StringBuilder sb, String field, String searchText, Set<String> weightedText) {
+342 sb.append(" " ).append(field).append(":( " );
+343
+344 final String cleanText = cleanseText(searchText);
+345
+346 if ("" .equals(cleanText)) {
+347 return false;
+348 }
+349
+350 if (weightedText == null || weightedText.isEmpty()) {
+351 LuceneUtils.appendEscapedLuceneQuery(sb, cleanText);
+352 } else {
+353 final StringTokenizer tokens = new StringTokenizer(cleanText);
+354 while (tokens.hasMoreElements()) {
+355 final String word = tokens.nextToken();
+356 String temp = null ;
+357 for (String weighted : weightedText) {
+358 final String weightedStr = cleanseText(weighted);
+359 if (equalsIgnoreCaseAndNonAlpha(word, weightedStr)) {
+360 temp = LuceneUtils.escapeLuceneQuery(word) + WEIGHTING_BOOST;
+361 if (!word.equalsIgnoreCase(weightedStr)) {
+362 temp += " " + LuceneUtils.escapeLuceneQuery(weightedStr) + WEIGHTING_BOOST;
+363 }
+364 }
+365 }
+366 if (temp == null ) {
+367 temp = LuceneUtils.escapeLuceneQuery(word);
+368 }
+369 sb.append(" " ).append(temp);
+370 }
+371 }
+372 sb.append(" ) " );
+373 return true ;
+374 }
+375
+376
+377
+378
+379
+380
+381
+382 private String cleanseText(String text) {
+383 return text.replaceAll(CLEANSE_CHARACTER_RX, " " );
+384 }
+385
+386
+387
+388
+389
+390
+391
+392
+393 private boolean equalsIgnoreCaseAndNonAlpha(String l, String r) {
+394 if (l == null || r == null ) {
+395 return false;
+396 }
+397
+398 final String left = l.replaceAll(CLEANSE_NONALPHA_RX, "" );
+399 final String right = r.replaceAll(CLEANSE_NONALPHA_RX, "" );
+400 return left.equalsIgnoreCase(right);
+401 }
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411 private boolean verifyEntry(final IndexEntry entry, final Dependency dependency) {
+412 boolean isValid = false;
+413
+414 if (collectionContainsString(dependency.getProductEvidence(), entry.getProduct())
+415 && collectionContainsString(dependency.getVendorEvidence(), entry.getVendor())) {
+416
+417 isValid = true ;
+418 }
+419 return isValid;
+420 }
421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433 if (text == null ) {
-434 return false;
-435 }
-436 final String[] words = text.split("[\\s_-]" );
-437 final List<String> list = new ArrayList<String>();
-438 String tempWord = null ;
-439 for (String word : words) {
-440
-441
-442
-443
-444 if (tempWord != null ) {
-445 list.add(tempWord + word);
-446 tempWord = null ;
-447 } else if (word.length() <= 2) {
-448 tempWord = word;
-449 } else {
-450 list.add(word);
-451 }
-452 }
-453 if (tempWord != null && !list.isEmpty()) {
-454 final String tmp = list.get(list.size() - 1) + tempWord;
-455 list.add(tmp);
-456 }
-457 boolean contains = true ;
-458 for (String word : list) {
-459 contains &= ec.containsUsedString(word);
-460 }
-461 return contains;
-462 }
-463
-464
-465
-466
-467
-468
-469
-470
-471 @Override
-472 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
-473 try {
-474 determineCPE(dependency);
-475 } catch (CorruptIndexException ex) {
-476 throw new AnalysisException ("CPE Index is corrupt." , ex);
-477 } catch (IOException ex) {
-478 throw new AnalysisException ("Failure opening the CPE Index." , ex);
-479 } catch (ParseException ex) {
-480 throw new AnalysisException ("Unable to parse the generated Lucene query for this dependency." , ex);
-481 }
-482 }
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495 private boolean determineIdentifiers(Dependency dependency, String vendor, String product, Confidence currentConfidence) throws UnsupportedEncodingException {
-496 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
-497 DependencyVersion bestGuess = new DependencyVersion ("-" );
-498 Confidence bestGuessConf = null ;
-499 boolean hasBroadMatch = false;
-500 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
-501 for (Confidence conf : Confidence.values()) {
-502
-503
-504
-505 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
-506 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
-507 if (evVer == null ) {
-508 continue ;
-509 }
-510 for (VulnerableSoftware vs : cpes) {
-511 DependencyVersion dbVer;
-512 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
-513 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + "." + vs.getRevision());
-514 } else {
-515 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
-516 }
-517 if (dbVer == null ) {
-518 hasBroadMatch = true ;
-519 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
-520 final IdentifierMatch match = new IdentifierMatch ("cpe" , vs.getName(), url, IdentifierConfidence.BROAD_MATCH, conf);
-521 collected.add(match);
-522 } else if (evVer.equals(dbVer)) {
-523 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
-524 final IdentifierMatch match = new IdentifierMatch ("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
-525 collected.add(match);
-526 } else {
-527
-528 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
-529 && evVer.matchesAtLeastThreeLevels(dbVer)) {
-530 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
-531 if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) {
-532 bestGuess = dbVer;
-533 bestGuessConf = conf;
-534 }
-535 }
-536 }
-537 }
-538 }
-539 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
-540 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
-541 bestGuess = evVer;
-542 bestGuessConf = conf;
-543 }
-544 }
-545 }
-546 }
-547 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
-548 String url = null ;
-549 if (hasBroadMatch) {
-550 final String cpeUrlName = String.format("cpe:/a:%s:%s" , vendor, product);
-551 url = String.format(NVD_SEARCH_URL, URLEncoder.encode(cpeUrlName, "UTF-8" ));
-552 }
-553 if (bestGuessConf == null ) {
-554 bestGuessConf = Confidence.LOW;
-555 }
-556 final IdentifierMatch match = new IdentifierMatch ("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
-557 collected.add(match);
-558
-559 Collections.sort(collected);
-560 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
-561 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
-562 boolean identifierAdded = false;
-563 for (IdentifierMatch m : collected) {
-564 if (bestIdentifierQuality.equals(m.getConfidence())
-565 && bestEvidenceQuality.equals(m.getEvidenceConfidence())) {
-566 final Identifier i = m.getIdentifier();
-567 if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) {
-568 i.setConfidence(Confidence.LOW);
-569 } else {
-570 i.setConfidence(bestEvidenceQuality);
-571 }
-572 dependency.addIdentifier(i);
-573 identifierAdded = true ;
-574 }
-575 }
-576 return identifierAdded;
-577 }
-578
-579
-580
-581
-582 private enum IdentifierConfidence {
-583
-584
-585
-586
-587 EXACT_MATCH,
-588
-589
-590
-591 BEST_GUESS,
-592
-593
-594
-595
-596 BROAD_MATCH
-597 }
-598
-599
-600
-601
-602 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613 IdentifierMatch (String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
-614 this .identifier = new Identifier (type, value, url);
-615 this .confidence = identifierConfidence;
-616 this .evidenceConfidence = evidenceConfidence;
-617 }
-618
-619
-620
-621
-622 private Confidence evidenceConfidence;
-623
-624
-625
-626
-627
-628
-629 public Confidence getEvidenceConfidence() {
-630 return evidenceConfidence;
-631 }
-632
-633
-634
-635
-636
-637
-638 public void setEvidenceConfidence(Confidence evidenceConfidence) {
-639 this .evidenceConfidence = evidenceConfidence;
-640 }
-641
-642
-643
-644 private IdentifierConfidence confidence;
-645
-646
-647
-648
-649
-650
-651 public IdentifierConfidence getConfidence() {
-652 return confidence;
-653 }
-654
-655
-656
-657
-658
-659
-660 public void setConfidence(IdentifierConfidence confidence) {
-661 this .confidence = confidence;
-662 }
-663
-664
-665
-666 private Identifier identifier;
-667
-668
-669
-670
-671
-672
-673 public Identifier getIdentifier() {
-674 return identifier;
-675 }
-676
-677
-678
-679
-680
-681
-682 public void setIdentifier(Identifier identifier) {
-683 this .identifier = identifier;
-684 }
-685
-686
+422
+423
+424
+425
+426
+427
+428
+429 private boolean collectionContainsString(EvidenceCollection ec, String text) {
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442 if (text == null ) {
+443 return false;
+444 }
+445 final String[] words = text.split("[\\s_-]" );
+446 final List<String> list = new ArrayList<String>();
+447 String tempWord = null ;
+448 for (String word : words) {
+449
+450
+451
+452
+453 if (tempWord != null ) {
+454 list.add(tempWord + word);
+455 tempWord = null ;
+456 } else if (word.length() <= 2) {
+457 tempWord = word;
+458 } else {
+459 list.add(word);
+460 }
+461 }
+462 if (tempWord != null && !list.isEmpty()) {
+463 final String tmp = list.get(list.size() - 1) + tempWord;
+464 list.add(tmp);
+465 }
+466 boolean contains = true ;
+467 for (String word : list) {
+468 contains &= ec.containsUsedString(word);
+469 }
+470 return contains;
+471 }
+472
+473
+474
+475
+476
+477
+478
+479
+480 @Override
+481 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
+482 try {
+483 determineCPE(dependency);
+484 } catch (CorruptIndexException ex) {
+485 throw new AnalysisException ("CPE Index is corrupt." , ex);
+486 } catch (IOException ex) {
+487 throw new AnalysisException ("Failure opening the CPE Index." , ex);
+488 } catch (ParseException ex) {
+489 throw new AnalysisException ("Unable to parse the generated Lucene query for this dependency." , ex);
+490 }
+491 }
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505 protected boolean determineIdentifiers(Dependency dependency, String vendor, String product,
+506 Confidence currentConfidence) throws UnsupportedEncodingException {
+507 final Set<VulnerableSoftware> cpes = cve.getCPEs(vendor, product);
+508 DependencyVersion bestGuess = new DependencyVersion ("-" );
+509 Confidence bestGuessConf = null ;
+510 boolean hasBroadMatch = false;
+511 final List<IdentifierMatch> collected = new ArrayList<IdentifierMatch>();
+512 for (Confidence conf : Confidence.values()) {
+513
+514
+515
+516 for (Evidence evidence : dependency.getVersionEvidence().iterator(conf)) {
+517 final DependencyVersion evVer = DependencyVersionUtil.parseVersion(evidence.getValue());
+518 if (evVer == null ) {
+519 continue ;
+520 }
+521 for (VulnerableSoftware vs : cpes) {
+522 DependencyVersion dbVer;
+523 if (vs.getRevision() != null && !vs.getRevision().isEmpty()) {
+524 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion() + "." + vs.getRevision());
+525 } else {
+526 dbVer = DependencyVersionUtil.parseVersion(vs.getVersion());
+527 }
+528 if (dbVer == null ) {
+529 hasBroadMatch = true ;
+530 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
+531 final IdentifierMatch match = new IdentifierMatch ("cpe" , vs.getName(), url, IdentifierConfidence.BROAD_MATCH, conf);
+532 collected.add(match);
+533 } else if (evVer.equals(dbVer)) {
+534 final String url = String.format(NVD_SEARCH_URL, URLEncoder.encode(vs.getName(), "UTF-8" ));
+535 final IdentifierMatch match = new IdentifierMatch ("cpe" , vs.getName(), url, IdentifierConfidence.EXACT_MATCH, conf);
+536 collected.add(match);
+537 } else {
+538
+539 if (evVer.getVersionParts().size() <= dbVer.getVersionParts().size()
+540 && evVer.matchesAtLeastThreeLevels(dbVer)) {
+541 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
+542 if (bestGuess.getVersionParts().size() < dbVer.getVersionParts().size()) {
+543 bestGuess = dbVer;
+544 bestGuessConf = conf;
+545 }
+546 }
+547 }
+548 }
+549 }
+550 if (bestGuessConf == null || bestGuessConf.compareTo(conf) > 0) {
+551 if (bestGuess.getVersionParts().size() < evVer.getVersionParts().size()) {
+552 bestGuess = evVer;
+553 bestGuessConf = conf;
+554 }
+555 }
+556 }
+557 }
+558 final String cpeName = String.format("cpe:/a:%s:%s:%s" , vendor, product, bestGuess.toString());
+559 String url = null ;
+560 if (hasBroadMatch) {
+561 final String cpeUrlName = String.format("cpe:/a:%s:%s" , vendor, product);
+562 url = String.format(NVD_SEARCH_URL, URLEncoder.encode(cpeUrlName, "UTF-8" ));
+563 }
+564 if (bestGuessConf == null ) {
+565 bestGuessConf = Confidence.LOW;
+566 }
+567 final IdentifierMatch match = new IdentifierMatch ("cpe" , cpeName, url, IdentifierConfidence.BEST_GUESS, bestGuessConf);
+568 collected.add(match);
+569
+570 Collections.sort(collected);
+571 final IdentifierConfidence bestIdentifierQuality = collected.get(0).getConfidence();
+572 final Confidence bestEvidenceQuality = collected.get(0).getEvidenceConfidence();
+573 boolean identifierAdded = false;
+574 for (IdentifierMatch m : collected) {
+575 if (bestIdentifierQuality.equals(m.getConfidence())
+576 && bestEvidenceQuality.equals(m.getEvidenceConfidence())) {
+577 final Identifier i = m.getIdentifier();
+578 if (bestIdentifierQuality == IdentifierConfidence.BEST_GUESS) {
+579 i.setConfidence(Confidence.LOW);
+580 } else {
+581 i.setConfidence(bestEvidenceQuality);
+582 }
+583 dependency.addIdentifier(i);
+584 identifierAdded = true ;
+585 }
+586 }
+587 return identifierAdded;
+588 }
+589
+590
+591
+592
+593 private enum IdentifierConfidence {
+594
+595
+596
+597
+598 EXACT_MATCH,
+599
+600
+601
+602 BEST_GUESS,
+603
+604
+605
+606
+607 BROAD_MATCH
+608 }
+609
+610
+611
+612
+613 private static class IdentifierMatch implements Comparable<IdentifierMatch> {
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624 IdentifierMatch (String type, String value, String url, IdentifierConfidence identifierConfidence, Confidence evidenceConfidence) {
+625 this .identifier = new Identifier (type, value, url);
+626 this .confidence = identifierConfidence;
+627 this .evidenceConfidence = evidenceConfidence;
+628 }
+629
+630
+631
+632
+633 private Confidence evidenceConfidence;
+634
+635
+636
+637
+638
+639
+640 public Confidence getEvidenceConfidence() {
+641 return evidenceConfidence;
+642 }
+643
+644
+645
+646
+647
+648
+649 public void setEvidenceConfidence(Confidence evidenceConfidence) {
+650 this .evidenceConfidence = evidenceConfidence;
+651 }
+652
+653
+654
+655 private IdentifierConfidence confidence;
+656
+657
+658
+659
+660
+661
+662 public IdentifierConfidence getConfidence() {
+663 return confidence;
+664 }
+665
+666
+667
+668
+669
+670
+671 public void setConfidence(IdentifierConfidence confidence) {
+672 this .confidence = confidence;
+673 }
+674
+675
+676
+677 private Identifier identifier;
+678
+679
+680
+681
+682
+683
+684 public Identifier getIdentifier() {
+685 return identifier;
+686 }
687
688
-689
+689
690
-691
+691
692
-693 @Override
-694 public String toString() {
-695 return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence
-696 + ", confidence=" + confidence + ", identifier=" + identifier + '}';
-697 }
+693 public void setIdentifier(Identifier identifier) {
+694 this .identifier = identifier;
+695 }
+696
+697
698
699
-700
+700
701
-702
+702
703
704 @Override
-705 public int hashCode() {
-706 int hash = 5;
-707 hash = 97 * hash + (this .evidenceConfidence != null ? this .evidenceConfidence.hashCode() : 0);
-708 hash = 97 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
-709 hash = 97 * hash + (this .identifier != null ? this .identifier.hashCode() : 0);
-710 return hash;
-711 }
-712
-713
-714
-715
-716
-717
-718
-719 @Override
-720 public boolean equals(Object obj) {
-721 if (obj == null ) {
-722 return false;
-723 }
-724 if (getClass() != obj.getClass()) {
-725 return false;
-726 }
-727 final IdentifierMatch other = (IdentifierMatch) obj;
-728 if (this .evidenceConfidence != other.evidenceConfidence) {
-729 return false;
-730 }
-731 if (this .confidence != other.confidence) {
-732 return false;
-733 }
-734 if (this .identifier != other.identifier && (this .identifier == null || !this .identifier.equals(other.identifier))) {
-735 return false;
-736 }
-737 return true ;
-738 }
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748 @Override
-749 public int compareTo(IdentifierMatch o) {
-750 int conf = this .confidence.compareTo(o.confidence);
-751 if (conf == 0) {
-752 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
-753 if (conf == 0) {
-754 conf = identifier.compareTo(o.identifier);
-755 }
-756 }
-757 return conf;
-758 }
-759 }
-760 }
+705 public String toString() {
+706 return "IdentifierMatch{" + "evidenceConfidence=" + evidenceConfidence
+707 + ", confidence=" + confidence + ", identifier=" + identifier + '}';
+708 }
+709
+710
+711
+712
+713
+714
+715 @Override
+716 public int hashCode() {
+717 int hash = 5;
+718 hash = 97 * hash + (this .evidenceConfidence != null ? this .evidenceConfidence.hashCode() : 0);
+719 hash = 97 * hash + (this .confidence != null ? this .confidence.hashCode() : 0);
+720 hash = 97 * hash + (this .identifier != null ? this .identifier.hashCode() : 0);
+721 return hash;
+722 }
+723
+724
+725
+726
+727
+728
+729
+730 @Override
+731 public boolean equals(Object obj) {
+732 if (obj == null ) {
+733 return false;
+734 }
+735 if (getClass() != obj.getClass()) {
+736 return false;
+737 }
+738 final IdentifierMatch other = (IdentifierMatch) obj;
+739 if (this .evidenceConfidence != other.evidenceConfidence) {
+740 return false;
+741 }
+742 if (this .confidence != other.confidence) {
+743 return false;
+744 }
+745 if (this .identifier != other.identifier && (this .identifier == null || !this .identifier.equals(other.identifier))) {
+746 return false;
+747 }
+748 return true ;
+749 }
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759 @Override
+760 public int compareTo(IdentifierMatch o) {
+761 int conf = this .confidence.compareTo(o.confidence);
+762 if (conf == 0) {
+763 conf = this .evidenceConfidence.compareTo(o.evidenceConfidence);
+764 if (conf == 0) {
+765 conf = identifier.compareTo(o.identifier);
+766 }
+767 }
+768 return conf;
+769 }
+770 }
+771 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/CentralAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/CentralAnalyzer.html
new file mode 100644
index 000000000..f312ad390
--- /dev/null
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/CentralAnalyzer.html
@@ -0,0 +1,214 @@
+
+
+
+CentralAnalyzer xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.analyzer;
+19
+20 import java.io.FileNotFoundException;
+21 import java.io.IOException;
+22 import java.net.URL;
+23 import java.util.List;
+24 import java.util.Set;
+25 import java.util.logging.Level;
+26 import java.util.logging.Logger;
+27 import org.owasp.dependencycheck.Engine;
+28 import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
+29 import org.owasp.dependencycheck.data.central.CentralSearch;
+30 import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+31 import org.owasp.dependencycheck.dependency.Confidence;
+32 import org.owasp.dependencycheck.dependency.Dependency;
+33 import org.owasp.dependencycheck.utils.InvalidSettingException;
+34 import org.owasp.dependencycheck.utils.Settings;
+35
+36
+37
+38
+39
+40
+41
+42 public class CentralAnalyzer extends AbstractFileTypeAnalyzer {
+43
+44
+45
+46
+47 private static final Logger LOGGER = Logger.getLogger(CentralAnalyzer.class .getName());
+48
+49
+50
+51
+52 private static final String ANALYZER_NAME = "Central Analyzer" ;
+53
+54
+55
+56
+57 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+58
+59
+60
+61
+62 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
+63
+64
+65
+66
+67
+68 private boolean errorFlag = false;
+69
+70
+71
+72
+73 private CentralSearch searcher;
+74
+75
+76
+77
+78 private final boolean enabled = checkEnabled();
+79
+80
+81
+82
+83
+84
+85 @Override
+86 public boolean isEnabled() {
+87 return enabled;
+88 }
+89
+90
+91
+92
+93
+94
+95 private boolean checkEnabled() {
+96 boolean retval = false;
+97
+98 try {
+99 if (Settings.getBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED)) {
+100 if (!Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED)
+101 || NexusAnalyzer.DEFAULT_URL.equals(Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL))) {
+102 LOGGER.info("Enabling the Central analyzer" );
+103 retval = true ;
+104 } else {
+105 LOGGER.info("Nexus analyzer is enabled, disabling the Central Analyzer" );
+106 }
+107 } else {
+108 LOGGER.info("Central analyzer disabled" );
+109 }
+110 } catch (InvalidSettingException ise) {
+111 LOGGER.warning("Invalid setting. Disabling the Central analyzer" );
+112 }
+113 return retval;
+114 }
+115
+116
+117
+118
+119
+120
+121 @Override
+122 public void initializeFileTypeAnalyzer() throws Exception {
+123 LOGGER.fine("Initializing Central analyzer" );
+124 LOGGER.fine(String.format("Central analyzer enabled: %s" , isEnabled()));
+125 if (isEnabled()) {
+126 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_CENTRAL_URL);
+127 LOGGER.fine(String.format("Central Analyzer URL: %s" , searchUrl));
+128 searcher = new CentralSearch (new URL(searchUrl));
+129 }
+130 }
+131
+132
+133
+134
+135
+136
+137 @Override
+138 public String getName() {
+139 return ANALYZER_NAME;
+140 }
+141
+142
+143
+144
+145
+146
+147 @Override
+148 protected String getAnalyzerEnabledSettingKey() {
+149 return Settings.KEYS.ANALYZER_CENTRAL_ENABLED;
+150 }
+151
+152
+153
+154
+155
+156
+157 @Override
+158 public AnalysisPhase getAnalysisPhase() {
+159 return ANALYSIS_PHASE;
+160 }
+161
+162
+163
+164
+165
+166
+167 @Override
+168 public Set<String> getSupportedExtensions() {
+169 return SUPPORTED_EXTENSIONS;
+170 }
+171
+172
+173
+174
+175
+176
+177
+178
+179 @Override
+180 public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
+181 if (errorFlag || !isEnabled()) {
+182 return ;
+183 }
+184
+185 try {
+186 final List<MavenArtifact> mas = searcher.searchSha1(dependency.getSha1sum());
+187 final Confidence confidence = mas.size() > 1 ? Confidence.HIGH : Confidence.HIGHEST;
+188 for (MavenArtifact ma : mas) {
+189 LOGGER.fine(String.format("Central analyzer found artifact (%s) for dependency (%s)" , ma.toString(), dependency.getFileName()));
+190 dependency.addAsEvidence("central" , ma, confidence);
+191 }
+192 } catch (IllegalArgumentException iae) {
+193 LOGGER.info(String.format("invalid sha1-hash on %s" , dependency.getFileName()));
+194 } catch (FileNotFoundException fnfe) {
+195 LOGGER.fine(String.format("Artifact not found in repository: '%s" , dependency.getFileName()));
+196 } catch (IOException ioe) {
+197 LOGGER.log(Level.FINE, "Could not connect to Central search" , ioe);
+198 errorFlag = true ;
+199 }
+200 }
+201 }
+
+
+
+
+
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html
index 6d9281523..f81d7b7fa 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.html
@@ -120,7 +120,7 @@
112 while (subIterator.hasNext()) {
113 final Dependency nextDependency = subIterator.next();
114 if (hashesMatch(dependency, nextDependency)) {
-115 if (isCore(dependency, nextDependency)) {
+115 if (firstPathIsShortest(dependency.getFilePath(), nextDependency.getFilePath())) {
116 mergeDependencies(dependency, nextDependency, dependenciesToRemove);
117 } else {
118 mergeDependencies(nextDependency, dependency, dependenciesToRemove);
@@ -398,7 +398,46 @@
390 }
391 return false;
392 }
-393 }
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402 protected boolean firstPathIsShortest(String left, String right) {
+403 final String leftPath = left.replace('\\', '/');
+404 final String rightPath = right.replace('\\', '/');
+405
+406 final int leftCount = countChar(leftPath, '/');
+407 final int rightCount = countChar(rightPath, '/');
+408 if (leftCount == rightCount) {
+409 return leftPath.compareTo(rightPath) <= 0;
+410 } else {
+411 return leftCount < rightCount;
+412 }
+413 }
+414
+415
+416
+417
+418
+419
+420
+421
+422 private int countChar(String string, char c) {
+423 int count = 0;
+424 final int max = string.length();
+425 for (int i = 0; i < max; i++) {
+426 if (c == string.charAt(i)) {
+427 count++;
+428 }
+429 }
+430 return count;
+431 }
+432 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html
index f618044a8..264c891f9 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FalsePositiveAnalyzer.html
@@ -101,375 +101,379 @@
93 addFalseNegativeCPEs(dependency);
94 }
95
-96 private void removeBadSpringMatches(Dependency dependency) {
-97 String mustContain = null ;
-98 for (Identifier i : dependency.getIdentifiers()) {
-99 if ("maven" .contains(i.getType())) {
-100 if (i.getValue() != null && i.getValue().startsWith("org.springframework." )) {
-101 int endPoint = i.getValue().indexOf(":" , 19);
-102 if (endPoint >= 0) {
-103 mustContain = i.getValue().substring(19, endPoint).toLowerCase();
-104 break ;
-105 }
-106 }
-107 }
-108 }
-109 if (mustContain != null ) {
-110 Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
-111 while (itr.hasNext()) {
-112 Identifier i = itr.next();
-113 if ("cpe" .contains(i.getType())
-114 && i.getValue() != null
-115 && i.getValue().startsWith("cpe:/a:springsource:" )
-116 && !i.getValue().toLowerCase().contains(mustContain)) {
-117 itr.remove();
-118
-119 }
-120
-121 }
-122 }
-123 }
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143 @SuppressWarnings("null" )
-144 private void removeSpuriousCPE(Dependency dependency) {
-145 final List<Identifier> ids = new ArrayList<Identifier>();
-146 ids.addAll(dependency.getIdentifiers());
-147 Collections.sort(ids);
-148 final ListIterator<Identifier> mainItr = ids.listIterator();
-149 while (mainItr.hasNext()) {
-150 final Identifier currentId = mainItr.next();
-151 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
-152 if (currentCpe == null ) {
-153 continue ;
-154 }
-155 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
-156 while (subItr.hasNext()) {
-157 final Identifier nextId = subItr.next();
-158 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
-159 if (nextCpe == null ) {
-160 continue ;
-161 }
-162
-163 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
-164 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
-165
-166 final String currentVersion = currentCpe.getVersion();
-167 final String nextVersion = nextCpe.getVersion();
-168 if (currentVersion == null && nextVersion == null ) {
-169
-170 LOGGER.log(Level.FINE, "currentVersion and nextVersion are both null?" );
-171 } else if (currentVersion == null && nextVersion != null ) {
-172 dependency.getIdentifiers().remove(currentId);
-173 } else if (nextVersion == null && currentVersion != null ) {
-174 dependency.getIdentifiers().remove(nextId);
-175 } else if (currentVersion.length() < nextVersion.length()) {
-176 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
-177 dependency.getIdentifiers().remove(currentId);
-178 }
-179 } else {
-180 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
-181 dependency.getIdentifiers().remove(nextId);
+96
+97
+98
+99
+100
+101 private void removeBadSpringMatches(Dependency dependency) {
+102 String mustContain = null ;
+103 for (Identifier i : dependency.getIdentifiers()) {
+104 if ("maven" .contains(i.getType())) {
+105 if (i.getValue() != null && i.getValue().startsWith("org.springframework." )) {
+106 final int endPoint = i.getValue().indexOf(":" , 19);
+107 if (endPoint >= 0) {
+108 mustContain = i.getValue().substring(19, endPoint).toLowerCase();
+109 break ;
+110 }
+111 }
+112 }
+113 }
+114 if (mustContain != null ) {
+115 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+116 while (itr.hasNext()) {
+117 final Identifier i = itr.next();
+118 if ("cpe" .contains(i.getType())
+119 && i.getValue() != null
+120 && i.getValue().startsWith("cpe:/a:springsource:" )
+121 && !i.getValue().toLowerCase().contains(mustContain)) {
+122 itr.remove();
+123
+124 }
+125 }
+126 }
+127 }
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147 @SuppressWarnings("null" )
+148 private void removeSpuriousCPE(Dependency dependency) {
+149 final List<Identifier> ids = new ArrayList<Identifier>();
+150 ids.addAll(dependency.getIdentifiers());
+151 Collections.sort(ids);
+152 final ListIterator<Identifier> mainItr = ids.listIterator();
+153 while (mainItr.hasNext()) {
+154 final Identifier currentId = mainItr.next();
+155 final VulnerableSoftware currentCpe = parseCpe(currentId.getType(), currentId.getValue());
+156 if (currentCpe == null ) {
+157 continue ;
+158 }
+159 final ListIterator<Identifier> subItr = ids.listIterator(mainItr.nextIndex());
+160 while (subItr.hasNext()) {
+161 final Identifier nextId = subItr.next();
+162 final VulnerableSoftware nextCpe = parseCpe(nextId.getType(), nextId.getValue());
+163 if (nextCpe == null ) {
+164 continue ;
+165 }
+166
+167 if (currentCpe.getVendor().equals(nextCpe.getVendor())) {
+168 if (currentCpe.getProduct().equals(nextCpe.getProduct())) {
+169
+170 final String currentVersion = currentCpe.getVersion();
+171 final String nextVersion = nextCpe.getVersion();
+172 if (currentVersion == null && nextVersion == null ) {
+173
+174 LOGGER.log(Level.FINE, "currentVersion and nextVersion are both null?" );
+175 } else if (currentVersion == null && nextVersion != null ) {
+176 dependency.getIdentifiers().remove(currentId);
+177 } else if (nextVersion == null && currentVersion != null ) {
+178 dependency.getIdentifiers().remove(nextId);
+179 } else if (currentVersion.length() < nextVersion.length()) {
+180 if (nextVersion.startsWith(currentVersion) || "-" .equals(currentVersion)) {
+181 dependency.getIdentifiers().remove(currentId);
182 }
-183 }
-184 }
-185 }
-186 }
-187 }
-188 }
-189
-190
-191
-192 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
-193 + "java(_platform_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
-194 + "jdk|jre|jsse)($|:.*)" );
-195
-196
-197
-198
-199 public static final Pattern CORE_JAVA_JSF = Pattern.compile("^cpe:/a:(sun|oracle|ibm):jsf($|:.*)" );
+183 } else {
+184 if (currentVersion.startsWith(nextVersion) || "-" .equals(nextVersion)) {
+185 dependency.getIdentifiers().remove(nextId);
+186 }
+187 }
+188 }
+189 }
+190 }
+191 }
+192 }
+193
+194
+195
+196 public static final Pattern CORE_JAVA = Pattern.compile("^cpe:/a:(sun|oracle|ibm):(j2[ems]e|"
+197 + "java(_platform_micro_edition|_runtime_environment|_se|virtual_machine|se_development_kit|fx)?|"
+198 + "jdk|jre|jsse)($|:.*)" );
+199
200
-201
+201
202
-203 public static final Pattern CORE_FILES = Pattern.compile("(^|/)((alt[-])?rt|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
+203 public static final Pattern CORE_JAVA_JSF = Pattern.compile("^cpe:/a:(sun|oracle|ibm):jsf($|:.*)" );
204
-205
+205
206
-207 public static final Pattern CORE_JSF_FILES = Pattern.compile("(^|/)jsf[-][^/]*\\.jar$" );
-208
-209
-210
-211
-212
-213
-214 private void removeJreEntries(Dependency dependency) {
-215 final Set<Identifier> identifiers = dependency.getIdentifiers();
-216 final Iterator<Identifier> itr = identifiers.iterator();
-217 while (itr.hasNext()) {
-218 final Identifier i = itr.next();
-219 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
-220 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
-221 if (coreCPE.matches() && !coreFiles.matches()) {
-222 itr.remove();
-223 }
-224 final Matcher coreJsfCPE = CORE_JAVA_JSF.matcher(i.getValue());
-225 final Matcher coreJsfFiles = CORE_JSF_FILES.matcher(dependency.getFileName());
-226 if (coreJsfCPE.matches() && !coreJsfFiles.matches()) {
-227 itr.remove();
-228 }
-229 }
-230 }
-231
-232
-233
-234
-235
-236
-237
-238
-239 private VulnerableSoftware parseCpe(String type, String value) {
-240 if (!"cpe" .equals(type)) {
-241 return null ;
-242 }
-243 final VulnerableSoftware cpe = new VulnerableSoftware ();
-244 try {
-245 cpe.parseName(value);
-246 } catch (UnsupportedEncodingException ex) {
-247 LOGGER.log(Level.FINEST, null , ex);
-248 return null ;
-249 }
-250 return cpe;
-251 }
-252
-253
-254
-255
-256
-257
-258
-259 private void removeBadMatches(Dependency dependency) {
-260 final Set<Identifier> identifiers = dependency.getIdentifiers();
-261 final Iterator<Identifier> itr = identifiers.iterator();
-262
-263
-264
-265
-266
-267
-268
-269
-270 while (itr.hasNext()) {
-271 final Identifier i = itr.next();
-272
-273 if ("cpe" .equals(i.getType())) {
-274 if ((i.getValue().matches(".*c\\+\\+.*" )
-275 || i.getValue().startsWith("cpe:/a:file:file" )
-276 || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
-277 || i.getValue().startsWith("cpe:/a:cvs:cvs" )
-278 || i.getValue().startsWith("cpe:/a:ftp:ftp" )
-279 || i.getValue().startsWith("cpe:/a:tcp:tcp" )
-280 || i.getValue().startsWith("cpe:/a:ssh:ssh" )
-281 || i.getValue().startsWith("cpe:/a:lookup:lookup" ))
-282 && (dependency.getFileName().toLowerCase().endsWith(".jar" )
-283 || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
-284 || dependency.getFileName().toLowerCase().endsWith(".dll" )
-285 || dependency.getFileName().toLowerCase().endsWith(".exe" )
-286 || dependency.getFileName().toLowerCase().endsWith(".nuspec" )
-287 || dependency.getFileName().toLowerCase().endsWith(".nupkg" ))) {
-288 itr.remove();
-289 } else if ((i.getValue().startsWith("cpe:/a:jquery:jquery" )
-290 || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
-291 || i.getValue().startsWith("cpe:/a:yahoo:yui" ))
-292 && (dependency.getFileName().toLowerCase().endsWith(".jar" )
-293 || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
-294 || dependency.getFileName().toLowerCase().endsWith(".dll" )
-295 || dependency.getFileName().toLowerCase().endsWith(".exe" ))) {
-296 itr.remove();
-297 } else if ((i.getValue().startsWith("cpe:/a:microsoft:excel" )
-298 || i.getValue().startsWith("cpe:/a:microsoft:word" )
-299 || i.getValue().startsWith("cpe:/a:microsoft:visio" )
-300 || i.getValue().startsWith("cpe:/a:microsoft:powerpoint" )
-301 || i.getValue().startsWith("cpe:/a:microsoft:office" ))
-302 && (dependency.getFileName().toLowerCase().endsWith(".jar" )
-303 || dependency.getFileName().toLowerCase().endsWith("pom.xml" ))) {
-304 itr.remove();
-305 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
-306 && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
-307 itr.remove();
-308 } else if (i.getValue().startsWith("cpe:/a:m-core:m-core" )
-309 && !dependency.getEvidenceUsed().containsUsedString("m-core" )) {
-310 itr.remove();
-311 } else if (i.getValue().startsWith("cpe:/a:jboss:jboss" )
-312 && !dependency.getFileName().toLowerCase().matches("jboss-?[\\d\\.-]+(GA)?\\.jar" )) {
-313 itr.remove();
-314 }
-315 }
-316 }
-317 }
-318
-319
-320
-321
-322
-323
-324 private void removeWrongVersionMatches(Dependency dependency) {
-325 final Set<Identifier> identifiers = dependency.getIdentifiers();
-326 final Iterator<Identifier> itr = identifiers.iterator();
-327
-328 final String fileName = dependency.getFileName();
-329 if (fileName != null && fileName.contains("axis2" )) {
-330 while (itr.hasNext()) {
-331 final Identifier i = itr.next();
-332 if ("cpe" .equals(i.getType())) {
-333 final String cpe = i.getValue();
-334 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
-335 itr.remove();
-336 }
-337 }
-338 }
-339 } else if (fileName != null && fileName.contains("axis" )) {
-340 while (itr.hasNext()) {
-341 final Identifier i = itr.next();
-342 if ("cpe" .equals(i.getType())) {
-343 final String cpe = i.getValue();
-344 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
-345 itr.remove();
-346 }
-347 }
-348 }
-349 }
-350 }
-351
-352
-353
-354
-355
-356
-357
-358
-359 private void addFalseNegativeCPEs(Dependency dependency) {
-360
-361 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
-362 while (itr.hasNext()) {
-363 final Identifier i = itr.next();
-364 if ("cpe" .equals(i.getType()) && i.getValue() != null
-365 && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
-366 || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
-367 || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
-368 || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
-369 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
-370 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
-371 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
-372 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
-373 try {
-374 dependency.addIdentifier("cpe" ,
-375 newCpe,
-376 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe, "UTF-8" )));
-377 dependency.addIdentifier("cpe" ,
-378 newCpe2,
-379 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe2, "UTF-8" )));
-380 dependency.addIdentifier("cpe" ,
-381 newCpe3,
-382 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe3, "UTF-8" )));
-383 dependency.addIdentifier("cpe" ,
-384 newCpe4,
-385 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe4, "UTF-8" )));
-386 } catch (UnsupportedEncodingException ex) {
-387 LOGGER.log(Level.FINE, null , ex);
-388 }
-389 }
-390 }
-391 }
-392
-393
-394
-395
-396
-397
-398
-399
-400 private void removeDuplicativeEntriesFromJar(Dependency dependency, Engine engine) {
-401 if (dependency.getFileName().toLowerCase().endsWith("pom.xml" )
-402 || "dll" .equals(dependency.getFileExtension())
-403 || "exe" .equals(dependency.getFileExtension())) {
-404 String parentPath = dependency.getFilePath().toLowerCase();
-405 if (parentPath.contains(".jar" )) {
-406 parentPath = parentPath.substring(0, parentPath.indexOf(".jar" ) + 4);
-407 final Dependency parent = findDependency(parentPath, engine.getDependencies());
-408 if (parent != null ) {
-409 boolean remove = false;
-410 for (Identifier i : dependency.getIdentifiers()) {
-411 if ("cpe" .equals(i.getType())) {
-412 final String trimmedCPE = trimCpeToVendor(i.getValue());
-413 for (Identifier parentId : parent.getIdentifiers()) {
-414 if ("cpe" .equals(parentId.getType()) && parentId.getValue().startsWith(trimmedCPE)) {
-415 remove |= true ;
-416 }
-417 }
-418 }
-419 if (!remove) {
-420 return ;
-421 }
-422 }
-423 if (remove) {
-424 engine.getDependencies().remove(dependency);
-425 }
-426 }
-427 }
-428
-429 }
-430 }
-431
-432
-433
-434
-435
-436
-437
-438
-439 private Dependency findDependency(String dependencyPath, List<Dependency> dependencies) {
-440 for (Dependency d : dependencies) {
-441 if (d.getFilePath().equalsIgnoreCase(dependencyPath)) {
-442 return d;
-443 }
-444 }
-445 return null ;
-446 }
-447
-448
-449
-450
-451
-452
-453
-454 private String trimCpeToVendor(String value) {
-455
-456 final int pos1 = value.indexOf(":" , 7);
-457 final int pos2 = value.indexOf(":" , pos1 + 1);
-458 if (pos2 < 0) {
-459 return value;
-460 } else {
-461 return value.substring(0, pos2);
-462 }
-463 }
-464 }
+207 public static final Pattern CORE_FILES = Pattern.compile("(^|/)((alt[-])?rt|jsse|jfxrt|jfr|jce|javaws|deploy|charsets)\\.jar$" );
+208
+209
+210
+211 public static final Pattern CORE_JSF_FILES = Pattern.compile("(^|/)jsf[-][^/]*\\.jar$" );
+212
+213
+214
+215
+216
+217
+218 private void removeJreEntries(Dependency dependency) {
+219 final Set<Identifier> identifiers = dependency.getIdentifiers();
+220 final Iterator<Identifier> itr = identifiers.iterator();
+221 while (itr.hasNext()) {
+222 final Identifier i = itr.next();
+223 final Matcher coreCPE = CORE_JAVA.matcher(i.getValue());
+224 final Matcher coreFiles = CORE_FILES.matcher(dependency.getFileName());
+225 if (coreCPE.matches() && !coreFiles.matches()) {
+226 itr.remove();
+227 }
+228 final Matcher coreJsfCPE = CORE_JAVA_JSF.matcher(i.getValue());
+229 final Matcher coreJsfFiles = CORE_JSF_FILES.matcher(dependency.getFileName());
+230 if (coreJsfCPE.matches() && !coreJsfFiles.matches()) {
+231 itr.remove();
+232 }
+233 }
+234 }
+235
+236
+237
+238
+239
+240
+241
+242
+243 private VulnerableSoftware parseCpe(String type, String value) {
+244 if (!"cpe" .equals(type)) {
+245 return null ;
+246 }
+247 final VulnerableSoftware cpe = new VulnerableSoftware ();
+248 try {
+249 cpe.parseName(value);
+250 } catch (UnsupportedEncodingException ex) {
+251 LOGGER.log(Level.FINEST, null , ex);
+252 return null ;
+253 }
+254 return cpe;
+255 }
+256
+257
+258
+259
+260
+261
+262
+263 private void removeBadMatches(Dependency dependency) {
+264 final Set<Identifier> identifiers = dependency.getIdentifiers();
+265 final Iterator<Identifier> itr = identifiers.iterator();
+266
+267
+268
+269
+270
+271
+272
+273
+274 while (itr.hasNext()) {
+275 final Identifier i = itr.next();
+276
+277 if ("cpe" .equals(i.getType())) {
+278 if ((i.getValue().matches(".*c\\+\\+.*" )
+279 || i.getValue().startsWith("cpe:/a:file:file" )
+280 || i.getValue().startsWith("cpe:/a:mozilla:mozilla" )
+281 || i.getValue().startsWith("cpe:/a:cvs:cvs" )
+282 || i.getValue().startsWith("cpe:/a:ftp:ftp" )
+283 || i.getValue().startsWith("cpe:/a:tcp:tcp" )
+284 || i.getValue().startsWith("cpe:/a:ssh:ssh" )
+285 || i.getValue().startsWith("cpe:/a:lookup:lookup" ))
+286 && (dependency.getFileName().toLowerCase().endsWith(".jar" )
+287 || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
+288 || dependency.getFileName().toLowerCase().endsWith(".dll" )
+289 || dependency.getFileName().toLowerCase().endsWith(".exe" )
+290 || dependency.getFileName().toLowerCase().endsWith(".nuspec" )
+291 || dependency.getFileName().toLowerCase().endsWith(".nupkg" ))) {
+292 itr.remove();
+293 } else if ((i.getValue().startsWith("cpe:/a:jquery:jquery" )
+294 || i.getValue().startsWith("cpe:/a:prototypejs:prototype" )
+295 || i.getValue().startsWith("cpe:/a:yahoo:yui" ))
+296 && (dependency.getFileName().toLowerCase().endsWith(".jar" )
+297 || dependency.getFileName().toLowerCase().endsWith("pom.xml" )
+298 || dependency.getFileName().toLowerCase().endsWith(".dll" )
+299 || dependency.getFileName().toLowerCase().endsWith(".exe" ))) {
+300 itr.remove();
+301 } else if ((i.getValue().startsWith("cpe:/a:microsoft:excel" )
+302 || i.getValue().startsWith("cpe:/a:microsoft:word" )
+303 || i.getValue().startsWith("cpe:/a:microsoft:visio" )
+304 || i.getValue().startsWith("cpe:/a:microsoft:powerpoint" )
+305 || i.getValue().startsWith("cpe:/a:microsoft:office" ))
+306 && (dependency.getFileName().toLowerCase().endsWith(".jar" )
+307 || dependency.getFileName().toLowerCase().endsWith("pom.xml" ))) {
+308 itr.remove();
+309 } else if (i.getValue().startsWith("cpe:/a:apache:maven" )
+310 && !dependency.getFileName().toLowerCase().matches("maven-core-[\\d\\.]+\\.jar" )) {
+311 itr.remove();
+312 } else if (i.getValue().startsWith("cpe:/a:m-core:m-core" )
+313 && !dependency.getEvidenceUsed().containsUsedString("m-core" )) {
+314 itr.remove();
+315 } else if (i.getValue().startsWith("cpe:/a:jboss:jboss" )
+316 && !dependency.getFileName().toLowerCase().matches("jboss-?[\\d\\.-]+(GA)?\\.jar" )) {
+317 itr.remove();
+318 }
+319 }
+320 }
+321 }
+322
+323
+324
+325
+326
+327
+328 private void removeWrongVersionMatches(Dependency dependency) {
+329 final Set<Identifier> identifiers = dependency.getIdentifiers();
+330 final Iterator<Identifier> itr = identifiers.iterator();
+331
+332 final String fileName = dependency.getFileName();
+333 if (fileName != null && fileName.contains("axis2" )) {
+334 while (itr.hasNext()) {
+335 final Identifier i = itr.next();
+336 if ("cpe" .equals(i.getType())) {
+337 final String cpe = i.getValue();
+338 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis:" ) || "cpe:/a:apache:axis" .equals(cpe))) {
+339 itr.remove();
+340 }
+341 }
+342 }
+343 } else if (fileName != null && fileName.contains("axis" )) {
+344 while (itr.hasNext()) {
+345 final Identifier i = itr.next();
+346 if ("cpe" .equals(i.getType())) {
+347 final String cpe = i.getValue();
+348 if (cpe != null && (cpe.startsWith("cpe:/a:apache:axis2:" ) || "cpe:/a:apache:axis2" .equals(cpe))) {
+349 itr.remove();
+350 }
+351 }
+352 }
+353 }
+354 }
+355
+356
+357
+358
+359
+360
+361
+362
+363 private void addFalseNegativeCPEs(Dependency dependency) {
+364
+365 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+366 while (itr.hasNext()) {
+367 final Identifier i = itr.next();
+368 if ("cpe" .equals(i.getType()) && i.getValue() != null
+369 && (i.getValue().startsWith("cpe:/a:oracle:opensso:" )
+370 || i.getValue().startsWith("cpe:/a:oracle:opensso_enterprise:" )
+371 || i.getValue().startsWith("cpe:/a:sun:opensso_enterprise:" )
+372 || i.getValue().startsWith("cpe:/a:sun:opensso:" ))) {
+373 final String newCpe = String.format("cpe:/a:sun:opensso_enterprise:%s" , i.getValue().substring(22));
+374 final String newCpe2 = String.format("cpe:/a:oracle:opensso_enterprise:%s" , i.getValue().substring(22));
+375 final String newCpe3 = String.format("cpe:/a:sun:opensso:%s" , i.getValue().substring(22));
+376 final String newCpe4 = String.format("cpe:/a:oracle:opensso:%s" , i.getValue().substring(22));
+377 try {
+378 dependency.addIdentifier("cpe" ,
+379 newCpe,
+380 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe, "UTF-8" )));
+381 dependency.addIdentifier("cpe" ,
+382 newCpe2,
+383 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe2, "UTF-8" )));
+384 dependency.addIdentifier("cpe" ,
+385 newCpe3,
+386 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe3, "UTF-8" )));
+387 dependency.addIdentifier("cpe" ,
+388 newCpe4,
+389 String.format(CPEAnalyzer.NVD_SEARCH_URL, URLEncoder.encode(newCpe4, "UTF-8" )));
+390 } catch (UnsupportedEncodingException ex) {
+391 LOGGER.log(Level.FINE, null , ex);
+392 }
+393 }
+394 }
+395 }
+396
+397
+398
+399
+400
+401
+402
+403
+404 private void removeDuplicativeEntriesFromJar(Dependency dependency, Engine engine) {
+405 if (dependency.getFileName().toLowerCase().endsWith("pom.xml" )
+406 || "dll" .equals(dependency.getFileExtension())
+407 || "exe" .equals(dependency.getFileExtension())) {
+408 String parentPath = dependency.getFilePath().toLowerCase();
+409 if (parentPath.contains(".jar" )) {
+410 parentPath = parentPath.substring(0, parentPath.indexOf(".jar" ) + 4);
+411 final Dependency parent = findDependency(parentPath, engine.getDependencies());
+412 if (parent != null ) {
+413 boolean remove = false;
+414 for (Identifier i : dependency.getIdentifiers()) {
+415 if ("cpe" .equals(i.getType())) {
+416 final String trimmedCPE = trimCpeToVendor(i.getValue());
+417 for (Identifier parentId : parent.getIdentifiers()) {
+418 if ("cpe" .equals(parentId.getType()) && parentId.getValue().startsWith(trimmedCPE)) {
+419 remove |= true ;
+420 }
+421 }
+422 }
+423 if (!remove) {
+424 return ;
+425 }
+426 }
+427 if (remove) {
+428 engine.getDependencies().remove(dependency);
+429 }
+430 }
+431 }
+432
+433 }
+434 }
+435
+436
+437
+438
+439
+440
+441
+442
+443 private Dependency findDependency(String dependencyPath, List<Dependency> dependencies) {
+444 for (Dependency d : dependencies) {
+445 if (d.getFilePath().equalsIgnoreCase(dependencyPath)) {
+446 return d;
+447 }
+448 }
+449 return null ;
+450 }
+451
+452
+453
+454
+455
+456
+457
+458 private String trimCpeToVendor(String value) {
+459
+460 final int pos1 = value.indexOf(":" , 7);
+461 final int pos2 = value.indexOf(":" , pos1 + 1);
+462 if (pos2 < 0) {
+463 return value;
+464 } else {
+465 return value.substring(0, pos2);
+466 }
+467 }
+468 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FileNameAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FileNameAnalyzer.html
index 67b9ee555..04221a3f2 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FileNameAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/FileNameAnalyzer.html
@@ -81,7 +81,7 @@
73 public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
74
75
-76 final File f = new File(dependency.getFileName());
+76 final File f = dependency.getActualFile();
77 String fileName = f.getName();
78
79
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/JarAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/JarAnalyzer.html
index fe3658e13..fe2522a63 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/JarAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/JarAnalyzer.html
@@ -301,1060 +301,1110 @@
293 LOGGER.log(Level.FINE, msg, ex);
294 return false;
295 }
-296 if (pomEntries.isEmpty()) {
-297 return false;
-298 }
-299 for (String path : pomEntries) {
-300 Properties pomProperties = null ;
-301 try {
-302 pomProperties = retrievePomProperties(path, jar);
-303 } catch (IOException ex) {
-304 LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties" , ex);
-305 }
-306 Model pom = null ;
-307 try {
-308 if (pomEntries.size() > 1) {
-309
-310 final Dependency newDependency = new Dependency ();
-311 pom = extractPom(path, jar, newDependency);
-312
-313 final String displayPath = String.format("%s%s%s" ,
-314 dependency.getFilePath(),
-315 File.separator,
-316 path);
-317 final String displayName = String.format("%s%s%s" ,
-318 dependency.getFileName(),
-319 File.separator,
-320 path);
-321
-322 newDependency.setFileName(displayName);
-323 newDependency.setFilePath(displayPath);
-324 setPomEvidence(newDependency, pom, pomProperties, null );
-325 engine.getDependencies().add(newDependency);
-326 Collections.sort(engine.getDependencies());
-327 } else {
-328 pom = retrievePom(path, jar);
-329 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
-330 }
-331 } catch (AnalysisException ex) {
-332 final String msg = String.format("An error occured while analyzing '%s'." , dependency.getActualFilePath());
-333 LOGGER.log(Level.WARNING, msg);
-334 LOGGER.log(Level.FINE, "" , ex);
-335 }
-336 }
-337 return foundSomething;
-338 }
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348 private Properties retrievePomProperties(String path, final JarFile jar) throws IOException {
-349 Properties pomProperties = null ;
-350 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
-351 final ZipEntry propEntry = jar.getEntry(propPath);
-352 if (propEntry != null ) {
-353 Reader reader = null ;
-354 try {
-355 reader = new InputStreamReader(jar.getInputStream(propEntry), "UTF-8" );
-356 pomProperties = new Properties ();
-357 pomProperties.load(reader);
-358 } finally {
-359 if (reader != null ) {
-360 try {
-361 reader.close();
-362 } catch (IOException ex) {
-363 LOGGER.log(Level.FINEST, "close error" , ex);
-364 }
-365 }
-366 }
-367 }
-368 return pomProperties;
-369 }
-370
-371
-372
-373
-374
-375
-376
-377
-378 private List<String> retrievePomListing(final JarFile jar) throws IOException {
-379 final List<String> pomEntries = new ArrayList<String>();
-380 final Enumeration<JarEntry> entries = jar.entries();
-381 while (entries.hasMoreElements()) {
-382 final JarEntry entry = entries.nextElement();
-383 final String entryName = (new File(entry.getName())).getName().toLowerCase();
-384 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
-385 pomEntries.add(entry.getName());
-386 }
-387 }
-388 return pomEntries;
-389 }
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401 private Model extractPom(String path, JarFile jar, Dependency dependency) throws AnalysisException {
-402 InputStream input = null ;
-403 FileOutputStream fos = null ;
-404 BufferedOutputStream bos = null ;
-405 final File tmpDir = getNextTempDirectory();
-406 final File file = new File(tmpDir, "pom.xml" );
-407 try {
-408 final ZipEntry entry = jar.getEntry(path);
-409 input = jar.getInputStream(entry);
-410 fos = new FileOutputStream(file);
-411 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
-412 int count;
-413 final byte data[] = new byte[BUFFER_SIZE];
-414 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
-415 bos.write(data, 0, count);
-416 }
-417 bos.flush();
-418 dependency.setActualFilePath(file.getAbsolutePath());
-419 } catch (IOException ex) {
-420 final String msg = String.format("An error occurred reading '%s' from '%s'." , path, dependency.getFilePath());
-421 LOGGER.warning(msg);
-422 LOGGER.log(Level.SEVERE, "" , ex);
-423 } finally {
-424 closeStream(bos);
-425 closeStream(fos);
-426 closeStream(input);
-427 }
-428 Model model = null ;
-429 FileInputStream fis = null ;
-430 try {
-431 fis = new FileInputStream(file);
-432 final InputStreamReader reader = new InputStreamReader(fis, "UTF-8" );
-433 final InputSource xml = new InputSource(reader);
-434 final SAXSource source = new SAXSource(xml);
-435 model = readPom(source);
-436 } catch (FileNotFoundException ex) {
-437 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (File Not Found)" , path, jar.getName());
-438 LOGGER.log(Level.WARNING, msg);
-439 LOGGER.log(Level.FINE, "" , ex);
-440 throw new AnalysisException (ex);
-441 } catch (UnsupportedEncodingException ex) {
-442 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
-443 LOGGER.log(Level.WARNING, msg);
-444 LOGGER.log(Level.FINE, "" , ex);
-445 throw new AnalysisException (ex);
-446 } catch (AnalysisException ex) {
-447 final String msg = String.format("Unable to parse pom '%s' in jar '%s'" , path, jar.getName());
-448 LOGGER.log(Level.WARNING, msg);
-449 LOGGER.log(Level.FINE, "" , ex);
-450 throw ex;
-451 } finally {
-452 closeStream(fis);
-453 }
-454 return model;
-455 }
-456
-457
-458
-459
-460
-461
-462 private void closeStream(InputStream stream) {
-463 if (stream != null ) {
-464 try {
-465 stream.close();
-466 } catch (IOException ex) {
-467 LOGGER.log(Level.FINEST, null , ex);
-468 }
-469 }
-470 }
-471
-472
-473
-474
-475
-476
-477 private void closeStream(OutputStream stream) {
-478 if (stream != null ) {
-479 try {
-480 stream.close();
-481 } catch (IOException ex) {
-482 LOGGER.log(Level.FINEST, null , ex);
-483 }
-484 }
-485 }
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496 private Model retrievePom(String path, JarFile jar) throws AnalysisException {
-497 final ZipEntry entry = jar.getEntry(path);
-498 Model model = null ;
-499 if (entry != null ) {
-500 try {
-501 final NonClosingStream stream = new NonClosingStream (jar.getInputStream(entry));
-502 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
-503 final InputSource xml = new InputSource(reader);
-504 final SAXSource source = new SAXSource(xml);
-505 model = readPom(source);
-506 } catch (SecurityException ex) {
-507 final String msg = String.format("Unable to parse pom '%s' in jar '%s'; invalid signature" , path, jar.getName());
-508 LOGGER.log(Level.WARNING, msg);
-509 LOGGER.log(Level.FINE, null , ex);
-510 throw new AnalysisException (ex);
-511 } catch (IOException ex) {
-512 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
-513 LOGGER.log(Level.WARNING, msg);
-514 LOGGER.log(Level.FINE, "" , ex);
-515 throw new AnalysisException (ex);
-516 } catch (Throwable ex) {
-517 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
-518 LOGGER.log(Level.WARNING, msg);
-519 LOGGER.log(Level.FINE, "" , ex);
-520 throw new AnalysisException (ex);
-521 }
-522 }
-523 return model;
-524 }
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534 private Model readPom(SAXSource source) throws AnalysisException {
-535 Model model = null ;
-536 try {
-537 final XMLFilter filter = new MavenNamespaceFilter ();
-538 final SAXParserFactory spf = SAXParserFactory.newInstance();
-539 final SAXParser sp = spf.newSAXParser();
-540 final XMLReader xr = sp.getXMLReader();
-541 filter.setParent(xr);
-542 final JAXBElement<Model> el = pomUnmarshaller.unmarshal(source, Model.class );
-543 model = el.getValue();
-544 } catch (SecurityException ex) {
-545 throw new AnalysisException (ex);
-546 } catch (ParserConfigurationException ex) {
-547 throw new AnalysisException (ex);
-548 } catch (SAXException ex) {
-549 throw new AnalysisException (ex);
-550 } catch (JAXBException ex) {
-551 throw new AnalysisException (ex);
-552 } catch (Throwable ex) {
-553 throw new AnalysisException (ex);
-554 }
-555 return model;
-556 }
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568 private boolean setPomEvidence(Dependency dependency, Model pom, Properties pomProperties, ArrayList<ClassNameInformation> classes) {
-569 boolean foundSomething = false;
-570 boolean addAsIdentifier = true ;
-571 if (pom == null ) {
-572 return foundSomething;
-573 }
-574 String groupid = interpolateString(pom.getGroupId(), pomProperties);
-575 String parentGroupId = null ;
-576
-577 if (pom.getParent() != null ) {
-578 parentGroupId = interpolateString(pom.getParent().getGroupId(), pomProperties);
-579 if ((groupid == null || groupid.isEmpty()) && parentGroupId != null && !parentGroupId.isEmpty()) {
-580 groupid = parentGroupId;
-581 }
-582 }
-583 final String originalGroupID = groupid;
-584
-585 if (groupid != null && !groupid.isEmpty()) {
-586 if (groupid.startsWith("org." ) || groupid.startsWith("com." )) {
-587 groupid = groupid.substring(4);
-588 }
-589 foundSomething = true ;
-590 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGHEST);
-591 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
-592 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
-593 addMatchingValues(classes, groupid, dependency.getProductEvidence());
-594 if (parentGroupId != null && !parentGroupId.isEmpty() && !parentGroupId.equals(groupid)) {
-595 dependency.getVendorEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.MEDIUM);
-596 dependency.getProductEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.LOW);
-597 addMatchingValues(classes, parentGroupId, dependency.getVendorEvidence());
-598 addMatchingValues(classes, parentGroupId, dependency.getProductEvidence());
-599 }
-600 } else {
-601 addAsIdentifier = false;
-602 }
-603
-604 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
-605 String parentArtifactId = null ;
-606
-607 if (pom.getParent() != null ) {
-608 parentArtifactId = interpolateString(pom.getParent().getArtifactId(), pomProperties);
-609 if ((artifactid == null || artifactid.isEmpty()) && parentArtifactId != null && !parentArtifactId.isEmpty()) {
-610 artifactid = parentArtifactId;
-611 }
-612 }
-613 final String originalArtifactID = artifactid;
-614 if (artifactid != null && !artifactid.isEmpty()) {
-615 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
-616 artifactid = artifactid.substring(4);
-617 }
-618 foundSomething = true ;
-619 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGHEST);
-620 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
-621 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
-622 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
-623 if (parentArtifactId != null && !parentArtifactId.isEmpty() && !parentArtifactId.equals(artifactid)) {
-624 dependency.getProductEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.MEDIUM);
-625 dependency.getVendorEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.LOW);
-626 addMatchingValues(classes, parentArtifactId, dependency.getVendorEvidence());
-627 addMatchingValues(classes, parentArtifactId, dependency.getProductEvidence());
-628 }
-629 } else {
-630 addAsIdentifier = false;
-631 }
-632
-633 String version = interpolateString(pom.getVersion(), pomProperties);
-634 String parentVersion = null ;
-635
-636 if (pom.getParent() != null ) {
-637 parentVersion = interpolateString(pom.getParent().getVersion(), pomProperties);
-638 if ((version == null || version.isEmpty()) && parentVersion != null && !parentVersion.isEmpty()) {
-639 version = parentVersion;
-640 }
-641 }
-642
-643 if (version != null && !version.isEmpty()) {
-644 foundSomething = true ;
-645 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
-646 if (parentVersion != null && !parentVersion.isEmpty() && !parentVersion.equals(version)) {
-647 dependency.getVersionEvidence().addEvidence("pom" , "parent-version" , version, Confidence.LOW);
-648 }
-649 } else {
-650 addAsIdentifier = false;
-651 }
-652
-653 if (addAsIdentifier) {
-654 dependency.addIdentifier("maven" , String.format("%s:%s:%s" , originalGroupID, originalArtifactID, version), null , Confidence.LOW);
-655 }
+296 File externalPom = null ;
+297 if (pomEntries.isEmpty()) {
+298 if (dependency.getActualFilePath().matches(".*\\.m2.repository\\b.*" )) {
+299 String pomPath = dependency.getActualFilePath();
+300 pomPath = pomPath.substring(0, pomPath.lastIndexOf('.')) + ".pom" ;
+301 externalPom = new File(pomPath);
+302 if (externalPom.isFile()) {
+303 pomEntries.add(pomPath);
+304 } else {
+305 return false;
+306 }
+307 } else {
+308 return false;
+309 }
+310 }
+311 for (String path : pomEntries) {
+312 Properties pomProperties = null ;
+313 try {
+314 if (externalPom == null ) {
+315 pomProperties = retrievePomProperties(path, jar);
+316 }
+317 } catch (IOException ex) {
+318 LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties" , ex);
+319 }
+320 Model pom = null ;
+321 try {
+322 if (pomEntries.size() > 1) {
+323
+324 final Dependency newDependency = new Dependency ();
+325 pom = extractPom(path, jar, newDependency);
+326
+327 final String displayPath = String.format("%s%s%s" ,
+328 dependency.getFilePath(),
+329 File.separator,
+330 path);
+331 final String displayName = String.format("%s%s%s" ,
+332 dependency.getFileName(),
+333 File.separator,
+334 path);
+335
+336 newDependency.setFileName(displayName);
+337 newDependency.setFilePath(displayPath);
+338 setPomEvidence(newDependency, pom, pomProperties, null );
+339 engine.getDependencies().add(newDependency);
+340 Collections.sort(engine.getDependencies());
+341 } else {
+342 if (externalPom == null ) {
+343 pom = retrievePom(path, jar);
+344 } else {
+345 pom = retrievePom(externalPom);
+346 }
+347 foundSomething |= setPomEvidence(dependency, pom, pomProperties, classes);
+348 }
+349 } catch (AnalysisException ex) {
+350 final String msg = String.format("An error occured while analyzing '%s'." , dependency.getActualFilePath());
+351 LOGGER.log(Level.WARNING, msg);
+352 LOGGER.log(Level.FINE, "" , ex);
+353 }
+354 }
+355 return foundSomething;
+356 }
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366 private Properties retrievePomProperties(String path, final JarFile jar) throws IOException {
+367 Properties pomProperties = null ;
+368 final String propPath = path.substring(0, path.length() - 7) + "pom.properies" ;
+369 final ZipEntry propEntry = jar.getEntry(propPath);
+370 if (propEntry != null ) {
+371 Reader reader = null ;
+372 try {
+373 reader = new InputStreamReader(jar.getInputStream(propEntry), "UTF-8" );
+374 pomProperties = new Properties ();
+375 pomProperties.load(reader);
+376 } finally {
+377 if (reader != null ) {
+378 try {
+379 reader.close();
+380 } catch (IOException ex) {
+381 LOGGER.log(Level.FINEST, "close error" , ex);
+382 }
+383 }
+384 }
+385 }
+386 return pomProperties;
+387 }
+388
+389
+390
+391
+392
+393
+394
+395
+396 private List<String> retrievePomListing(final JarFile jar) throws IOException {
+397 final List<String> pomEntries = new ArrayList<String>();
+398 final Enumeration<JarEntry> entries = jar.entries();
+399 while (entries.hasMoreElements()) {
+400 final JarEntry entry = entries.nextElement();
+401 final String entryName = (new File(entry.getName())).getName().toLowerCase();
+402 if (!entry.isDirectory() && "pom.xml" .equals(entryName)) {
+403 pomEntries.add(entry.getName());
+404 }
+405 }
+406 return pomEntries;
+407 }
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419 private Model extractPom(String path, JarFile jar, Dependency dependency) throws AnalysisException {
+420 InputStream input = null ;
+421 FileOutputStream fos = null ;
+422 BufferedOutputStream bos = null ;
+423 final File tmpDir = getNextTempDirectory();
+424 final File file = new File(tmpDir, "pom.xml" );
+425 try {
+426 final ZipEntry entry = jar.getEntry(path);
+427 input = jar.getInputStream(entry);
+428 fos = new FileOutputStream(file);
+429 bos = new BufferedOutputStream(fos, BUFFER_SIZE);
+430 int count;
+431 final byte data[] = new byte[BUFFER_SIZE];
+432 while ((count = input.read(data, 0, BUFFER_SIZE)) != -1) {
+433 bos.write(data, 0, count);
+434 }
+435 bos.flush();
+436 dependency.setActualFilePath(file.getAbsolutePath());
+437 } catch (IOException ex) {
+438 final String msg = String.format("An error occurred reading '%s' from '%s'." , path, dependency.getFilePath());
+439 LOGGER.warning(msg);
+440 LOGGER.log(Level.SEVERE, "" , ex);
+441 } finally {
+442 closeStream(bos);
+443 closeStream(fos);
+444 closeStream(input);
+445 }
+446 Model model = null ;
+447 FileInputStream fis = null ;
+448 try {
+449 fis = new FileInputStream(file);
+450 final InputStreamReader reader = new InputStreamReader(fis, "UTF-8" );
+451 final InputSource xml = new InputSource(reader);
+452 final SAXSource source = new SAXSource(xml);
+453 model = readPom(source);
+454 } catch (FileNotFoundException ex) {
+455 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (File Not Found)" , path, jar.getName());
+456 LOGGER.log(Level.WARNING, msg);
+457 LOGGER.log(Level.FINE, "" , ex);
+458 throw new AnalysisException (ex);
+459 } catch (UnsupportedEncodingException ex) {
+460 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
+461 LOGGER.log(Level.WARNING, msg);
+462 LOGGER.log(Level.FINE, "" , ex);
+463 throw new AnalysisException (ex);
+464 } catch (AnalysisException ex) {
+465 final String msg = String.format("Unable to parse pom '%s' in jar '%s'" , path, jar.getName());
+466 LOGGER.log(Level.WARNING, msg);
+467 LOGGER.log(Level.FINE, "" , ex);
+468 throw ex;
+469 } finally {
+470 closeStream(fis);
+471 }
+472 return model;
+473 }
+474
+475
+476
+477
+478
+479
+480 private void closeStream(InputStream stream) {
+481 if (stream != null ) {
+482 try {
+483 stream.close();
+484 } catch (IOException ex) {
+485 LOGGER.log(Level.FINEST, null , ex);
+486 }
+487 }
+488 }
+489
+490
+491
+492
+493
+494
+495 private void closeStream(OutputStream stream) {
+496 if (stream != null ) {
+497 try {
+498 stream.close();
+499 } catch (IOException ex) {
+500 LOGGER.log(Level.FINEST, null , ex);
+501 }
+502 }
+503 }
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514 private Model retrievePom(String path, JarFile jar) throws AnalysisException {
+515 final ZipEntry entry = jar.getEntry(path);
+516 Model model = null ;
+517 if (entry != null ) {
+518 try {
+519 final NonClosingStream stream = new NonClosingStream (jar.getInputStream(entry));
+520 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
+521 final InputSource xml = new InputSource(reader);
+522 final SAXSource source = new SAXSource(xml);
+523 model = readPom(source);
+524 } catch (SecurityException ex) {
+525 final String msg = String.format("Unable to parse pom '%s' in jar '%s'; invalid signature" , path, jar.getName());
+526 LOGGER.log(Level.WARNING, msg);
+527 LOGGER.log(Level.FINE, null , ex);
+528 throw new AnalysisException (ex);
+529 } catch (IOException ex) {
+530 final String msg = String.format("Unable to parse pom '%s' in jar '%s' (IO Exception)" , path, jar.getName());
+531 LOGGER.log(Level.WARNING, msg);
+532 LOGGER.log(Level.FINE, "" , ex);
+533 throw new AnalysisException (ex);
+534 } catch (Throwable ex) {
+535 final String msg = String.format("Unexpected error during parsing of the pom '%s' in jar '%s'" , path, jar.getName());
+536 LOGGER.log(Level.WARNING, msg);
+537 LOGGER.log(Level.FINE, "" , ex);
+538 throw new AnalysisException (ex);
+539 }
+540 }
+541 return model;
+542 }
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552 private Model retrievePom(File file) throws AnalysisException {
+553 Model model = null ;
+554 try {
+555 final FileInputStream stream = new FileInputStream(file);
+556 final InputStreamReader reader = new InputStreamReader(stream, "UTF-8" );
+557 final InputSource xml = new InputSource(reader);
+558 final SAXSource source = new SAXSource(xml);
+559 model = readPom(source);
+560 } catch (SecurityException ex) {
+561 final String msg = String.format("Unable to parse pom '%s'; invalid signature" , file.getPath());
+562 LOGGER.log(Level.WARNING, msg);
+563 LOGGER.log(Level.FINE, null , ex);
+564 throw new AnalysisException (ex);
+565 } catch (IOException ex) {
+566 final String msg = String.format("Unable to parse pom '%s'(IO Exception)" , file.getPath());
+567 LOGGER.log(Level.WARNING, msg);
+568 LOGGER.log(Level.FINE, "" , ex);
+569 throw new AnalysisException (ex);
+570 } catch (Throwable ex) {
+571 final String msg = String.format("Unexpected error during parsing of the pom '%s'" , file.getPath());
+572 LOGGER.log(Level.WARNING, msg);
+573 LOGGER.log(Level.FINE, "" , ex);
+574 throw new AnalysisException (ex);
+575 }
+576 return model;
+577 }
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587 private Model readPom(SAXSource source) throws AnalysisException {
+588 Model model = null ;
+589 try {
+590 final XMLFilter filter = new MavenNamespaceFilter ();
+591 final SAXParserFactory spf = SAXParserFactory.newInstance();
+592 final SAXParser sp = spf.newSAXParser();
+593 final XMLReader xr = sp.getXMLReader();
+594 filter.setParent(xr);
+595 final JAXBElement<Model> el = pomUnmarshaller.unmarshal(source, Model.class );
+596 model = el.getValue();
+597 } catch (SecurityException ex) {
+598 throw new AnalysisException (ex);
+599 } catch (ParserConfigurationException ex) {
+600 throw new AnalysisException (ex);
+601 } catch (SAXException ex) {
+602 throw new AnalysisException (ex);
+603 } catch (JAXBException ex) {
+604 throw new AnalysisException (ex);
+605 } catch (Throwable ex) {
+606 throw new AnalysisException (ex);
+607 }
+608 return model;
+609 }
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621 private boolean setPomEvidence(Dependency dependency, Model pom, Properties pomProperties, ArrayList<ClassNameInformation> classes) {
+622 boolean foundSomething = false;
+623 boolean addAsIdentifier = true ;
+624 if (pom == null ) {
+625 return foundSomething;
+626 }
+627 String groupid = interpolateString(pom.getGroupId(), pomProperties);
+628 String parentGroupId = null ;
+629
+630 if (pom.getParent() != null ) {
+631 parentGroupId = interpolateString(pom.getParent().getGroupId(), pomProperties);
+632 if ((groupid == null || groupid.isEmpty()) && parentGroupId != null && !parentGroupId.isEmpty()) {
+633 groupid = parentGroupId;
+634 }
+635 }
+636 final String originalGroupID = groupid;
+637
+638 if (groupid != null && !groupid.isEmpty()) {
+639 foundSomething = true ;
+640 dependency.getVendorEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.HIGHEST);
+641 dependency.getProductEvidence().addEvidence("pom" , "groupid" , groupid, Confidence.LOW);
+642 addMatchingValues(classes, groupid, dependency.getVendorEvidence());
+643 addMatchingValues(classes, groupid, dependency.getProductEvidence());
+644 if (parentGroupId != null && !parentGroupId.isEmpty() && !parentGroupId.equals(groupid)) {
+645 dependency.getVendorEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.MEDIUM);
+646 dependency.getProductEvidence().addEvidence("pom" , "parent-groupid" , parentGroupId, Confidence.LOW);
+647 addMatchingValues(classes, parentGroupId, dependency.getVendorEvidence());
+648 addMatchingValues(classes, parentGroupId, dependency.getProductEvidence());
+649 }
+650 } else {
+651 addAsIdentifier = false;
+652 }
+653
+654 String artifactid = interpolateString(pom.getArtifactId(), pomProperties);
+655 String parentArtifactId = null ;
656
-657
-658 final Organization org = pom.getOrganization();
-659 if (org != null && org.getName() != null ) {
-660 foundSomething = true ;
-661 final String orgName = interpolateString(org.getName(), pomProperties);
-662 if (orgName != null && !orgName.isEmpty()) {
-663 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
-664 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
-665 }
-666 }
-667
-668 final String pomName = interpolateString(pom.getName(), pomProperties);
-669 if (pomName != null && !pomName.isEmpty()) {
-670 foundSomething = true ;
-671 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
-672 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
-673 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
-674 addMatchingValues(classes, pomName, dependency.getProductEvidence());
-675 }
-676
-677
-678 if (pom.getDescription() != null ) {
-679 foundSomething = true ;
-680 final String description = interpolateString(pom.getDescription(), pomProperties);
-681 if (description != null && !description.isEmpty()) {
-682 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
-683 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
-684 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
-685 }
-686 }
-687 extractLicense(pom, pomProperties, dependency);
-688 return foundSomething;
-689 }
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699 protected void analyzePackageNames(ArrayList<ClassNameInformation> classNames,
-700 Dependency dependency, boolean addPackagesAsEvidence) {
-701 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
-702 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
-703 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
-704
-705 final int classCount = classNames.size();
-706 final EvidenceCollection vendor = dependency.getVendorEvidence();
-707 final EvidenceCollection product = dependency.getProductEvidence();
-708
-709 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
-710 final float ratio = entry.getValue() / (float ) classCount;
-711 if (ratio > 0.5) {
-712
-713 vendor.addWeighting(entry.getKey());
-714 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
-715 vendor.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
-716 }
-717 }
-718 }
-719 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
-720 final float ratio = entry.getValue() / (float ) classCount;
-721 if (ratio > 0.5) {
-722 product.addWeighting(entry.getKey());
-723 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
-724 product.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
-725 }
-726 }
-727 }
-728 }
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744 protected boolean parseManifest(Dependency dependency, ArrayList<ClassNameInformation> classInformation) throws IOException {
-745 boolean foundSomething = false;
-746 JarFile jar = null ;
-747 try {
-748 jar = new JarFile(dependency.getActualFilePath());
-749
-750 final Manifest manifest = jar.getManifest();
-751
-752 if (manifest == null ) {
-753
-754 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
-755 && !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar" )
-756 && !dependency.getFileName().toLowerCase().endsWith("-src.jar" )
-757 && !dependency.getFileName().toLowerCase().endsWith("-doc.jar" )) {
-758 LOGGER.log(Level.FINE,
-759 String.format("Jar file '%s' does not contain a manifest." ,
-760 dependency.getFileName()));
-761 }
-762 return false;
-763 }
-764 final Attributes atts = manifest.getMainAttributes();
-765
-766 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
-767 final EvidenceCollection productEvidence = dependency.getProductEvidence();
-768 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
-769
-770 final String source = "Manifest" ;
-771
-772 for (Entry<Object, Object> entry : atts.entrySet()) {
-773 String key = entry.getKey().toString();
-774 String value = atts.getValue(key);
-775 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
-776 value = Jsoup.parse(value).text();
-777 }
-778 if (IGNORE_VALUES.contains(value)) {
-779 continue ;
-780 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
-781 foundSomething = true ;
-782 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
-783 addMatchingValues(classInformation, value, productEvidence);
-784 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
-785 foundSomething = true ;
-786 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
-787 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
-788 foundSomething = true ;
-789 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
-790 addMatchingValues(classInformation, value, vendorEvidence);
-791 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
-792 foundSomething = true ;
-793 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-794 addMatchingValues(classInformation, value, vendorEvidence);
-795 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
-796 foundSomething = true ;
-797 addDescription(dependency, value, "manifest" , key);
-798
-799 addMatchingValues(classInformation, value, productEvidence);
-800 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
-801 foundSomething = true ;
-802 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-803 addMatchingValues(classInformation, value, productEvidence);
-804 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
-805 foundSomething = true ;
-806 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
-807 addMatchingValues(classInformation, value, vendorEvidence);
-808 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
-809 foundSomething = true ;
-810 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
-811 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
-812 continue ;
-813
-814
-815
-816
-817
-818
-819
-820
-821 } else {
-822 key = key.toLowerCase();
-823
-824 if (!IGNORE_KEYS.contains(key)
-825 && !key.endsWith("jdk" )
-826 && !key.contains("lastmodified" )
-827 && !key.endsWith("package" )
-828 && !key.endsWith("classpath" )
-829 && !key.endsWith("class-path" )
-830 && !key.endsWith("-scm" )
-831 && !key.startsWith("scm-" )
-832 && !value.trim().startsWith("scm:" )
-833 && !isImportPackage(key, value)
-834 && !isPackage(key, value)) {
-835
-836 foundSomething = true ;
-837 if (key.contains("version" )) {
-838 if (key.contains("specification" )) {
-839 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
-840 } else {
-841 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-842 }
-843 } else if ("build-id" .equals(key)) {
-844 int pos = value.indexOf('(');
-845 if (pos >= 0) {
-846 value = value.substring(0, pos - 1);
-847 }
-848 pos = value.indexOf('[');
-849 if (pos >= 0) {
-850 value = value.substring(0, pos - 1);
-851 }
-852 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-853 } else if (key.contains("title" )) {
-854 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-855 addMatchingValues(classInformation, value, productEvidence);
-856 } else if (key.contains("vendor" )) {
-857 if (key.contains("specification" )) {
-858 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
-859 } else {
-860 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-861 addMatchingValues(classInformation, value, vendorEvidence);
-862 }
-863 } else if (key.contains("name" )) {
-864 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-865 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
-866 addMatchingValues(classInformation, value, vendorEvidence);
-867 addMatchingValues(classInformation, value, productEvidence);
-868 } else if (key.contains("license" )) {
-869 addLicense(dependency, value);
-870 } else {
-871 if (key.contains("description" )) {
-872 addDescription(dependency, value, "manifest" , key);
-873 } else {
-874 productEvidence.addEvidence(source, key, value, Confidence.LOW);
-875 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
-876 addMatchingValues(classInformation, value, vendorEvidence);
-877 addMatchingValues(classInformation, value, productEvidence);
-878 if (value.matches(".*\\d.*" )) {
-879 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
-880 while (tokenizer.hasMoreElements()) {
-881 final String s = tokenizer.nextToken();
-882 if (s.matches("^[0-9.]+$" )) {
-883 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
-884 }
-885 }
-886 }
-887 }
-888 }
-889 }
-890 }
-891 }
-892 } finally {
-893 if (jar != null ) {
-894 jar.close();
-895 }
-896 }
-897 return foundSomething;
-898 }
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912 private String addDescription(Dependency dependency, String description, String source, String key) {
-913 if (dependency.getDescription() == null ) {
-914 dependency.setDescription(description);
-915 }
-916 String desc;
-917 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
-918 desc = Jsoup.parse(description).text();
-919 } else {
-920 desc = description;
-921 }
-922 dependency.setDescription(desc);
-923 if (desc.length() > 100) {
-924 desc = desc.replaceAll("\\s\\s+" , " " );
-925 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
-926 final int posLike = desc.toLowerCase().indexOf("like " , 100);
-927 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
-928 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
-929 int pos = -1;
-930 pos = Math.max(pos, posSuchAs);
-931 if (pos >= 0 && posLike >= 0) {
-932 pos = Math.min(pos, posLike);
-933 } else {
-934 pos = Math.max(pos, posLike);
-935 }
-936 if (pos >= 0 && posWillUse >= 0) {
-937 pos = Math.min(pos, posWillUse);
-938 } else {
-939 pos = Math.max(pos, posWillUse);
-940 }
-941 if (pos >= 0 && posUses >= 0) {
-942 pos = Math.min(pos, posUses);
-943 } else {
-944 pos = Math.max(pos, posUses);
+657 if (pom.getParent() != null ) {
+658 parentArtifactId = interpolateString(pom.getParent().getArtifactId(), pomProperties);
+659 if ((artifactid == null || artifactid.isEmpty()) && parentArtifactId != null && !parentArtifactId.isEmpty()) {
+660 artifactid = parentArtifactId;
+661 }
+662 }
+663 final String originalArtifactID = artifactid;
+664 if (artifactid != null && !artifactid.isEmpty()) {
+665 if (artifactid.startsWith("org." ) || artifactid.startsWith("com." )) {
+666 artifactid = artifactid.substring(4);
+667 }
+668 foundSomething = true ;
+669 dependency.getProductEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.HIGHEST);
+670 dependency.getVendorEvidence().addEvidence("pom" , "artifactid" , artifactid, Confidence.LOW);
+671 addMatchingValues(classes, artifactid, dependency.getVendorEvidence());
+672 addMatchingValues(classes, artifactid, dependency.getProductEvidence());
+673 if (parentArtifactId != null && !parentArtifactId.isEmpty() && !parentArtifactId.equals(artifactid)) {
+674 dependency.getProductEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.MEDIUM);
+675 dependency.getVendorEvidence().addEvidence("pom" , "parent-artifactid" , parentArtifactId, Confidence.LOW);
+676 addMatchingValues(classes, parentArtifactId, dependency.getVendorEvidence());
+677 addMatchingValues(classes, parentArtifactId, dependency.getProductEvidence());
+678 }
+679 } else {
+680 addAsIdentifier = false;
+681 }
+682
+683 String version = interpolateString(pom.getVersion(), pomProperties);
+684 String parentVersion = null ;
+685
+686 if (pom.getParent() != null ) {
+687 parentVersion = interpolateString(pom.getParent().getVersion(), pomProperties);
+688 if ((version == null || version.isEmpty()) && parentVersion != null && !parentVersion.isEmpty()) {
+689 version = parentVersion;
+690 }
+691 }
+692
+693 if (version != null && !version.isEmpty()) {
+694 foundSomething = true ;
+695 dependency.getVersionEvidence().addEvidence("pom" , "version" , version, Confidence.HIGHEST);
+696 if (parentVersion != null && !parentVersion.isEmpty() && !parentVersion.equals(version)) {
+697 dependency.getVersionEvidence().addEvidence("pom" , "parent-version" , version, Confidence.LOW);
+698 }
+699 } else {
+700 addAsIdentifier = false;
+701 }
+702
+703 if (addAsIdentifier) {
+704 dependency.addIdentifier("maven" , String.format("%s:%s:%s" , originalGroupID, originalArtifactID, version), null , Confidence.LOW);
+705 }
+706
+707
+708 final Organization org = pom.getOrganization();
+709 if (org != null && org.getName() != null ) {
+710 foundSomething = true ;
+711 final String orgName = interpolateString(org.getName(), pomProperties);
+712 if (orgName != null && !orgName.isEmpty()) {
+713 dependency.getVendorEvidence().addEvidence("pom" , "organization name" , orgName, Confidence.HIGH);
+714 addMatchingValues(classes, orgName, dependency.getVendorEvidence());
+715 }
+716 }
+717
+718 final String pomName = interpolateString(pom.getName(), pomProperties);
+719 if (pomName != null && !pomName.isEmpty()) {
+720 foundSomething = true ;
+721 dependency.getProductEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+722 dependency.getVendorEvidence().addEvidence("pom" , "name" , pomName, Confidence.HIGH);
+723 addMatchingValues(classes, pomName, dependency.getVendorEvidence());
+724 addMatchingValues(classes, pomName, dependency.getProductEvidence());
+725 }
+726
+727
+728 if (pom.getDescription() != null ) {
+729 foundSomething = true ;
+730 final String description = interpolateString(pom.getDescription(), pomProperties);
+731 if (description != null && !description.isEmpty()) {
+732 final String trimmedDescription = addDescription(dependency, description, "pom" , "description" );
+733 addMatchingValues(classes, trimmedDescription, dependency.getVendorEvidence());
+734 addMatchingValues(classes, trimmedDescription, dependency.getProductEvidence());
+735 }
+736 }
+737 extractLicense(pom, pomProperties, dependency);
+738 return foundSomething;
+739 }
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749 protected void analyzePackageNames(ArrayList<ClassNameInformation> classNames,
+750 Dependency dependency, boolean addPackagesAsEvidence) {
+751 final HashMap<String, Integer> vendorIdentifiers = new HashMap<String, Integer>();
+752 final HashMap<String, Integer> productIdentifiers = new HashMap<String, Integer>();
+753 analyzeFullyQualifiedClassNames(classNames, vendorIdentifiers, productIdentifiers);
+754
+755 final int classCount = classNames.size();
+756 final EvidenceCollection vendor = dependency.getVendorEvidence();
+757 final EvidenceCollection product = dependency.getProductEvidence();
+758
+759 for (Map.Entry<String, Integer> entry : vendorIdentifiers.entrySet()) {
+760 final float ratio = entry.getValue() / (float ) classCount;
+761 if (ratio > 0.5) {
+762
+763 vendor.addWeighting(entry.getKey());
+764 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+765 vendor.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
+766 }
+767 }
+768 }
+769 for (Map.Entry<String, Integer> entry : productIdentifiers.entrySet()) {
+770 final float ratio = entry.getValue() / (float ) classCount;
+771 if (ratio > 0.5) {
+772 product.addWeighting(entry.getKey());
+773 if (addPackagesAsEvidence && entry.getKey().length() > 1) {
+774 product.addEvidence("jar" , "package name" , entry.getKey(), Confidence.LOW);
+775 }
+776 }
+777 }
+778 }
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794 protected boolean parseManifest(Dependency dependency, ArrayList<ClassNameInformation> classInformation) throws IOException {
+795 boolean foundSomething = false;
+796 JarFile jar = null ;
+797 try {
+798 jar = new JarFile(dependency.getActualFilePath());
+799
+800 final Manifest manifest = jar.getManifest();
+801
+802 if (manifest == null ) {
+803
+804 if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar" )
+805 && !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar" )
+806 && !dependency.getFileName().toLowerCase().endsWith("-src.jar" )
+807 && !dependency.getFileName().toLowerCase().endsWith("-doc.jar" )) {
+808 LOGGER.log(Level.FINE,
+809 String.format("Jar file '%s' does not contain a manifest." ,
+810 dependency.getFileName()));
+811 }
+812 return false;
+813 }
+814 final Attributes atts = manifest.getMainAttributes();
+815
+816 final EvidenceCollection vendorEvidence = dependency.getVendorEvidence();
+817 final EvidenceCollection productEvidence = dependency.getProductEvidence();
+818 final EvidenceCollection versionEvidence = dependency.getVersionEvidence();
+819
+820 final String source = "Manifest" ;
+821
+822 for (Entry<Object, Object> entry : atts.entrySet()) {
+823 String key = entry.getKey().toString();
+824 String value = atts.getValue(key);
+825 if (HTML_DETECTION_PATTERN.matcher(value).find()) {
+826 value = Jsoup.parse(value).text();
+827 }
+828 if (IGNORE_VALUES.contains(value)) {
+829 continue ;
+830 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_TITLE.toString())) {
+831 foundSomething = true ;
+832 productEvidence.addEvidence(source, key, value, Confidence.HIGH);
+833 addMatchingValues(classInformation, value, productEvidence);
+834 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VERSION.toString())) {
+835 foundSomething = true ;
+836 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+837 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR.toString())) {
+838 foundSomething = true ;
+839 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+840 addMatchingValues(classInformation, value, vendorEvidence);
+841 } else if (key.equalsIgnoreCase(Attributes.Name.IMPLEMENTATION_VENDOR_ID.toString())) {
+842 foundSomething = true ;
+843 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+844 addMatchingValues(classInformation, value, vendorEvidence);
+845 } else if (key.equalsIgnoreCase(BUNDLE_DESCRIPTION)) {
+846 foundSomething = true ;
+847 addDescription(dependency, value, "manifest" , key);
+848
+849 addMatchingValues(classInformation, value, productEvidence);
+850 } else if (key.equalsIgnoreCase(BUNDLE_NAME)) {
+851 foundSomething = true ;
+852 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+853 addMatchingValues(classInformation, value, productEvidence);
+854 } else if (key.equalsIgnoreCase(BUNDLE_VENDOR)) {
+855 foundSomething = true ;
+856 vendorEvidence.addEvidence(source, key, value, Confidence.HIGH);
+857 addMatchingValues(classInformation, value, vendorEvidence);
+858 } else if (key.equalsIgnoreCase(BUNDLE_VERSION)) {
+859 foundSomething = true ;
+860 versionEvidence.addEvidence(source, key, value, Confidence.HIGH);
+861 } else if (key.equalsIgnoreCase(Attributes.Name.MAIN_CLASS.toString())) {
+862 continue ;
+863
+864
+865
+866
+867
+868
+869
+870
+871 } else {
+872 key = key.toLowerCase();
+873
+874 if (!IGNORE_KEYS.contains(key)
+875 && !key.endsWith("jdk" )
+876 && !key.contains("lastmodified" )
+877 && !key.endsWith("package" )
+878 && !key.endsWith("classpath" )
+879 && !key.endsWith("class-path" )
+880 && !key.endsWith("-scm" )
+881 && !key.startsWith("scm-" )
+882 && !value.trim().startsWith("scm:" )
+883 && !isImportPackage(key, value)
+884 && !isPackage(key, value)) {
+885
+886 foundSomething = true ;
+887 if (key.contains("version" )) {
+888 if (key.contains("specification" )) {
+889 versionEvidence.addEvidence(source, key, value, Confidence.LOW);
+890 } else {
+891 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+892 }
+893 } else if ("build-id" .equals(key)) {
+894 int pos = value.indexOf('(');
+895 if (pos >= 0) {
+896 value = value.substring(0, pos - 1);
+897 }
+898 pos = value.indexOf('[');
+899 if (pos >= 0) {
+900 value = value.substring(0, pos - 1);
+901 }
+902 versionEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+903 } else if (key.contains("title" )) {
+904 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+905 addMatchingValues(classInformation, value, productEvidence);
+906 } else if (key.contains("vendor" )) {
+907 if (key.contains("specification" )) {
+908 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+909 } else {
+910 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+911 addMatchingValues(classInformation, value, vendorEvidence);
+912 }
+913 } else if (key.contains("name" )) {
+914 productEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+915 vendorEvidence.addEvidence(source, key, value, Confidence.MEDIUM);
+916 addMatchingValues(classInformation, value, vendorEvidence);
+917 addMatchingValues(classInformation, value, productEvidence);
+918 } else if (key.contains("license" )) {
+919 addLicense(dependency, value);
+920 } else {
+921 if (key.contains("description" )) {
+922 addDescription(dependency, value, "manifest" , key);
+923 } else {
+924 productEvidence.addEvidence(source, key, value, Confidence.LOW);
+925 vendorEvidence.addEvidence(source, key, value, Confidence.LOW);
+926 addMatchingValues(classInformation, value, vendorEvidence);
+927 addMatchingValues(classInformation, value, productEvidence);
+928 if (value.matches(".*\\d.*" )) {
+929 final StringTokenizer tokenizer = new StringTokenizer(value, " " );
+930 while (tokenizer.hasMoreElements()) {
+931 final String s = tokenizer.nextToken();
+932 if (s.matches("^[0-9.]+$" )) {
+933 versionEvidence.addEvidence(source, key, s, Confidence.LOW);
+934 }
+935 }
+936 }
+937 }
+938 }
+939 }
+940 }
+941 }
+942 } finally {
+943 if (jar != null ) {
+944 jar.close();
945 }
-946
-947 if (pos > 0) {
-948 final StringBuilder sb = new StringBuilder(pos + 3);
-949 sb.append(desc.substring(0, pos));
-950 sb.append("..." );
-951 desc = sb.toString();
-952 }
-953 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
-954 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
-955 } else {
-956 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
-957 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
-958 }
-959 return desc;
-960 }
-961
-962
-963
-964
-965
-966
-967
-968 private void addLicense(Dependency d, String license) {
-969 if (d.getLicense() == null ) {
-970 d.setLicense(license);
-971 } else if (!d.getLicense().contains(license)) {
-972 d.setLicense(d.getLicense() + NEWLINE + license);
-973 }
-974 }
-975
-976
-977
-978
-979 private File tempFileLocation = null ;
-980
-981
-982
-983
-984
-985
-986 @Override
-987 public void initializeFileTypeAnalyzer() throws Exception {
-988 final File baseDir = Settings.getTempDirectory();
-989 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
-990 if (!tempFileLocation.delete()) {
-991 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
-992 throw new AnalysisException (msg);
-993 }
-994 if (!tempFileLocation.mkdirs()) {
-995 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
-996 throw new AnalysisException (msg);
-997 }
-998 }
-999
-1000
-1001
-1002
-1003 @Override
-1004 public void close() {
-1005 if (tempFileLocation != null && tempFileLocation.exists()) {
-1006 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
-1007 final boolean success = FileUtils.delete(tempFileLocation);
-1008 if (!success) {
-1009 LOGGER.log(Level.WARNING,
-1010 "Failed to delete some temporary files, see the log for more details" );
-1011 }
-1012 }
-1013 }
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042 protected String interpolateString(String text, Properties properties) {
-1043 Properties props = properties;
-1044 if (text == null ) {
-1045 return text;
-1046 }
-1047 if (props == null ) {
-1048 props = new Properties ();
-1049 }
-1050
-1051 final int pos = text.indexOf("${" );
-1052 if (pos < 0) {
-1053 return text;
-1054 }
-1055 final int end = text.indexOf("}" );
-1056 if (end < pos) {
-1057 return text;
-1058 }
-1059
-1060 final String propName = text.substring(pos + 2, end);
-1061 String propValue = interpolateString(props.getProperty(propName), props);
-1062 if (propValue == null ) {
-1063 propValue = "" ;
-1064 }
-1065 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
-1066 sb.append(text.subSequence(0, pos));
-1067 sb.append(propValue);
-1068 sb.append(text.substring(end + 1));
-1069 return interpolateString(sb.toString(), props);
-1070 }
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079 private boolean isImportPackage(String key, String value) {
-1080 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
-1081 final boolean matches = packageRx.matcher(value).matches();
-1082 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
-1083 }
-1084
-1085
-1086
-1087
-1088
-1089
-1090
+946 }
+947 return foundSomething;
+948 }
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962 private String addDescription(Dependency dependency, String description, String source, String key) {
+963 if (dependency.getDescription() == null ) {
+964 dependency.setDescription(description);
+965 }
+966 String desc;
+967 if (HTML_DETECTION_PATTERN.matcher(description).find()) {
+968 desc = Jsoup.parse(description).text();
+969 } else {
+970 desc = description;
+971 }
+972 dependency.setDescription(desc);
+973 if (desc.length() > 100) {
+974 desc = desc.replaceAll("\\s\\s+" , " " );
+975 final int posSuchAs = desc.toLowerCase().indexOf("such as " , 100);
+976 final int posLike = desc.toLowerCase().indexOf("like " , 100);
+977 final int posWillUse = desc.toLowerCase().indexOf("will use " , 100);
+978 final int posUses = desc.toLowerCase().indexOf(" uses " , 100);
+979 int pos = -1;
+980 pos = Math.max(pos, posSuchAs);
+981 if (pos >= 0 && posLike >= 0) {
+982 pos = Math.min(pos, posLike);
+983 } else {
+984 pos = Math.max(pos, posLike);
+985 }
+986 if (pos >= 0 && posWillUse >= 0) {
+987 pos = Math.min(pos, posWillUse);
+988 } else {
+989 pos = Math.max(pos, posWillUse);
+990 }
+991 if (pos >= 0 && posUses >= 0) {
+992 pos = Math.min(pos, posUses);
+993 } else {
+994 pos = Math.max(pos, posUses);
+995 }
+996
+997 if (pos > 0) {
+998 final StringBuilder sb = new StringBuilder(pos + 3);
+999 sb.append(desc.substring(0, pos));
+1000 sb.append("..." );
+1001 desc = sb.toString();
+1002 }
+1003 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.LOW);
+1004 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.LOW);
+1005 } else {
+1006 dependency.getProductEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+1007 dependency.getVendorEvidence().addEvidence(source, key, desc, Confidence.MEDIUM);
+1008 }
+1009 return desc;
+1010 }
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018 private void addLicense(Dependency d, String license) {
+1019 if (d.getLicense() == null ) {
+1020 d.setLicense(license);
+1021 } else if (!d.getLicense().contains(license)) {
+1022 d.setLicense(d.getLicense() + NEWLINE + license);
+1023 }
+1024 }
+1025
+1026
+1027
+1028
+1029 private File tempFileLocation = null ;
+1030
+1031
+1032
+1033
+1034
+1035
+1036 @Override
+1037 public void initializeFileTypeAnalyzer() throws Exception {
+1038 final File baseDir = Settings.getTempDirectory();
+1039 tempFileLocation = File.createTempFile("check" , "tmp" , baseDir);
+1040 if (!tempFileLocation.delete()) {
+1041 final String msg = String.format("Unable to delete temporary file '%s'." , tempFileLocation.getAbsolutePath());
+1042 throw new AnalysisException (msg);
+1043 }
+1044 if (!tempFileLocation.mkdirs()) {
+1045 final String msg = String.format("Unable to create directory '%s'." , tempFileLocation.getAbsolutePath());
+1046 throw new AnalysisException (msg);
+1047 }
+1048 }
+1049
+1050
+1051
+1052
+1053 @Override
+1054 public void close() {
+1055 if (tempFileLocation != null && tempFileLocation.exists()) {
+1056 LOGGER.log(Level.FINE, "Attempting to delete temporary files" );
+1057 final boolean success = FileUtils.delete(tempFileLocation);
+1058 if (!success) {
+1059 LOGGER.log(Level.WARNING,
+1060 "Failed to delete some temporary files, see the log for more details" );
+1061 }
+1062 }
+1063 }
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
1091
-1092 private ArrayList<ClassNameInformation> collectClassNames(Dependency dependency) {
-1093 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
-1094 JarFile jar = null ;
-1095 try {
-1096 jar = new JarFile(dependency.getActualFilePath());
-1097 final Enumeration entries = jar.entries();
-1098 while (entries.hasMoreElements()) {
-1099 final JarEntry entry = (JarEntry) entries.nextElement();
-1100 final String name = entry.getName().toLowerCase();
-1101
-1102 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
-1103 final ClassNameInformation className = new ClassNameInformation (name.substring(0, name.length() - 6));
-1104 classNames.add(className);
-1105 }
-1106 }
-1107 } catch (IOException ex) {
-1108 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
-1109 LOGGER.log(Level.WARNING, msg);
-1110 LOGGER.log(Level.FINE, null , ex);
-1111 } finally {
-1112 if (jar != null ) {
-1113 try {
-1114 jar.close();
-1115 } catch (IOException ex) {
-1116 LOGGER.log(Level.FINEST, null , ex);
-1117 }
-1118 }
-1119 }
-1120 return classNames;
-1121 }
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131 private void analyzeFullyQualifiedClassNames(ArrayList<ClassNameInformation> classNames,
-1132 HashMap<String, Integer> vendor, HashMap<String, Integer> product) {
-1133 for (ClassNameInformation entry : classNames) {
-1134 final ArrayList<String> list = entry.getPackageStructure();
-1135 addEntry(vendor, list.get(0));
-1136
-1137 if (list.size() == 2) {
-1138 addEntry(product, list.get(1));
-1139 }
-1140 if (list.size() == 3) {
-1141 addEntry(vendor, list.get(1));
-1142 addEntry(product, list.get(1));
-1143 addEntry(product, list.get(2));
-1144 }
-1145 if (list.size() >= 4) {
-1146 addEntry(vendor, list.get(1));
-1147 addEntry(vendor, list.get(2));
-1148 addEntry(product, list.get(1));
-1149 addEntry(product, list.get(2));
-1150 addEntry(product, list.get(3));
-1151 }
-1152 }
-1153 }
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162 private void addEntry(HashMap<String, Integer> collection, String key) {
-1163 if (collection.containsKey(key)) {
-1164 collection.put(key, collection.get(key) + 1);
-1165 } else {
-1166 collection.put(key, 1);
-1167 }
-1168 }
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179 private void addMatchingValues(ArrayList<ClassNameInformation> classes, String value, EvidenceCollection evidence) {
-1180 if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) {
-1181 return ;
-1182 }
-1183 final String text = value.toLowerCase();
-1184 for (ClassNameInformation cni : classes) {
-1185 for (String key : cni.getPackageStructure()) {
-1186 if (text.contains(key)) {
-1187 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
-1188 }
+1092 protected String interpolateString(String text, Properties properties) {
+1093 Properties props = properties;
+1094 if (text == null ) {
+1095 return text;
+1096 }
+1097 if (props == null ) {
+1098 props = new Properties ();
+1099 }
+1100
+1101 final int pos = text.indexOf("${" );
+1102 if (pos < 0) {
+1103 return text;
+1104 }
+1105 final int end = text.indexOf("}" );
+1106 if (end < pos) {
+1107 return text;
+1108 }
+1109
+1110 final String propName = text.substring(pos + 2, end);
+1111 String propValue = interpolateString(props.getProperty(propName), props);
+1112 if (propValue == null ) {
+1113 propValue = "" ;
+1114 }
+1115 final StringBuilder sb = new StringBuilder(propValue.length() + text.length());
+1116 sb.append(text.subSequence(0, pos));
+1117 sb.append(propValue);
+1118 sb.append(text.substring(end + 1));
+1119 return interpolateString(sb.toString(), props);
+1120 }
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129 private boolean isImportPackage(String key, String value) {
+1130 final Pattern packageRx = Pattern.compile("^([a-zA-Z0-9_#\\$\\*\\.]+\\s*[,;]\\s*)+([a-zA-Z0-9_#\\$\\*\\.]+\\s*)?$" );
+1131 final boolean matches = packageRx.matcher(value).matches();
+1132 return matches && (key.contains("import" ) || key.contains("include" ) || value.length() > 10);
+1133 }
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142 private ArrayList<ClassNameInformation> collectClassNames(Dependency dependency) {
+1143 final ArrayList<ClassNameInformation> classNames = new ArrayList<ClassNameInformation>();
+1144 JarFile jar = null ;
+1145 try {
+1146 jar = new JarFile(dependency.getActualFilePath());
+1147 final Enumeration entries = jar.entries();
+1148 while (entries.hasMoreElements()) {
+1149 final JarEntry entry = (JarEntry) entries.nextElement();
+1150 final String name = entry.getName().toLowerCase();
+1151
+1152 if (name.endsWith(".class" ) && !name.matches("^javax?\\..*$" )) {
+1153 final ClassNameInformation className = new ClassNameInformation (name.substring(0, name.length() - 6));
+1154 classNames.add(className);
+1155 }
+1156 }
+1157 } catch (IOException ex) {
+1158 final String msg = String.format("Unable to open jar file '%s'." , dependency.getFileName());
+1159 LOGGER.log(Level.WARNING, msg);
+1160 LOGGER.log(Level.FINE, null , ex);
+1161 } finally {
+1162 if (jar != null ) {
+1163 try {
+1164 jar.close();
+1165 } catch (IOException ex) {
+1166 LOGGER.log(Level.FINEST, null , ex);
+1167 }
+1168 }
+1169 }
+1170 return classNames;
+1171 }
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181 private void analyzeFullyQualifiedClassNames(ArrayList<ClassNameInformation> classNames,
+1182 HashMap<String, Integer> vendor, HashMap<String, Integer> product) {
+1183 for (ClassNameInformation entry : classNames) {
+1184 final ArrayList<String> list = entry.getPackageStructure();
+1185 addEntry(vendor, list.get(0));
+1186
+1187 if (list.size() == 2) {
+1188 addEntry(product, list.get(1));
1189 }
-1190 }
-1191 }
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200 private boolean isPackage(String key, String value) {
-1201
-1202 return !key.matches(".*(version|title|vendor|name|license|description).*" )
-1203 && value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$" );
+1190 if (list.size() == 3) {
+1191 addEntry(vendor, list.get(1));
+1192 addEntry(product, list.get(1));
+1193 addEntry(product, list.get(2));
+1194 }
+1195 if (list.size() >= 4) {
+1196 addEntry(vendor, list.get(1));
+1197 addEntry(vendor, list.get(2));
+1198 addEntry(product, list.get(1));
+1199 addEntry(product, list.get(2));
+1200 addEntry(product, list.get(3));
+1201 }
+1202 }
+1203 }
1204
-1205 }
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214 private void extractLicense(Model pom, Properties pomProperties, Dependency dependency) {
-1215
-1216 if (pom.getLicenses() != null ) {
-1217 String license = null ;
-1218 for (License lic : pom.getLicenses().getLicense()) {
-1219 String tmp = null ;
-1220 if (lic.getName() != null ) {
-1221 tmp = interpolateString(lic.getName(), pomProperties);
-1222 }
-1223 if (lic.getUrl() != null ) {
-1224 if (tmp == null ) {
-1225 tmp = interpolateString(lic.getUrl(), pomProperties);
-1226 } else {
-1227 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
-1228 }
-1229 }
-1230 if (tmp == null ) {
-1231 continue ;
-1232 }
-1233 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
-1234 tmp = Jsoup.parse(tmp).text();
-1235 }
-1236 if (license == null ) {
-1237 license = tmp;
-1238 } else {
-1239 license += "\n" + tmp;
-1240 }
-1241 }
-1242 if (license != null ) {
-1243 dependency.setLicense(license);
-1244 }
-1245 }
-1246 }
-1247
-1248
-1249
-1250
-1251 protected static class ClassNameInformation {
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273 ClassNameInformation (String className) {
-1274 name = className;
-1275 if (name.contains("/" )) {
-1276 final String[] tmp = className.toLowerCase().split("/" );
-1277 int start = 0;
-1278 int end = 3;
-1279 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
-1280 start = 1;
-1281 end = 4;
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212 private void addEntry(HashMap<String, Integer> collection, String key) {
+1213 if (collection.containsKey(key)) {
+1214 collection.put(key, collection.get(key) + 1);
+1215 } else {
+1216 collection.put(key, 1);
+1217 }
+1218 }
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229 private void addMatchingValues(ArrayList<ClassNameInformation> classes, String value, EvidenceCollection evidence) {
+1230 if (value == null || value.isEmpty() || classes == null || classes.isEmpty()) {
+1231 return ;
+1232 }
+1233 final String text = value.toLowerCase();
+1234 for (ClassNameInformation cni : classes) {
+1235 for (String key : cni.getPackageStructure()) {
+1236 if (text.contains(key)) {
+1237 evidence.addEvidence("jar" , "package name" , key, Confidence.HIGHEST);
+1238 }
+1239 }
+1240 }
+1241 }
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250 private boolean isPackage(String key, String value) {
+1251
+1252 return !key.matches(".*(version|title|vendor|name|license|description).*" )
+1253 && value.matches("^([a-zA-Z_][a-zA-Z0-9_\\$]*(\\.[a-zA-Z_][a-zA-Z0-9_\\$]*)*)?$" );
+1254
+1255 }
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264 private void extractLicense(Model pom, Properties pomProperties, Dependency dependency) {
+1265
+1266 if (pom.getLicenses() != null ) {
+1267 String license = null ;
+1268 for (License lic : pom.getLicenses().getLicense()) {
+1269 String tmp = null ;
+1270 if (lic.getName() != null ) {
+1271 tmp = interpolateString(lic.getName(), pomProperties);
+1272 }
+1273 if (lic.getUrl() != null ) {
+1274 if (tmp == null ) {
+1275 tmp = interpolateString(lic.getUrl(), pomProperties);
+1276 } else {
+1277 tmp += ": " + interpolateString(lic.getUrl(), pomProperties);
+1278 }
+1279 }
+1280 if (tmp == null ) {
+1281 continue ;
1282 }
-1283 if (tmp.length <= end) {
-1284 end = tmp.length - 1;
+1283 if (HTML_DETECTION_PATTERN.matcher(tmp).find()) {
+1284 tmp = Jsoup.parse(tmp).text();
1285 }
-1286 for (int i = start; i <= end; i++) {
-1287 packageStructure.add(tmp[i]);
-1288 }
-1289 } else {
-1290 packageStructure.add(name);
+1286 if (license == null ) {
+1287 license = tmp;
+1288 } else {
+1289 license += "\n" + tmp;
+1290 }
1291 }
-1292 }
-1293
-1294
-1295
-1296 private String name;
+1292 if (license != null ) {
+1293 dependency.setLicense(license);
+1294 }
+1295 }
+1296 }
1297
-1298
-1299
-1300
-1301
-1302
-1303 public String getName() {
-1304 return name;
-1305 }
-1306
-1307
-1308
-1309
-1310
-1311
-1312 public void setName(String name) {
-1313 this .name = name;
-1314 }
-1315
-1316
-1317
-1318 private final ArrayList<String> packageStructure = new ArrayList<String>();
-1319
-1320
-1321
-1322
-1323
-1324
-1325 public ArrayList<String> getPackageStructure() {
-1326 return packageStructure;
-1327 }
-1328 }
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336 private File getNextTempDirectory() throws AnalysisException {
-1337 dirCount += 1;
-1338 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
-1339
-1340 if (directory.exists()) {
-1341 return getNextTempDirectory();
+1298
+1299
+1300
+1301 protected static class ClassNameInformation {
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323 ClassNameInformation (String className) {
+1324 name = className;
+1325 if (name.contains("/" )) {
+1326 final String[] tmp = className.toLowerCase().split("/" );
+1327 int start = 0;
+1328 int end = 3;
+1329 if ("com" .equals(tmp[0]) || "org" .equals(tmp[0])) {
+1330 start = 1;
+1331 end = 4;
+1332 }
+1333 if (tmp.length <= end) {
+1334 end = tmp.length - 1;
+1335 }
+1336 for (int i = start; i <= end; i++) {
+1337 packageStructure.add(tmp[i]);
+1338 }
+1339 } else {
+1340 packageStructure.add(name);
+1341 }
1342 }
-1343 if (!directory.mkdirs()) {
-1344 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
-1345 throw new AnalysisException (msg);
-1346 }
-1347 return directory;
-1348 }
-1349 }
+1343
+1344
+1345
+1346 private String name;
+1347
+1348
+1349
+1350
+1351
+1352
+1353 public String getName() {
+1354 return name;
+1355 }
+1356
+1357
+1358
+1359
+1360
+1361
+1362 public void setName(String name) {
+1363 this .name = name;
+1364 }
+1365
+1366
+1367
+1368 private final ArrayList<String> packageStructure = new ArrayList<String>();
+1369
+1370
+1371
+1372
+1373
+1374
+1375 public ArrayList<String> getPackageStructure() {
+1376 return packageStructure;
+1377 }
+1378 }
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386 private File getNextTempDirectory() throws AnalysisException {
+1387 dirCount += 1;
+1388 final File directory = new File(tempFileLocation, String.valueOf(dirCount));
+1389
+1390 if (directory.exists()) {
+1391 return getNextTempDirectory();
+1392 }
+1393 if (!directory.mkdirs()) {
+1394 final String msg = String.format("Unable to create temp directory '%s'." , directory.getAbsolutePath());
+1395 throw new AnalysisException (msg);
+1396 }
+1397 return directory;
+1398 }
+1399 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/NexusAnalyzer.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/NexusAnalyzer.html
index a8f9d8ff9..79ac2d6d7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/NexusAnalyzer.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/NexusAnalyzer.html
@@ -38,7 +38,7 @@
30 import org.owasp.dependencycheck.data.nexus.NexusSearch;
31 import org.owasp.dependencycheck.dependency.Confidence;
32 import org.owasp.dependencycheck.dependency.Dependency;
-33 import org.owasp.dependencycheck.dependency.Identifier;
+33 import org.owasp.dependencycheck.utils.InvalidSettingException;
34 import org.owasp.dependencycheck.utils.Settings;
35
36
@@ -58,144 +58,171 @@
50 public class NexusAnalyzer extends AbstractFileTypeAnalyzer {
51
52
-53
+53
54
-55 private static final Logger LOGGER = Logger.getLogger(NexusAnalyzer.class .getName());
+55 public static final String DEFAULT_URL = "https://repository.sonatype.org/service/local/" ;
56
57
-58
+58
59
-60 private static final String ANALYZER_NAME = "Nexus Analyzer" ;
+60 private static final Logger LOGGER = Logger.getLogger(NexusAnalyzer.class .getName());
61
62
-63
+63
64
-65 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
+65 private static final String ANALYZER_NAME = "Nexus Analyzer" ;
66
67
-68
+68
69
-70 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
+70 private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
71
72
-73
+73
74
-75 private NexusSearch searcher;
+75 private static final Set<String> SUPPORTED_EXTENSIONS = newHashSet("jar" );
76
77
-78
-79
-80
-81
-82 @Override
-83 public void initializeFileTypeAnalyzer() throws Exception {
-84 LOGGER.fine("Initializing Nexus Analyzer" );
-85 LOGGER.fine(String.format("Nexus Analyzer enabled: %s" , isEnabled()));
-86 if (isEnabled()) {
-87 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL);
-88 LOGGER.fine(String.format("Nexus Analyzer URL: %s" , searchUrl));
-89 try {
-90 searcher = new NexusSearch (new URL(searchUrl));
-91 if (!searcher.preflightRequest()) {
-92 LOGGER.warning("There was an issue getting Nexus status. Disabling analyzer." );
-93 setEnabled(false);
-94 }
-95 } catch (MalformedURLException mue) {
-96
-97
-98 LOGGER.warning(String.format("Property %s not a valid URL. Nexus Analyzer disabled" , searchUrl));
-99 setEnabled(false);
-100 }
-101 }
-102 }
-103
-104
-105
-106
-107
-108
-109 @Override
-110 public String getName() {
-111 return ANALYZER_NAME;
-112 }
-113
-114
-115
-116
-117
-118
-119 @Override
-120 protected String getAnalyzerEnabledSettingKey() {
-121 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
-122 }
-123
-124
-125
-126
-127
-128
-129 @Override
-130 public AnalysisPhase getAnalysisPhase() {
-131 return ANALYSIS_PHASE;
-132 }
-133
-134
-135
-136
-137
-138
-139 @Override
-140 public Set<String> getSupportedExtensions() {
-141 return SUPPORTED_EXTENSIONS;
-142 }
-143
-144
-145
-146
-147
-148
-149
-150
-151 @Override
-152 public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
-153 try {
-154 final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum());
-155 if (ma.getGroupId() != null && !"" .equals(ma.getGroupId())) {
-156 dependency.getVendorEvidence().addEvidence("nexus" , "groupid" , ma.getGroupId(), Confidence.HIGH);
-157 }
-158 if (ma.getArtifactId() != null && !"" .equals(ma.getArtifactId())) {
-159 dependency.getProductEvidence().addEvidence("nexus" , "artifactid" , ma.getArtifactId(), Confidence.HIGH);
-160 }
-161 if (ma.getVersion() != null && !"" .equals(ma.getVersion())) {
-162 dependency.getVersionEvidence().addEvidence("nexus" , "version" , ma.getVersion(), Confidence.HIGH);
-163 }
-164 if (ma.getArtifactUrl() != null && !"" .equals(ma.getArtifactUrl())) {
-165 boolean found = false;
-166 for (Identifier i : dependency.getIdentifiers()) {
-167 if ("maven" .equals(i.getType()) && i.getValue().equals(ma.toString())) {
-168 found = true ;
-169 i.setConfidence(Confidence.HIGHEST);
-170 i.setUrl(ma.getArtifactUrl());
-171 break ;
-172 }
-173 }
-174 if (!found) {
-175 dependency.addIdentifier("maven" , ma.toString(), ma.getArtifactUrl(), Confidence.HIGHEST);
-176 }
-177 }
-178 } catch (IllegalArgumentException iae) {
-179
-180 LOGGER.info(String.format("invalid sha-1 hash on %s" , dependency.getFileName()));
-181 } catch (FileNotFoundException fnfe) {
-182
-183 LOGGER.fine(String.format("Artifact not found in repository '%s'" , dependency.getFileName()));
-184 LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
-185 } catch (IOException ioe) {
-186
-187 LOGGER.log(Level.FINE, "Could not connect to nexus repository" , ioe);
-188 }
-189 }
-190 }
+78
+79
+80 private NexusSearch searcher;
+81
+82
+83
+84
+85 private final boolean enabled = checkEnabled();
+86
+87
+88
+89
+90
+91
+92 private boolean checkEnabled() {
+93
+94
+95
+96
+97 boolean retval = false;
+98 try {
+99 if ((!DEFAULT_URL.equals(Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL)))
+100 && Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED)) {
+101 LOGGER.info("Enabling Nexus analyzer" );
+102 retval = true ;
+103 } else {
+104 LOGGER.info("Nexus analyzer disabled, using Central instead" );
+105 }
+106 } catch (InvalidSettingException ise) {
+107 LOGGER.warning("Invalid setting. Disabling Nexus analyzer" );
+108 }
+109
+110 return retval;
+111 }
+112
+113
+114
+115
+116
+117
+118 @Override
+119 public boolean isEnabled() {
+120 return enabled;
+121 }
+122
+123
+124
+125
+126
+127
+128 @Override
+129 public void initializeFileTypeAnalyzer() throws Exception {
+130 LOGGER.fine("Initializing Nexus Analyzer" );
+131 LOGGER.fine(String.format("Nexus Analyzer enabled: %s" , isEnabled()));
+132 if (isEnabled()) {
+133 final String searchUrl = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_URL);
+134 LOGGER.fine(String.format("Nexus Analyzer URL: %s" , searchUrl));
+135 try {
+136 searcher = new NexusSearch (new URL(searchUrl));
+137 if (!searcher.preflightRequest()) {
+138 LOGGER.warning("There was an issue getting Nexus status. Disabling analyzer." );
+139 setEnabled(false);
+140 }
+141 } catch (MalformedURLException mue) {
+142
+143
+144 LOGGER.warning(String.format("Property %s not a valid URL. Nexus Analyzer disabled" , searchUrl));
+145 setEnabled(false);
+146 }
+147 }
+148 }
+149
+150
+151
+152
+153
+154
+155 @Override
+156 public String getName() {
+157 return ANALYZER_NAME;
+158 }
+159
+160
+161
+162
+163
+164
+165 @Override
+166 protected String getAnalyzerEnabledSettingKey() {
+167 return Settings.KEYS.ANALYZER_NEXUS_ENABLED;
+168 }
+169
+170
+171
+172
+173
+174
+175 @Override
+176 public AnalysisPhase getAnalysisPhase() {
+177 return ANALYSIS_PHASE;
+178 }
+179
+180
+181
+182
+183
+184
+185 @Override
+186 public Set<String> getSupportedExtensions() {
+187 return SUPPORTED_EXTENSIONS;
+188 }
+189
+190
+191
+192
+193
+194
+195
+196
+197 @Override
+198 public void analyzeFileType(Dependency dependency, Engine engine) throws AnalysisException {
+199 if (!isEnabled()) {
+200 return ;
+201 }
+202 try {
+203 final MavenArtifact ma = searcher.searchSha1(dependency.getSha1sum());
+204 dependency.addAsEvidence("nexus" , ma, Confidence.HIGH);
+205 } catch (IllegalArgumentException iae) {
+206
+207 LOGGER.info(String.format("invalid sha-1 hash on %s" , dependency.getFileName()));
+208 } catch (FileNotFoundException fnfe) {
+209
+210 LOGGER.fine(String.format("Artifact not found in repository '%s'" , dependency.getFileName()));
+211 LOGGER.log(Level.FINE, fnfe.getMessage(), fnfe);
+212 } catch (IOException ioe) {
+213
+214 LOGGER.log(Level.FINE, "Could not connect to nexus repository" , ioe);
+215 }
+216 }
+217 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-frame.html
index 967bf0ff8..a23db218e 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.analyzer.exception
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.analyzer.exception
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-summary.html
index b9c729632..c33783dd6 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/exception/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.analyzer.exception
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.analyzer.exception
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html
index 054c83e52..f4ce4a4ef 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.analyzer
@@ -41,6 +41,9 @@
CPEAnalyzer
+
+
+ CentralAnalyzer
ClassNameInformation
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html
index 5bee9e09c..331f84646 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/analyzer/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.analyzer
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.analyzer
@@ -79,6 +79,11 @@
CPEAnalyzer
+
+
+
+ CentralAnalyzer
+
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/central/CentralSearch.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/central/CentralSearch.html
new file mode 100644
index 000000000..a9117928e
--- /dev/null
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/central/CentralSearch.html
@@ -0,0 +1,164 @@
+
+
+
+CentralSearch xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.data.central;
+19
+20 import java.io.FileNotFoundException;
+21 import java.io.IOException;
+22 import java.net.HttpURLConnection;
+23 import java.net.URL;
+24 import java.util.ArrayList;
+25 import java.util.List;
+26 import java.util.logging.Logger;
+27 import javax.xml.parsers.DocumentBuilder;
+28 import javax.xml.parsers.DocumentBuilderFactory;
+29 import javax.xml.xpath.XPath;
+30 import javax.xml.xpath.XPathConstants;
+31 import javax.xml.xpath.XPathFactory;
+32 import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+33 import org.owasp.dependencycheck.utils.Settings;
+34 import org.owasp.dependencycheck.utils.URLConnectionFactory;
+35 import org.w3c.dom.Document;
+36 import org.w3c.dom.NodeList;
+37
+38
+39
+40
+41
+42
+43 public class CentralSearch {
+44
+45
+46
+47
+48 private final URL rootURL;
+49
+50
+51
+52
+53 private boolean useProxy;
+54
+55
+56
+57
+58 private static final Logger LOGGER = Logger.getLogger(CentralSearch.class .getName());
+59
+60
+61
+62
+63
+64
+65
+66 public CentralSearch (URL rootURL) {
+67 this .rootURL = rootURL;
+68 if (null != Settings.getString(Settings.KEYS.PROXY_SERVER)) {
+69 useProxy = true ;
+70 LOGGER.fine("Using proxy" );
+71 } else {
+72 useProxy = false;
+73 LOGGER.fine("Not using proxy" );
+74 }
+75 }
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86 public List<MavenArtifact> searchSha1(String sha1) throws IOException {
+87 if (null == sha1 || !sha1.matches("^[0-9A-Fa-f]{40}$" )) {
+88 throw new IllegalArgumentException("Invalid SHA1 format" );
+89 }
+90
+91 final URL url = new URL(rootURL + String.format("?q=1:\"%s\"&wt=xml" , sha1));
+92
+93 LOGGER.fine(String.format("Searching Central url %s" , url.toString()));
+94
+95
+96
+97
+98
+99 final HttpURLConnection conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
+100
+101 conn.setDoOutput(true );
+102
+103
+104
+105 conn.addRequestProperty("Accept" , "application/xml" );
+106 conn.connect();
+107
+108 if (conn.getResponseCode() == 200) {
+109 boolean missing = false;
+110 try {
+111 final DocumentBuilder builder = DocumentBuilderFactory
+112 .newInstance().newDocumentBuilder();
+113 final Document doc = builder.parse(conn.getInputStream());
+114 final XPath xpath = XPathFactory.newInstance().newXPath();
+115 final String numFound = xpath.evaluate("/response/result/@numFound" , doc);
+116 if ("0" .equals(numFound)) {
+117 missing = true ;
+118 } else {
+119 final ArrayList<MavenArtifact> result = new ArrayList<MavenArtifact>();
+120 final NodeList docs = (NodeList) xpath.evaluate("/response/result/doc" , doc, XPathConstants.NODESET);
+121 for (int i = 0; i < docs.getLength(); i++) {
+122 final String g = xpath.evaluate("./str[@name='g']" , docs.item(i));
+123 LOGGER.finest(String.format("GroupId: %s" , g));
+124 final String a = xpath.evaluate("./str[@name='a']" , docs.item(i));
+125 LOGGER.finest(String.format("ArtifactId: %s" , a));
+126 final String v = xpath.evaluate("./str[@name='v']" , docs.item(i));
+127 LOGGER.finest(String.format("Version: %s" , v));
+128 result.add(new MavenArtifact (g, a, v, url.toString()));
+129 }
+130
+131 return result;
+132 }
+133 } catch (Throwable e) {
+134
+135
+136 throw new IOException(e.getMessage(), e);
+137 }
+138
+139 if (missing) {
+140 throw new FileNotFoundException("Artifact not found in Central" );
+141 }
+142 } else {
+143 final String msg = String.format("Could not connect to Central received response code: %d %s" ,
+144 conn.getResponseCode(), conn.getResponseMessage());
+145 LOGGER.fine(msg);
+146 throw new IOException(msg);
+147 }
+148
+149 return null ;
+150 }
+151 }
+
+
+
+
+
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/central/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/central/package-frame.html
new file mode 100644
index 000000000..f534a2eb4
--- /dev/null
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/central/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.central
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/central/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/central/package-summary.html
new file mode 100644
index 000000000..d5fb146e8
--- /dev/null
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/central/package-summary.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.central
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.data.central
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.html
index de28934f3..c8429fed0 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/CpeMemoryIndex.html
@@ -62,277 +62,278 @@
54
55
56 public final class CpeMemoryIndex {
-57
-58
-59
-60 private static final Logger LOGGER = Logger.getLogger(CpeMemoryIndex.class .getName());
-61
-62
-63
-64 private static CpeMemoryIndex instance = new CpeMemoryIndex ();
-65
-66
-67
-68
-69 private CpeMemoryIndex () {
-70 }
-71
-72
-73
-74
-75
-76
-77 public static CpeMemoryIndex getInstance() {
-78 return instance;
-79 }
-80
-81
-82
-83 private RAMDirectory index;
-84
-85
-86
-87 private IndexReader indexReader;
-88
-89
-90
-91 private IndexSearcher indexSearcher;
-92
-93
-94
-95 private Analyzer searchingAnalyzer;
-96
-97
-98
-99 private QueryParser queryParser;
-100
-101
-102
-103 private SearchFieldAnalyzer productSearchFieldAnalyzer;
-104
-105
-106
-107 private SearchFieldAnalyzer vendorSearchFieldAnalyzer;
-108
-109
-110
-111
-112
-113
-114
-115 public void open(CveDB cve) throws IndexException {
-116 if (!openState) {
-117 index = new RAMDirectory();
-118 buildIndex(cve);
-119 try {
-120 indexReader = DirectoryReader.open(index);
-121 } catch (IOException ex) {
-122 throw new IndexException (ex);
-123 }
-124 indexSearcher = new IndexSearcher(indexReader);
-125 searchingAnalyzer = createSearchingAnalyzer();
-126 queryParser = new QueryParser(LuceneUtils.CURRENT_VERSION, Fields.DOCUMENT_KEY, searchingAnalyzer);
-127 openState = true ;
-128 }
-129 }
-130
-131
-132
-133 private boolean openState = false;
-134
-135
-136
-137
-138
-139
-140 public boolean isOpen() {
-141 return openState;
-142 }
-143
-144
-145
-146
-147
-148
-149 @SuppressWarnings("unchecked" )
-150 private Analyzer createIndexingAnalyzer() {
-151 final Map fieldAnalyzers = new HashMap();
-152 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
-153 return new PerFieldAnalyzerWrapper(new FieldAnalyzer (LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
-154 }
-155
-156
-157
-158
-159
-160
-161 @SuppressWarnings("unchecked" )
-162 private Analyzer createSearchingAnalyzer() {
-163 final Map fieldAnalyzers = new HashMap();
-164 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
-165 productSearchFieldAnalyzer = new SearchFieldAnalyzer (LuceneUtils.CURRENT_VERSION);
-166 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer (LuceneUtils.CURRENT_VERSION);
-167 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
-168 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
-169
-170 return new PerFieldAnalyzerWrapper(new FieldAnalyzer (LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
-171 }
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182 public void saveEntry(String vendor, String product, IndexWriter indexWriter) throws CorruptIndexException, IOException {
-183 final Document doc = new Document();
-184 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
-185 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
-186 doc.add(v);
-187 doc.add(p);
-188 indexWriter.addDocument(doc);
-189 }
-190
-191
-192
-193
-194 public void close() {
-195 if (searchingAnalyzer != null ) {
-196 searchingAnalyzer.close();
-197 searchingAnalyzer = null ;
-198 }
-199 if (indexReader != null ) {
-200 try {
-201 indexReader.close();
-202 } catch (IOException ex) {
-203 LOGGER.log(Level.FINEST, null , ex);
-204 }
-205 indexReader = null ;
-206 }
-207 queryParser = null ;
-208 indexSearcher = null ;
-209 if (index != null ) {
-210 index.close();
-211 index = null ;
-212 }
-213 openState = false;
-214 }
-215
-216
-217
-218
-219
-220
-221
-222 private void buildIndex(CveDB cve) throws IndexException {
-223 Analyzer analyzer = null ;
-224 IndexWriter indexWriter = null ;
-225 try {
-226 analyzer = createIndexingAnalyzer();
-227 final IndexWriterConfig conf = new IndexWriterConfig(LuceneUtils.CURRENT_VERSION, analyzer);
-228 indexWriter = new IndexWriter(index, conf);
-229 try {
-230 final Set<Pair<String, String>> data = cve.getVendorProductList();
-231 for (Pair<String, String> pair : data) {
-232 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
-233 }
-234 } catch (DatabaseException ex) {
-235 LOGGER.log(Level.FINE, null , ex);
-236 throw new IndexException ("Error reading CPE data" , ex);
-237 }
-238 } catch (CorruptIndexException ex) {
-239 throw new IndexException ("Unable to close an in-memory index" , ex);
-240 } catch (IOException ex) {
-241 throw new IndexException ("Unable to close an in-memory index" , ex);
-242 } finally {
-243 if (indexWriter != null ) {
-244 try {
-245 try {
-246 indexWriter.commit();
-247 } finally {
-248 indexWriter.close(true );
-249 }
-250 } catch (CorruptIndexException ex) {
-251 throw new IndexException ("Unable to close an in-memory index" , ex);
-252 } catch (IOException ex) {
-253 throw new IndexException ("Unable to close an in-memory index" , ex);
-254 }
-255 if (analyzer != null ) {
-256 analyzer.close();
-257 }
-258 }
-259 }
-260 }
-261
-262
-263
-264
-265 private void resetSearchingAnalyzer() {
-266 if (productSearchFieldAnalyzer != null ) {
-267 productSearchFieldAnalyzer.clear();
-268 }
-269 if (vendorSearchFieldAnalyzer != null ) {
-270 vendorSearchFieldAnalyzer.clear();
-271 }
-272 }
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283 public TopDocs search(String searchString, int maxQueryResults) throws ParseException, IOException {
-284 if (searchString == null || searchString.trim().isEmpty()) {
-285 throw new ParseException("Query is null or empty" );
-286 }
-287 final Query query = queryParser.parse(searchString);
-288 return indexSearcher.search(query, maxQueryResults);
-289 }
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300 public TopDocs search(Query query, int maxQueryResults) throws CorruptIndexException, IOException {
-301 resetSearchingAnalyzer();
-302 return indexSearcher.search(query, maxQueryResults);
-303 }
-304
-305
-306
-307
-308
-309
-310
-311
-312 public Document getDocument(int documentId) throws IOException {
-313 return indexSearcher.doc(documentId);
-314 }
-315
-316
-317
-318
-319
-320
-321 public int numDocs() {
-322 if (indexReader == null ) {
-323 return -1;
-324 }
-325 return indexReader.numDocs();
-326 }
-327 }
+57
+58
+59
+60
+61 private static final Logger LOGGER = Logger.getLogger(CpeMemoryIndex.class .getName());
+62
+63
+64
+65 private static CpeMemoryIndex instance = new CpeMemoryIndex ();
+66
+67
+68
+69
+70 private CpeMemoryIndex () {
+71 }
+72
+73
+74
+75
+76
+77
+78 public static CpeMemoryIndex getInstance() {
+79 return instance;
+80 }
+81
+82
+83
+84 private RAMDirectory index;
+85
+86
+87
+88 private IndexReader indexReader;
+89
+90
+91
+92 private IndexSearcher indexSearcher;
+93
+94
+95
+96 private Analyzer searchingAnalyzer;
+97
+98
+99
+100 private QueryParser queryParser;
+101
+102
+103
+104 private SearchFieldAnalyzer productSearchFieldAnalyzer;
+105
+106
+107
+108 private SearchFieldAnalyzer vendorSearchFieldAnalyzer;
+109
+110
+111
+112
+113
+114
+115
+116 public void open(CveDB cve) throws IndexException {
+117 if (!openState) {
+118 index = new RAMDirectory();
+119 buildIndex(cve);
+120 try {
+121 indexReader = DirectoryReader.open(index);
+122 } catch (IOException ex) {
+123 throw new IndexException (ex);
+124 }
+125 indexSearcher = new IndexSearcher(indexReader);
+126 searchingAnalyzer = createSearchingAnalyzer();
+127 queryParser = new QueryParser(LuceneUtils.CURRENT_VERSION, Fields.DOCUMENT_KEY, searchingAnalyzer);
+128 openState = true ;
+129 }
+130 }
+131
+132
+133
+134 private boolean openState = false;
+135
+136
+137
+138
+139
+140
+141 public boolean isOpen() {
+142 return openState;
+143 }
+144
+145
+146
+147
+148
+149
+150 @SuppressWarnings("unchecked" )
+151 private Analyzer createIndexingAnalyzer() {
+152 final Map fieldAnalyzers = new HashMap();
+153 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
+154 return new PerFieldAnalyzerWrapper(new FieldAnalyzer (LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
+155 }
+156
+157
+158
+159
+160
+161
+162 @SuppressWarnings("unchecked" )
+163 private Analyzer createSearchingAnalyzer() {
+164 final Map<String, Analyzer> fieldAnalyzers = new HashMap<String, Analyzer>();
+165 fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
+166 productSearchFieldAnalyzer = new SearchFieldAnalyzer (LuceneUtils.CURRENT_VERSION);
+167 vendorSearchFieldAnalyzer = new SearchFieldAnalyzer (LuceneUtils.CURRENT_VERSION);
+168 fieldAnalyzers.put(Fields.PRODUCT, productSearchFieldAnalyzer);
+169 fieldAnalyzers.put(Fields.VENDOR, vendorSearchFieldAnalyzer);
+170
+171 return new PerFieldAnalyzerWrapper(new FieldAnalyzer (LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
+172 }
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183 public void saveEntry(String vendor, String product, IndexWriter indexWriter) throws CorruptIndexException, IOException {
+184 final Document doc = new Document();
+185 final Field v = new TextField(Fields.VENDOR, vendor, Field.Store.YES);
+186 final Field p = new TextField(Fields.PRODUCT, product, Field.Store.YES);
+187 doc.add(v);
+188 doc.add(p);
+189 indexWriter.addDocument(doc);
+190 }
+191
+192
+193
+194
+195 public void close() {
+196 if (searchingAnalyzer != null ) {
+197 searchingAnalyzer.close();
+198 searchingAnalyzer = null ;
+199 }
+200 if (indexReader != null ) {
+201 try {
+202 indexReader.close();
+203 } catch (IOException ex) {
+204 LOGGER.log(Level.FINEST, null , ex);
+205 }
+206 indexReader = null ;
+207 }
+208 queryParser = null ;
+209 indexSearcher = null ;
+210 if (index != null ) {
+211 index.close();
+212 index = null ;
+213 }
+214 openState = false;
+215 }
+216
+217
+218
+219
+220
+221
+222
+223 private void buildIndex(CveDB cve) throws IndexException {
+224 Analyzer analyzer = null ;
+225 IndexWriter indexWriter = null ;
+226 try {
+227 analyzer = createIndexingAnalyzer();
+228 final IndexWriterConfig conf = new IndexWriterConfig(LuceneUtils.CURRENT_VERSION, analyzer);
+229 indexWriter = new IndexWriter(index, conf);
+230 try {
+231 final Set<Pair<String, String>> data = cve.getVendorProductList();
+232 for (Pair<String, String> pair : data) {
+233 saveEntry(pair.getLeft(), pair.getRight(), indexWriter);
+234 }
+235 } catch (DatabaseException ex) {
+236 LOGGER.log(Level.FINE, null , ex);
+237 throw new IndexException ("Error reading CPE data" , ex);
+238 }
+239 } catch (CorruptIndexException ex) {
+240 throw new IndexException ("Unable to close an in-memory index" , ex);
+241 } catch (IOException ex) {
+242 throw new IndexException ("Unable to close an in-memory index" , ex);
+243 } finally {
+244 if (indexWriter != null ) {
+245 try {
+246 try {
+247 indexWriter.commit();
+248 } finally {
+249 indexWriter.close(true );
+250 }
+251 } catch (CorruptIndexException ex) {
+252 throw new IndexException ("Unable to close an in-memory index" , ex);
+253 } catch (IOException ex) {
+254 throw new IndexException ("Unable to close an in-memory index" , ex);
+255 }
+256 if (analyzer != null ) {
+257 analyzer.close();
+258 }
+259 }
+260 }
+261 }
+262
+263
+264
+265
+266 private void resetSearchingAnalyzer() {
+267 if (productSearchFieldAnalyzer != null ) {
+268 productSearchFieldAnalyzer.clear();
+269 }
+270 if (vendorSearchFieldAnalyzer != null ) {
+271 vendorSearchFieldAnalyzer.clear();
+272 }
+273 }
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284 public TopDocs search(String searchString, int maxQueryResults) throws ParseException, IOException {
+285 if (searchString == null || searchString.trim().isEmpty()) {
+286 throw new ParseException("Query is null or empty" );
+287 }
+288 final Query query = queryParser.parse(searchString);
+289 return indexSearcher.search(query, maxQueryResults);
+290 }
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301 public TopDocs search(Query query, int maxQueryResults) throws CorruptIndexException, IOException {
+302 resetSearchingAnalyzer();
+303 return indexSearcher.search(query, maxQueryResults);
+304 }
+305
+306
+307
+308
+309
+310
+311
+312
+313 public Document getDocument(int documentId) throws IOException {
+314 return indexSearcher.doc(documentId);
+315 }
+316
+317
+318
+319
+320
+321
+322 public int numDocs() {
+323 if (indexReader == null ) {
+324 return -1;
+325 }
+326 return indexReader.numDocs();
+327 }
+328 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html
index b4962b030..58eb6628c 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html
index fbb5bfea8..853dbd8fb 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cpe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cpe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/CweDB.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/CweDB.html
index 0024a7b18..2cf5e146d 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/CweDB.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/CweDB.html
@@ -37,65 +37,69 @@
29
30
31 public final class CweDB {
-32
-33
-34
-35 private static final Logger LOGGER = Logger.getLogger(CweDB.class .getName());
-36
-37
-38
-39 private CweDB () {
-40
-41 }
-42
-43
-44
-45 private static final HashMap<String, String> CWE = loadData();
-46
-47
-48
-49
-50
-51
-52 private static HashMap<String, String> loadData() {
-53 ObjectInputStream oin = null ;
-54 try {
-55 final String filePath = "data/cwe.hashmap.serialized" ;
-56 final InputStream input = CweDB.class .getClassLoader().getResourceAsStream(filePath);
-57 oin = new ObjectInputStream(input);
-58 return (HashMap<String, String>) oin.readObject();
-59 } catch (ClassNotFoundException ex) {
-60 LOGGER.log(Level.WARNING, "Unable to load CWE data. This should not be an issue." );
-61 LOGGER.log(Level.FINE, null , ex);
-62 } catch (IOException ex) {
-63 LOGGER.log(Level.WARNING, "Unable to load CWE data due to an IO Error. This should not be an issue." );
-64 LOGGER.log(Level.FINE, null , ex);
-65 } finally {
-66 if (oin != null ) {
-67 try {
-68 oin.close();
-69 } catch (IOException ex) {
-70 LOGGER.log(Level.FINEST, null , ex);
-71 }
-72 }
-73 }
-74 return null ;
-75 }
-76
-77
-78
-79
-80
-81
-82
-83
-84 public static String getCweName(String cweId) {
-85 if (cweId != null ) {
-86 return CWE.get(cweId);
-87 }
-88 return null ;
-89 }
-90 }
+32
+33
+34
+35
+36 private static final Logger LOGGER = Logger.getLogger(CweDB.class .getName());
+37
+38
+39
+40
+41 private CweDB () {
+42
+43 }
+44
+45
+46
+47 private static final HashMap<String, String> CWE = loadData();
+48
+49
+50
+51
+52
+53
+54 private static HashMap<String, String> loadData() {
+55 ObjectInputStream oin = null ;
+56 try {
+57 final String filePath = "data/cwe.hashmap.serialized" ;
+58 final InputStream input = CweDB.class .getClassLoader().getResourceAsStream(filePath);
+59 oin = new ObjectInputStream(input);
+60 @SuppressWarnings("unchecked" )
+61 final HashMap<String, String> ret = (HashMap<String, String>) oin.readObject();
+62 return ret;
+63 } catch (ClassNotFoundException ex) {
+64 LOGGER.log(Level.WARNING, "Unable to load CWE data. This should not be an issue." );
+65 LOGGER.log(Level.FINE, null , ex);
+66 } catch (IOException ex) {
+67 LOGGER.log(Level.WARNING, "Unable to load CWE data due to an IO Error. This should not be an issue." );
+68 LOGGER.log(Level.FINE, null , ex);
+69 } finally {
+70 if (oin != null ) {
+71 try {
+72 oin.close();
+73 } catch (IOException ex) {
+74 LOGGER.log(Level.FINEST, null , ex);
+75 }
+76 }
+77 }
+78 return null ;
+79 }
+80
+81
+82
+83
+84
+85
+86
+87
+88 public static String getCweName(String cweId) {
+89 if (cweId != null ) {
+90 return CWE.get(cweId);
+91 }
+92 return null ;
+93 }
+94 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html
index 6e93f8a45..f776b11e5 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html
index 54cfde0f4..6e83a4ec9 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/cwe/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.cwe
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.cwe
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html
index f231a34a3..5c0b3b39c 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html
index 77d47eb2c..481cd4108 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/lucene/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.lucene
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.lucene
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-frame.html
index c03583b23..88b38c1f1 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nexus
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nexus
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-summary.html
index 351d24f0f..3e606306b 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nexus/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nexus
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nexus
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-frame.html
index 0fcb98ded..8dc820380 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nuget
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nuget
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-summary.html
index 0cf7fcbdb..d4995ceae 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nuget/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nuget
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nuget
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/CveDB.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/CveDB.html
index 6ba517007..76627963e 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/CveDB.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/CveDB.html
@@ -314,14 +314,14 @@
306
307
308 public Set<Pair<String, String>> getVendorProductList() throws DatabaseException {
-309 final HashSet data = new HashSet<Pair<String, String>>();
+309 final Set<Pair<String, String>> data = new HashSet<Pair<String, String>>();
310 ResultSet rs = null ;
311 PreparedStatement ps = null ;
312 try {
313 ps = getConnection().prepareStatement(SELECT_VENDOR_PRODUCT_LIST);
314 rs = ps.executeQuery();
315 while (rs.next()) {
-316 data.add(new Pair (rs.getString(1), rs.getString(2)));
+316 data.add(new Pair<String, String>(rs.getString(1), rs.getString(2)));
317 }
318 } catch (SQLException ex) {
319 final String msg = "An unexpected SQL Exception occurred; please see the verbose log for more details." ;
@@ -739,7 +739,7 @@
731
732
733
-734 private boolean isAffected(String vendor, String product, DependencyVersion identifiedVersion, String cpeId, String previous) {
+734 protected boolean isAffected(String vendor, String product, DependencyVersion identifiedVersion, String cpeId, String previous) {
735 boolean affected = false;
736 final boolean isStruts = "apache" .equals(vendor) && "struts" .equals(product);
737 final DependencyVersion v = parseDependencyVersion(cpeId);
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.html
index 468564d11..0b50f9bc5 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/DatabaseProperties.html
@@ -150,8 +150,8 @@
142
143
144
-145 public Map getMetaData() {
-146 final TreeMap map = new TreeMap();
+145 public Map<String, String> getMetaData() {
+146 final TreeMap<String, String> map = new TreeMap<String, String>();
147 for (Entry<Object, Object> entry : properties.entrySet()) {
148 final String key = (String) entry.getKey();
149 if (!"version" .equals(key)) {
@@ -164,10 +164,10 @@
156 map.put(key, formatted);
157 } catch (Throwable ex) {
158 LOGGER.log(Level.FINE, "Unable to parse timestamp from DB" , ex);
-159 map.put(key, entry.getValue());
+159 map.put(key, (String) entry.getValue());
160 }
161 } else {
-162 map.put(key, entry.getValue());
+162 map.put(key, (String) entry.getValue());
163 }
164 }
165 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html
index 401c7ec04..0b6dd3a19 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html
index f6a9999c8..6ed1bf0f7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/nvdcve/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.nvdcve
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.nvdcve
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-frame.html
index e6213907b..14b31a504 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.exception
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.exception
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-summary.html
index 0fd312b35..b6585531f 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/exception/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.exception
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.exception
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html
index d675c0138..6d847c66c 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html
index 87f241b71..9d62e3b62 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/DownloadTask.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/DownloadTask.html
index 4e2c6e325..dd832a3d4 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/DownloadTask.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/DownloadTask.html
@@ -26,226 +26,283 @@
18 package org.owasp.dependencycheck.data.update.task;
19
20 import java.io.File;
-21 import java.io.IOException;
-22 import java.net.URL;
-23 import java.util.concurrent.Callable;
-24 import java.util.concurrent.ExecutorService;
-25 import java.util.concurrent.Future;
-26 import java.util.logging.Level;
-27 import java.util.logging.Logger;
-28 import org.owasp.dependencycheck.data.nvdcve.CveDB;
-29 import org.owasp.dependencycheck.data.update.NvdCveInfo;
-30 import org.owasp.dependencycheck.data.update.exception.UpdateException;
-31 import org.owasp.dependencycheck.utils.DownloadFailedException;
-32 import org.owasp.dependencycheck.utils.Downloader;
-33 import org.owasp.dependencycheck.utils.Settings;
-34
-35
-36
-37
-38
-39
-40 public class DownloadTask implements Callable<Future<ProcessTask>> {
-41
-42
-43
-44
-45 private static final Logger LOGGER = Logger.getLogger(DownloadTask.class .getName());
+21 import java.io.FileInputStream;
+22 import java.io.FileNotFoundException;
+23 import java.io.FileOutputStream;
+24 import java.io.IOException;
+25 import java.net.URL;
+26 import java.util.concurrent.Callable;
+27 import java.util.concurrent.ExecutorService;
+28 import java.util.concurrent.Future;
+29 import java.util.logging.Level;
+30 import java.util.logging.Logger;
+31 import java.util.zip.GZIPInputStream;
+32 import org.apache.commons.io.FileUtils;
+33 import org.owasp.dependencycheck.data.nvdcve.CveDB;
+34 import org.owasp.dependencycheck.data.update.NvdCveInfo;
+35 import org.owasp.dependencycheck.data.update.exception.UpdateException;
+36 import org.owasp.dependencycheck.utils.DownloadFailedException;
+37 import org.owasp.dependencycheck.utils.Downloader;
+38 import org.owasp.dependencycheck.utils.Settings;
+39
+40
+41
+42
+43
+44
+45 public class DownloadTask implements Callable<Future<ProcessTask>> {
46
47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57 public DownloadTask (NvdCveInfo nvdCveInfo, ExecutorService processor, CveDB cveDB, Settings settings) throws UpdateException {
-58 this .nvdCveInfo = nvdCveInfo;
-59 this .processorService = processor;
-60 this .cveDB = cveDB;
-61 this .settings = settings;
-62
-63 final File file1;
-64 final File file2;
-65
-66 try {
-67 file1 = File.createTempFile("cve" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
-68 file2 = File.createTempFile("cve_1_2_" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
-69 } catch (IOException ex) {
-70 throw new UpdateException ("Unable to create temporary files" , ex);
-71 }
-72 this .first = file1;
-73 this .second = file2;
-74
-75 }
-76
-77
-78
-79 private CveDB cveDB;
-80
-81
-82
-83 private ExecutorService processorService;
-84
-85
-86
-87 private NvdCveInfo nvdCveInfo;
-88
-89
-90
-91 private Settings settings;
-92
+48
+49
+50 private static final Logger LOGGER = Logger.getLogger(DownloadTask.class .getName());
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62 public DownloadTask (NvdCveInfo nvdCveInfo, ExecutorService processor, CveDB cveDB, Settings settings) throws UpdateException {
+63 this .nvdCveInfo = nvdCveInfo;
+64 this .processorService = processor;
+65 this .cveDB = cveDB;
+66 this .settings = settings;
+67
+68 final File file1;
+69 final File file2;
+70
+71 try {
+72 file1 = File.createTempFile("cve" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
+73 file2 = File.createTempFile("cve_1_2_" + nvdCveInfo.getId() + "_" , ".xml" , Settings.getTempDirectory());
+74 } catch (IOException ex) {
+75 throw new UpdateException ("Unable to create temporary files" , ex);
+76 }
+77 this .first = file1;
+78 this .second = file2;
+79
+80 }
+81
+82
+83
+84 private CveDB cveDB;
+85
+86
+87
+88 private ExecutorService processorService;
+89
+90
+91
+92 private NvdCveInfo nvdCveInfo;
93
-94
-95
-96
-97
-98 public NvdCveInfo getNvdCveInfo() {
-99 return nvdCveInfo;
-100 }
-101
-102
-103
-104
-105
-106
-107 public void setNvdCveInfo(NvdCveInfo nvdCveInfo) {
-108 this .nvdCveInfo = nvdCveInfo;
-109 }
-110
-111
-112
-113 private File first;
-114
+94
+95
+96 private Settings settings;
+97
+98
+99
+100
+101
+102
+103 public NvdCveInfo getNvdCveInfo() {
+104 return nvdCveInfo;
+105 }
+106
+107
+108
+109
+110
+111
+112 public void setNvdCveInfo(NvdCveInfo nvdCveInfo) {
+113 this .nvdCveInfo = nvdCveInfo;
+114 }
115
-116
-117
-118
-119
-120 public File getFirst() {
-121 return first;
-122 }
-123
-124
-125
-126
-127
-128
-129 public void setFirst(File first) {
-130 this .first = first;
-131 }
-132
-133
-134
-135 private File second;
-136
+116
+117
+118 private File first;
+119
+120
+121
+122
+123
+124
+125 public File getFirst() {
+126 return first;
+127 }
+128
+129
+130
+131
+132
+133
+134 public void setFirst(File first) {
+135 this .first = first;
+136 }
137
-138
-139
-140
-141
-142 public File getSecond() {
-143 return second;
-144 }
-145
-146
-147
-148
-149
-150
-151 public void setSecond(File second) {
-152 this .second = second;
-153 }
-154
-155
-156
-157 private Exception exception = null ;
-158
+138
+139
+140 private File second;
+141
+142
+143
+144
+145
+146
+147 public File getSecond() {
+148 return second;
+149 }
+150
+151
+152
+153
+154
+155
+156 public void setSecond(File second) {
+157 this .second = second;
+158 }
159
-160
-161
-162
-163
-164 public Exception getException() {
-165 return exception;
-166 }
-167
-168
-169
-170
-171
-172
-173 public boolean hasException() {
-174 return exception != null ;
-175 }
-176
-177 @Override
-178 public Future<ProcessTask> call() throws Exception {
-179 try {
-180 Settings.setInstance(settings);
-181 final URL url1 = new URL(nvdCveInfo.getUrl());
-182 final URL url2 = new URL(nvdCveInfo.getOldSchemaVersionUrl());
-183 String msg = String.format("Download Started for NVD CVE - %s" , nvdCveInfo.getId());
-184 LOGGER.log(Level.INFO, msg);
-185 try {
-186 Downloader.fetchFile(url1, first);
-187 Downloader.fetchFile(url2, second);
-188 } catch (DownloadFailedException ex) {
-189 msg = String.format("Download Failed for NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
-190 LOGGER.log(Level.WARNING, msg);
-191 if (Settings.getString(Settings.KEYS.PROXY_SERVER) == null ) {
-192 LOGGER.log(Level.INFO,
-193 "If you are behind a proxy you may need to configure dependency-check to use the proxy." );
-194 }
-195 LOGGER.log(Level.FINE, null , ex);
-196 return null ;
-197 }
-198
-199 msg = String.format("Download Complete for NVD CVE - %s" , nvdCveInfo.getId());
-200 LOGGER.log(Level.INFO, msg);
-201
-202 final ProcessTask task = new ProcessTask (cveDB, this , settings);
-203 return this .processorService.submit(task);
-204
-205 } catch (Throwable ex) {
-206 final String msg = String.format("An exception occurred downloading NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
-207 LOGGER.log(Level.WARNING, msg);
-208 LOGGER.log(Level.FINE, "Download Task Failed" , ex);
-209 } finally {
-210 Settings.cleanup(false);
-211 }
-212 return null ;
-213 }
-214
-215
-216
-217
-218 public void cleanup() {
-219 boolean deleted = false;
-220 try {
-221 if (first != null && first.exists()) {
-222 deleted = first.delete();
-223 }
-224 } finally {
-225 if (first != null && (first.exists() || !deleted)) {
-226 first.deleteOnExit();
-227 }
-228 }
-229 try {
-230 deleted = false;
-231 if (second != null && second.exists()) {
-232 deleted = second.delete();
-233 }
-234 } finally {
-235 if (second != null && (second.exists() || !deleted)) {
-236 second.deleteOnExit();
-237 }
-238 }
-239 }
-240 }
+160
+161
+162 private Exception exception = null ;
+163
+164
+165
+166
+167
+168
+169 public Exception getException() {
+170 return exception;
+171 }
+172
+173
+174
+175
+176
+177
+178 public boolean hasException() {
+179 return exception != null ;
+180 }
+181
+182 @Override
+183 public Future<ProcessTask> call() throws Exception {
+184 try {
+185 Settings.setInstance(settings);
+186 final URL url1 = new URL(nvdCveInfo.getUrl());
+187 final URL url2 = new URL(nvdCveInfo.getOldSchemaVersionUrl());
+188 String msg = String.format("Download Started for NVD CVE - %s" , nvdCveInfo.getId());
+189 LOGGER.log(Level.INFO, msg);
+190 try {
+191 Downloader.fetchFile(url1, first);
+192 Downloader.fetchFile(url2, second);
+193 } catch (DownloadFailedException ex) {
+194 msg = String.format("Download Failed for NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
+195 LOGGER.log(Level.WARNING, msg);
+196 if (Settings.getString(Settings.KEYS.PROXY_SERVER) == null ) {
+197 LOGGER.log(Level.INFO,
+198 "If you are behind a proxy you may need to configure dependency-check to use the proxy." );
+199 }
+200 LOGGER.log(Level.FINE, null , ex);
+201 return null ;
+202 }
+203 if (url1.toExternalForm().endsWith(".xml.gz" )) {
+204 extractGzip(first);
+205 }
+206 if (url2.toExternalForm().endsWith(".xml.gz" )) {
+207 extractGzip(second);
+208 }
+209
+210 msg = String.format("Download Complete for NVD CVE - %s" , nvdCveInfo.getId());
+211 LOGGER.log(Level.INFO, msg);
+212 if (this .processorService == null ) {
+213 return null ;
+214 }
+215 final ProcessTask task = new ProcessTask (cveDB, this , settings);
+216 return this .processorService.submit(task);
+217
+218 } catch (Throwable ex) {
+219 final String msg = String.format("An exception occurred downloading NVD CVE - %s%nSome CVEs may not be reported." , nvdCveInfo.getId());
+220 LOGGER.log(Level.WARNING, msg);
+221 LOGGER.log(Level.FINE, "Download Task Failed" , ex);
+222 } finally {
+223 Settings.cleanup(false);
+224 }
+225 return null ;
+226 }
+227
+228
+229
+230
+231 public void cleanup() {
+232 boolean deleted = false;
+233 try {
+234 if (first != null && first.exists()) {
+235 deleted = first.delete();
+236 }
+237 } finally {
+238 if (first != null && (first.exists() || !deleted)) {
+239 first.deleteOnExit();
+240 }
+241 }
+242 try {
+243 deleted = false;
+244 if (second != null && second.exists()) {
+245 deleted = second.delete();
+246 }
+247 } finally {
+248 if (second != null && (second.exists() || !deleted)) {
+249 second.deleteOnExit();
+250 }
+251 }
+252 }
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262 private void extractGzip(File file) throws FileNotFoundException, IOException {
+263 final String originalPath = file.getPath();
+264 File gzip = new File(originalPath + ".gz" );
+265 if (gzip.isFile()) {
+266 gzip.delete();
+267 }
+268 if (!file.renameTo(gzip)) {
+269 throw new IOException("Unable to rename '" + file.getPath() + "'" );
+270 }
+271 final File newfile = new File(originalPath);
+272
+273 final byte[] buffer = new byte[4096];
+274
+275 GZIPInputStream cin = null ;
+276 FileOutputStream out = null ;
+277 try {
+278 cin = new GZIPInputStream(new FileInputStream(gzip));
+279 out = new FileOutputStream(newfile);
+280
+281 int len;
+282 while ((len = cin.read(buffer)) > 0) {
+283 out.write(buffer, 0, len);
+284 }
+285 } finally {
+286 if (cin != null ) {
+287 cin.close();
+288 }
+289 if (out != null ) {
+290 out.close();
+291 }
+292 if (gzip.isFile()) {
+293 FileUtils.deleteQuietly(gzip);
+294 }
+295 }
+296 }
+297 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-frame.html
index 88857601f..15a69221e 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.task
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.task
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-summary.html
index b565938fc..5a434ebdd 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/task/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.task
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.task
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-frame.html
index b61bd3b3f..89464822f 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.xml
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.xml
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-summary.html
index 260d1af06..45c90b5f7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/data/update/xml/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.data.update.xml
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.data.update.xml
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/Dependency.html b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/Dependency.html
index 8f6094210..1a77a2e42 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/Dependency.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/Dependency.html
@@ -34,658 +34,699 @@
26 import java.util.TreeSet;
27 import java.util.logging.Level;
28 import java.util.logging.Logger;
-29 import org.owasp.dependencycheck.utils.Checksum;
-30 import org.owasp.dependencycheck.utils.FileUtils;
-31
-32
-33
-34
-35
-36
-37
-38
-39 public class Dependency implements Serializable, Comparable<Dependency> {
-40
-41
-42
-43
-44 private static final Logger LOGGER = Logger.getLogger(Dependency.class .getName());
-45
-46
-47
-48 private String actualFilePath;
-49
-50
-51
-52 private String filePath;
-53
-54
-55
-56 private String fileName;
-57
-58
-59
-60 private String fileExtension;
-61
-62
-63
-64 private String md5sum;
-65
-66
-67
-68 private String sha1sum;
-69
-70
-71
-72 private Set<Identifier> identifiers;
-73
-74
-75
-76 private final EvidenceCollection vendorEvidence;
-77
-78
-79
-80 private final EvidenceCollection productEvidence;
-81
-82
-83
-84 private final EvidenceCollection versionEvidence;
-85
-86
-87
-88
-89 public Dependency () {
-90 vendorEvidence = new EvidenceCollection ();
-91 productEvidence = new EvidenceCollection ();
-92 versionEvidence = new EvidenceCollection ();
-93 identifiers = new TreeSet<Identifier>();
-94 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator ());
-95 suppressedIdentifiers = new TreeSet<Identifier>();
-96 suppressedVulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator ());
-97 }
-98
-99
-100
-101
-102
-103
-104 public Dependency (File file) {
-105 this ();
-106 this .actualFilePath = file.getPath();
-107 this .filePath = this .actualFilePath;
-108 this .fileName = file.getName();
-109 this .fileExtension = FileUtils.getFileExtension(fileName);
-110 determineHashes(file);
-111 }
-112
-113
-114
-115
-116
-117
-118 public String getFileName() {
-119 return this .fileName;
-120 }
-121
-122
-123
-124
-125
-126
-127
-128 public String getFileNameForJavaScript() {
-129 return this .fileName.replace("\\" , "\\\\" );
-130 }
-131
-132
-133
-134
-135
-136
-137 public void setFileName(String fileName) {
-138 this .fileName = fileName;
-139 }
-140
-141
-142
-143
-144
-145
-146 public void setActualFilePath(String actualFilePath) {
-147 this .actualFilePath = actualFilePath;
-148 if (this .sha1sum == null ) {
-149 final File file = new File(this .actualFilePath);
-150 determineHashes(file);
-151 }
-152 }
-153
-154
-155
-156
-157
-158
-159 public String getActualFilePath() {
-160 return this .actualFilePath;
-161 }
-162
-163
-164
-165
-166
-167
-168 public File getActualFile() {
-169 return new File(this .actualFilePath);
-170 }
-171
-172
-173
-174
-175
-176
-177 public void setFilePath(String filePath) {
-178 this .filePath = filePath;
-179 }
-180
-181
-182
-183
-184 private String displayName = null ;
-185
-186
-187
-188
-189
-190
-191 public void setDisplayFileName(String displayName) {
-192 this .displayName = displayName;
-193 }
-194
-195
-196
-197
-198
-199
-200
-201 public String getDisplayFileName() {
-202 if (displayName == null ) {
-203 return this .fileName;
-204 }
-205 return this .displayName;
-206 }
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217 public String getFilePath() {
-218 return this .filePath;
-219 }
-220
-221
-222
-223
-224
-225
-226 public void setFileExtension(String fileExtension) {
-227 this .fileExtension = fileExtension;
-228 }
-229
-230
-231
-232
-233
-234
-235 public String getFileExtension() {
-236 return this .fileExtension;
-237 }
-238
-239
-240
-241
-242
-243
-244 public String getMd5sum() {
-245 return this .md5sum;
-246 }
-247
-248
-249
-250
-251
-252
-253 public void setMd5sum(String md5sum) {
-254 this .md5sum = md5sum;
-255 }
-256
-257
-258
-259
-260
-261
-262 public String getSha1sum() {
-263 return this .sha1sum;
-264 }
-265
-266
-267
-268
-269
-270
-271 public void setSha1sum(String sha1sum) {
-272 this .sha1sum = sha1sum;
-273 }
-274
-275
-276
-277
-278
-279
-280 public Set<Identifier> getIdentifiers() {
-281 return this .identifiers;
-282 }
-283
-284
-285
-286
-287
-288
-289 public void setIdentifiers(Set<Identifier> identifiers) {
-290 this .identifiers = identifiers;
-291 }
-292
-293
-294
-295
-296
-297
-298
-299
-300 public void addIdentifier(String type, String value, String url) {
-301 final Identifier i = new Identifier (type, value, url);
-302 this .identifiers.add(i);
-303 }
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313 public void addIdentifier(String type, String value, String url, Confidence confidence) {
-314 final Identifier i = new Identifier (type, value, url);
-315 i.setConfidence(confidence);
-316 this .identifiers.add(i);
-317 }
-318
-319
-320
-321
-322
-323
-324 public void addIdentifier(Identifier identifier) {
-325 this .identifiers.add(identifier);
-326 }
-327
-328
-329
-330 private Set<Identifier> suppressedIdentifiers;
-331
-332
-333
-334
-335
-336
-337 public Set<Identifier> getSuppressedIdentifiers() {
-338 return suppressedIdentifiers;
-339 }
-340
-341
-342
-343
-344
-345
-346 public void setSuppressedIdentifiers(Set<Identifier> suppressedIdentifiers) {
-347 this .suppressedIdentifiers = suppressedIdentifiers;
-348 }
-349
-350
-351
-352
-353
-354
-355 public void addSuppressedIdentifier(Identifier identifier) {
-356 this .suppressedIdentifiers.add(identifier);
-357 }
-358
-359
-360
-361
-362 private SortedSet<Vulnerability> suppressedVulnerabilities;
+29 import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+30 import org.owasp.dependencycheck.utils.Checksum;
+31 import org.owasp.dependencycheck.utils.FileUtils;
+32
+33
+34
+35
+36
+37
+38
+39
+40 public class Dependency implements Serializable, Comparable<Dependency> {
+41
+42
+43
+44
+45 private static final Logger LOGGER = Logger.getLogger(Dependency.class .getName());
+46
+47
+48
+49 private String actualFilePath;
+50
+51
+52
+53 private String filePath;
+54
+55
+56
+57 private String fileName;
+58
+59
+60
+61 private String fileExtension;
+62
+63
+64
+65 private String md5sum;
+66
+67
+68
+69 private String sha1sum;
+70
+71
+72
+73 private Set<Identifier> identifiers;
+74
+75
+76
+77 private final EvidenceCollection vendorEvidence;
+78
+79
+80
+81 private final EvidenceCollection productEvidence;
+82
+83
+84
+85 private final EvidenceCollection versionEvidence;
+86
+87
+88
+89
+90 public Dependency () {
+91 vendorEvidence = new EvidenceCollection ();
+92 productEvidence = new EvidenceCollection ();
+93 versionEvidence = new EvidenceCollection ();
+94 identifiers = new TreeSet<Identifier>();
+95 vulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator ());
+96 suppressedIdentifiers = new TreeSet<Identifier>();
+97 suppressedVulnerabilities = new TreeSet<Vulnerability>(new VulnerabilityComparator ());
+98 }
+99
+100
+101
+102
+103
+104
+105 public Dependency (File file) {
+106 this ();
+107 this .actualFilePath = file.getPath();
+108 this .filePath = this .actualFilePath;
+109 this .fileName = file.getName();
+110 this .fileExtension = FileUtils.getFileExtension(fileName);
+111 determineHashes(file);
+112 }
+113
+114
+115
+116
+117
+118
+119 public String getFileName() {
+120 return this .fileName;
+121 }
+122
+123
+124
+125
+126
+127
+128
+129 public String getFileNameForJavaScript() {
+130 return this .fileName.replace("\\" , "\\\\" );
+131 }
+132
+133
+134
+135
+136
+137
+138 public void setFileName(String fileName) {
+139 this .fileName = fileName;
+140 }
+141
+142
+143
+144
+145
+146
+147 public void setActualFilePath(String actualFilePath) {
+148 this .actualFilePath = actualFilePath;
+149 if (this .sha1sum == null ) {
+150 final File file = new File(this .actualFilePath);
+151 determineHashes(file);
+152 }
+153 }
+154
+155
+156
+157
+158
+159
+160 public String getActualFilePath() {
+161 return this .actualFilePath;
+162 }
+163
+164
+165
+166
+167
+168
+169 public File getActualFile() {
+170 return new File(this .actualFilePath);
+171 }
+172
+173
+174
+175
+176
+177
+178 public void setFilePath(String filePath) {
+179 this .filePath = filePath;
+180 }
+181
+182
+183
+184
+185 private String displayName = null ;
+186
+187
+188
+189
+190
+191
+192 public void setDisplayFileName(String displayName) {
+193 this .displayName = displayName;
+194 }
+195
+196
+197
+198
+199
+200
+201
+202 public String getDisplayFileName() {
+203 if (displayName == null ) {
+204 return this .fileName;
+205 }
+206 return this .displayName;
+207 }
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218 public String getFilePath() {
+219 return this .filePath;
+220 }
+221
+222
+223
+224
+225
+226
+227 public void setFileExtension(String fileExtension) {
+228 this .fileExtension = fileExtension;
+229 }
+230
+231
+232
+233
+234
+235
+236 public String getFileExtension() {
+237 return this .fileExtension;
+238 }
+239
+240
+241
+242
+243
+244
+245 public String getMd5sum() {
+246 return this .md5sum;
+247 }
+248
+249
+250
+251
+252
+253
+254 public void setMd5sum(String md5sum) {
+255 this .md5sum = md5sum;
+256 }
+257
+258
+259
+260
+261
+262
+263 public String getSha1sum() {
+264 return this .sha1sum;
+265 }
+266
+267
+268
+269
+270
+271
+272 public void setSha1sum(String sha1sum) {
+273 this .sha1sum = sha1sum;
+274 }
+275
+276
+277
+278
+279
+280
+281 public Set<Identifier> getIdentifiers() {
+282 return this .identifiers;
+283 }
+284
+285
+286
+287
+288
+289
+290 public void setIdentifiers(Set<Identifier> identifiers) {
+291 this .identifiers = identifiers;
+292 }
+293
+294
+295
+296
+297
+298
+299
+300
+301 public void addIdentifier(String type, String value, String url) {
+302 final Identifier i = new Identifier (type, value, url);
+303 this .identifiers.add(i);
+304 }
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314 public void addIdentifier(String type, String value, String url, Confidence confidence) {
+315 final Identifier i = new Identifier (type, value, url);
+316 i.setConfidence(confidence);
+317 this .identifiers.add(i);
+318 }
+319
+320
+321
+322
+323
+324
+325
+326
+327 public void addAsEvidence(String source, MavenArtifact mavenArtifact, Confidence confidence) {
+328 if (mavenArtifact.getGroupId() != null && !mavenArtifact.getGroupId().isEmpty()) {
+329 this .getVendorEvidence().addEvidence(source, "groupid" , mavenArtifact.getGroupId(), confidence);
+330 }
+331 if (mavenArtifact.getArtifactId() != null && !mavenArtifact.getArtifactId().isEmpty()) {
+332 this .getProductEvidence().addEvidence(source, "artifactid" , mavenArtifact.getArtifactId(), confidence);
+333 }
+334 if (mavenArtifact.getVersion() != null && !mavenArtifact.getVersion().isEmpty()) {
+335 this .getVersionEvidence().addEvidence(source, "version" , mavenArtifact.getVersion(), confidence);
+336 }
+337 if (mavenArtifact.getArtifactUrl() != null && !mavenArtifact.getArtifactUrl().isEmpty()) {
+338 boolean found = false;
+339 for (Identifier i : this .getIdentifiers()) {
+340 if ("maven" .equals(i.getType()) && i.getValue().equals(mavenArtifact.toString())) {
+341 found = true ;
+342 i.setConfidence(Confidence.HIGHEST);
+343 i.setUrl(mavenArtifact.getArtifactUrl());
+344 LOGGER.fine(String.format("Already found identifier %s. Confidence set to highest" , i.getValue()));
+345 break ;
+346 }
+347 }
+348 if (!found) {
+349 LOGGER.fine(String.format("Adding new maven identifier %s" , mavenArtifact.toString()));
+350 this .addIdentifier("maven" , mavenArtifact.toString(), mavenArtifact.getArtifactUrl(), Confidence.HIGHEST);
+351 }
+352 }
+353 }
+354
+355
+356
+357
+358
+359
+360 public void addIdentifier(Identifier identifier) {
+361 this .identifiers.add(identifier);
+362 }
363
364
-365
-366
-367
-368
-369 public SortedSet<Vulnerability> getSuppressedVulnerabilities() {
-370 return suppressedVulnerabilities;
-371 }
-372
-373
-374
-375
-376
-377
-378 public void setSuppressedVulnerabilities(SortedSet<Vulnerability> suppressedVulnerabilities) {
-379 this .suppressedVulnerabilities = suppressedVulnerabilities;
-380 }
-381
-382
-383
-384
-385
-386
-387 public void addSuppressedVulnerability(Vulnerability vulnerability) {
-388 this .suppressedVulnerabilities.add(vulnerability);
-389 }
-390
-391
-392
-393
-394
-395
-396 public EvidenceCollection getEvidence() {
-397 return EvidenceCollection.merge(this .productEvidence, this .vendorEvidence, this .versionEvidence);
-398 }
-399
-400
-401
-402
-403
-404
-405 public Set<Evidence> getEvidenceForDisplay() {
-406 return EvidenceCollection.mergeForDisplay(this .productEvidence, this .vendorEvidence, this .versionEvidence);
-407 }
-408
-409
-410
-411
-412
-413
-414 public EvidenceCollection getEvidenceUsed() {
-415 return EvidenceCollection.mergeUsed(this .productEvidence, this .vendorEvidence, this .versionEvidence);
-416 }
-417
-418
-419
-420
-421
-422
-423 public EvidenceCollection getVendorEvidence() {
-424 return this .vendorEvidence;
-425 }
-426
-427
-428
-429
-430
-431
-432 public EvidenceCollection getProductEvidence() {
-433 return this .productEvidence;
-434 }
-435
-436
-437
-438
-439
-440
-441 public EvidenceCollection getVersionEvidence() {
-442 return this .versionEvidence;
-443 }
-444
-445
-446
-447 private String description;
-448
-449
-450
-451
-452
-453
-454 public String getDescription() {
-455 return description;
-456 }
-457
-458
-459
-460
-461
-462
-463 public void setDescription(String description) {
-464 this .description = description;
-465 }
-466
-467
+365
+366
+367 private Set<Identifier> suppressedIdentifiers;
+368
+369
+370
+371
+372
+373
+374 public Set<Identifier> getSuppressedIdentifiers() {
+375 return suppressedIdentifiers;
+376 }
+377
+378
+379
+380
+381
+382
+383 public void setSuppressedIdentifiers(Set<Identifier> suppressedIdentifiers) {
+384 this .suppressedIdentifiers = suppressedIdentifiers;
+385 }
+386
+387
+388
+389
+390
+391
+392 public void addSuppressedIdentifier(Identifier identifier) {
+393 this .suppressedIdentifiers.add(identifier);
+394 }
+395
+396
+397
+398
+399 private SortedSet<Vulnerability> suppressedVulnerabilities;
+400
+401
+402
+403
+404
+405
+406 public SortedSet<Vulnerability> getSuppressedVulnerabilities() {
+407 return suppressedVulnerabilities;
+408 }
+409
+410
+411
+412
+413
+414
+415 public void setSuppressedVulnerabilities(SortedSet<Vulnerability> suppressedVulnerabilities) {
+416 this .suppressedVulnerabilities = suppressedVulnerabilities;
+417 }
+418
+419
+420
+421
+422
+423
+424 public void addSuppressedVulnerability(Vulnerability vulnerability) {
+425 this .suppressedVulnerabilities.add(vulnerability);
+426 }
+427
+428
+429
+430
+431
+432
+433 public EvidenceCollection getEvidence() {
+434 return EvidenceCollection.merge(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+435 }
+436
+437
+438
+439
+440
+441
+442 public Set<Evidence> getEvidenceForDisplay() {
+443 return EvidenceCollection.mergeForDisplay(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+444 }
+445
+446
+447
+448
+449
+450
+451 public EvidenceCollection getEvidenceUsed() {
+452 return EvidenceCollection.mergeUsed(this .productEvidence, this .vendorEvidence, this .versionEvidence);
+453 }
+454
+455
+456
+457
+458
+459
+460 public EvidenceCollection getVendorEvidence() {
+461 return this .vendorEvidence;
+462 }
+463
+464
+465
+466
+467
468
-469 private String license;
-470
-471
-472
-473
-474
-475
-476 public String getLicense() {
-477 return license;
-478 }
-479
-480
-481
-482
-483
+469 public EvidenceCollection getProductEvidence() {
+470 return this .productEvidence;
+471 }
+472
+473
+474
+475
+476
+477
+478 public EvidenceCollection getVersionEvidence() {
+479 return this .versionEvidence;
+480 }
+481
+482
+483
484
-485 public void setLicense(String license) {
-486 this .license = license;
-487 }
-488
-489
-490
-491 private SortedSet<Vulnerability> vulnerabilities;
-492
-493
-494
-495
-496
-497
-498 public SortedSet<Vulnerability> getVulnerabilities() {
-499 return vulnerabilities;
-500 }
-501
-502
-503
-504
-505
-506
-507 public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities) {
-508 this .vulnerabilities = vulnerabilities;
-509 }
-510
-511
-512
-513
-514
-515
-516 private void determineHashes(File file) {
-517 String md5 = null ;
-518 String sha1 = null ;
-519 try {
-520 md5 = Checksum.getMD5Checksum(file);
-521 sha1 = Checksum.getSHA1Checksum(file);
-522 } catch (IOException ex) {
-523 final String msg = String.format("Unable to read '%s' to determine hashes." , file.getName());
-524 LOGGER.log(Level.WARNING, msg);
-525 LOGGER.log(Level.FINE, null , ex);
-526 } catch (NoSuchAlgorithmException ex) {
-527 final String msg = "Unable to use MD5 of SHA1 checksums." ;
-528 LOGGER.log(Level.WARNING, msg);
-529 LOGGER.log(Level.FINE, null , ex);
-530 }
-531 this .setMd5sum(md5);
-532 this .setSha1sum(sha1);
-533 }
-534
-535
-536
-537
-538
-539
-540 public void addVulnerability(Vulnerability vulnerability) {
-541 this .vulnerabilities.add(vulnerability);
-542 }
-543
-544
-545
-546 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
-547
-548
-549
-550
-551
-552
-553 public Set<Dependency> getRelatedDependencies() {
-554 return relatedDependencies;
-555 }
-556
-557
-558
-559
-560
-561
-562 public void setRelatedDependencies(Set<Dependency> relatedDependencies) {
-563 this .relatedDependencies = relatedDependencies;
-564 }
-565
-566
-567
-568
-569
-570
-571 public void addRelatedDependency(Dependency dependency) {
-572 relatedDependencies.add(dependency);
+485 private String description;
+486
+487
+488
+489
+490
+491
+492 public String getDescription() {
+493 return description;
+494 }
+495
+496
+497
+498
+499
+500
+501 public void setDescription(String description) {
+502 this .description = description;
+503 }
+504
+505
+506
+507
+508 private String license;
+509
+510
+511
+512
+513
+514
+515 public String getLicense() {
+516 return license;
+517 }
+518
+519
+520
+521
+522
+523
+524 public void setLicense(String license) {
+525 this .license = license;
+526 }
+527
+528
+529
+530
+531 private SortedSet<Vulnerability> vulnerabilities;
+532
+533
+534
+535
+536
+537
+538 public SortedSet<Vulnerability> getVulnerabilities() {
+539 return vulnerabilities;
+540 }
+541
+542
+543
+544
+545
+546
+547 public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities) {
+548 this .vulnerabilities = vulnerabilities;
+549 }
+550
+551
+552
+553
+554
+555
+556 private void determineHashes(File file) {
+557 String md5 = null ;
+558 String sha1 = null ;
+559 try {
+560 md5 = Checksum.getMD5Checksum(file);
+561 sha1 = Checksum.getSHA1Checksum(file);
+562 } catch (IOException ex) {
+563 final String msg = String.format("Unable to read '%s' to determine hashes." , file.getName());
+564 LOGGER.log(Level.WARNING, msg);
+565 LOGGER.log(Level.FINE, null , ex);
+566 } catch (NoSuchAlgorithmException ex) {
+567 final String msg = "Unable to use MD5 of SHA1 checksums." ;
+568 LOGGER.log(Level.WARNING, msg);
+569 LOGGER.log(Level.FINE, null , ex);
+570 }
+571 this .setMd5sum(md5);
+572 this .setSha1sum(sha1);
573 }
574
575
-576
+576
577
-578
-579
-580
-581 public int compareTo(Dependency o) {
-582 return this .getFileName().compareToIgnoreCase(o.getFileName());
-583 }
-584
-585
-586
-587
-588
-589
-590
-591 @Override
-592 public boolean equals(Object obj) {
-593 if (obj == null ) {
-594 return false;
-595 }
-596 if (getClass() != obj.getClass()) {
-597 return false;
-598 }
-599 final Dependency other = (Dependency) obj;
-600 if ((this .actualFilePath == null ) ? (other.actualFilePath != null ) : !this .actualFilePath.equals(other.actualFilePath)) {
-601 return false;
-602 }
-603 if ((this .filePath == null ) ? (other.filePath != null ) : !this .filePath.equals(other.filePath)) {
-604 return false;
-605 }
-606 if ((this .fileName == null ) ? (other.fileName != null ) : !this .fileName.equals(other.fileName)) {
-607 return false;
-608 }
-609 if ((this .fileExtension == null ) ? (other.fileExtension != null ) : !this .fileExtension.equals(other.fileExtension)) {
-610 return false;
-611 }
-612 if ((this .md5sum == null ) ? (other.md5sum != null ) : !this .md5sum.equals(other.md5sum)) {
-613 return false;
-614 }
-615 if ((this .sha1sum == null ) ? (other.sha1sum != null ) : !this .sha1sum.equals(other.sha1sum)) {
-616 return false;
-617 }
-618 if (this .identifiers != other.identifiers && (this .identifiers == null || !this .identifiers.equals(other.identifiers))) {
-619 return false;
-620 }
-621 if (this .vendorEvidence != other.vendorEvidence && (this .vendorEvidence == null || !this .vendorEvidence.equals(other.vendorEvidence))) {
-622 return false;
-623 }
-624 if (this .productEvidence != other.productEvidence && (this .productEvidence == null || !this .productEvidence.equals(other.productEvidence))) {
-625 return false;
-626 }
-627 if (this .versionEvidence != other.versionEvidence && (this .versionEvidence == null || !this .versionEvidence.equals(other.versionEvidence))) {
-628 return false;
-629 }
-630 if ((this .description == null ) ? (other.description != null ) : !this .description.equals(other.description)) {
-631 return false;
-632 }
-633 if ((this .license == null ) ? (other.license != null ) : !this .license.equals(other.license)) {
-634 return false;
-635 }
-636 if (this .vulnerabilities != other.vulnerabilities && (this .vulnerabilities == null || !this .vulnerabilities.equals(other.vulnerabilities))) {
-637 return false;
-638 }
-639 if (this .relatedDependencies != other.relatedDependencies
-640 && (this .relatedDependencies == null || !this .relatedDependencies.equals(other.relatedDependencies))) {
-641 return false;
-642 }
-643 return true ;
-644 }
-645
-646
-647
-648
-649
-650
-651 @Override
-652 public int hashCode() {
-653 int hash = 3;
-654 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
-655 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
-656 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
-657 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
-658 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
-659 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
-660 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
-661 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
-662 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
-663 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
-664 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
-665 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
-666 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
-667 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
-668 return hash;
-669 }
-670
-671
-672
-673
-674
-675
-676 @Override
-677 public String toString() {
-678 return "Dependency{ fileName='" + fileName + "', actualFilePath='" + actualFilePath + "', filePath='" + filePath + "'}" ;
-679 }
-680 }
+578
+579
+580 public void addVulnerability(Vulnerability vulnerability) {
+581 this .vulnerabilities.add(vulnerability);
+582 }
+583
+584
+585
+586
+587 private Set<Dependency> relatedDependencies = new TreeSet<Dependency>();
+588
+589
+590
+591
+592
+593
+594 public Set<Dependency> getRelatedDependencies() {
+595 return relatedDependencies;
+596 }
+597
+598
+599
+600
+601
+602
+603 public void setRelatedDependencies(Set<Dependency> relatedDependencies) {
+604 this .relatedDependencies = relatedDependencies;
+605 }
+606
+607
+608
+609
+610
+611
+612 public void addRelatedDependency(Dependency dependency) {
+613 relatedDependencies.add(dependency);
+614 }
+615
+616
+617
+618
+619
+620
+621
+622 public int compareTo(Dependency o) {
+623 return this .getFilePath().compareToIgnoreCase(o.getFilePath());
+624 }
+625
+626
+627
+628
+629
+630
+631
+632 @Override
+633 public boolean equals(Object obj) {
+634 if (obj == null ) {
+635 return false;
+636 }
+637 if (getClass() != obj.getClass()) {
+638 return false;
+639 }
+640 final Dependency other = (Dependency) obj;
+641 if ((this .actualFilePath == null ) ? (other.actualFilePath != null ) : !this .actualFilePath.equals(other.actualFilePath)) {
+642 return false;
+643 }
+644 if ((this .filePath == null ) ? (other.filePath != null ) : !this .filePath.equals(other.filePath)) {
+645 return false;
+646 }
+647 if ((this .fileName == null ) ? (other.fileName != null ) : !this .fileName.equals(other.fileName)) {
+648 return false;
+649 }
+650 if ((this .fileExtension == null ) ? (other.fileExtension != null ) : !this .fileExtension.equals(other.fileExtension)) {
+651 return false;
+652 }
+653 if ((this .md5sum == null ) ? (other.md5sum != null ) : !this .md5sum.equals(other.md5sum)) {
+654 return false;
+655 }
+656 if ((this .sha1sum == null ) ? (other.sha1sum != null ) : !this .sha1sum.equals(other.sha1sum)) {
+657 return false;
+658 }
+659 if (this .identifiers != other.identifiers && (this .identifiers == null || !this .identifiers.equals(other.identifiers))) {
+660 return false;
+661 }
+662 if (this .vendorEvidence != other.vendorEvidence && (this .vendorEvidence == null || !this .vendorEvidence.equals(other.vendorEvidence))) {
+663 return false;
+664 }
+665 if (this .productEvidence != other.productEvidence && (this .productEvidence == null || !this .productEvidence.equals(other.productEvidence))) {
+666 return false;
+667 }
+668 if (this .versionEvidence != other.versionEvidence && (this .versionEvidence == null || !this .versionEvidence.equals(other.versionEvidence))) {
+669 return false;
+670 }
+671 if ((this .description == null ) ? (other.description != null ) : !this .description.equals(other.description)) {
+672 return false;
+673 }
+674 if ((this .license == null ) ? (other.license != null ) : !this .license.equals(other.license)) {
+675 return false;
+676 }
+677 if (this .vulnerabilities != other.vulnerabilities && (this .vulnerabilities == null || !this .vulnerabilities.equals(other.vulnerabilities))) {
+678 return false;
+679 }
+680 if (this .relatedDependencies != other.relatedDependencies
+681 && (this .relatedDependencies == null || !this .relatedDependencies.equals(other.relatedDependencies))) {
+682 return false;
+683 }
+684 return true ;
+685 }
+686
+687
+688
+689
+690
+691
+692 @Override
+693 public int hashCode() {
+694 int hash = 3;
+695 hash = 47 * hash + (this .actualFilePath != null ? this .actualFilePath.hashCode() : 0);
+696 hash = 47 * hash + (this .filePath != null ? this .filePath.hashCode() : 0);
+697 hash = 47 * hash + (this .fileName != null ? this .fileName.hashCode() : 0);
+698 hash = 47 * hash + (this .fileExtension != null ? this .fileExtension.hashCode() : 0);
+699 hash = 47 * hash + (this .md5sum != null ? this .md5sum.hashCode() : 0);
+700 hash = 47 * hash + (this .sha1sum != null ? this .sha1sum.hashCode() : 0);
+701 hash = 47 * hash + (this .identifiers != null ? this .identifiers.hashCode() : 0);
+702 hash = 47 * hash + (this .vendorEvidence != null ? this .vendorEvidence.hashCode() : 0);
+703 hash = 47 * hash + (this .productEvidence != null ? this .productEvidence.hashCode() : 0);
+704 hash = 47 * hash + (this .versionEvidence != null ? this .versionEvidence.hashCode() : 0);
+705 hash = 47 * hash + (this .description != null ? this .description.hashCode() : 0);
+706 hash = 47 * hash + (this .license != null ? this .license.hashCode() : 0);
+707 hash = 47 * hash + (this .vulnerabilities != null ? this .vulnerabilities.hashCode() : 0);
+708 hash = 47 * hash + (this .relatedDependencies != null ? this .relatedDependencies.hashCode() : 0);
+709 return hash;
+710 }
+711
+712
+713
+714
+715
+716
+717 @Override
+718 public String toString() {
+719 return "Dependency{ fileName='" + fileName + "', actualFilePath='" + actualFilePath + "', filePath='" + filePath + "'}" ;
+720 }
+721 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html
index 852887688..7747e89b5 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html
index 15e9086f6..a3ee8fd15 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/dependency/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.dependency
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.dependency
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-frame.html
index b769db0d5..553ddd3bb 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.exception
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.exception
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-summary.html
index ed324c648..32457e463 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/exception/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.exception
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.exception
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html
index 6a34981be..369dc1a57 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html
index 99cd42f53..4cabd35a7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/generated/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.jaxb.pom.generated
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html
index d38eaf882..534cb45c7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.jaxb.pom
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.jaxb.pom
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html
index c8399d054..a5c9c0c39 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/jaxb/pom/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.jaxb.pom
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.jaxb.pom
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html
index b2e08f58b..05920dfbb 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html
index b2210ea40..d34f4968d 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/ReportGenerator.html b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/ReportGenerator.html
index 123aa5590..d49b8c96d 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/ReportGenerator.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/ReportGenerator.html
@@ -175,96 +175,109 @@
167
168 public void generateReports(String outputDir, String outputFormat) throws IOException, Exception {
169 final String format = outputFormat.toUpperCase();
-170 if (format.matches("^(XML|HTML|VULN|ALL)$" )) {
-171 if ("XML" .equalsIgnoreCase(format)) {
-172 generateReports(outputDir, Format.XML);
-173 }
-174 if ("HTML" .equalsIgnoreCase(format)) {
-175 generateReports(outputDir, Format.HTML);
-176 }
-177 if ("VULN" .equalsIgnoreCase(format)) {
-178 generateReports(outputDir, Format.VULN);
-179 }
-180 if ("ALL" .equalsIgnoreCase(format)) {
-181 generateReports(outputDir, Format.ALL);
-182 }
-183 }
-184 }
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196 protected void generateReport(String templateName, String outFileName) throws IOException, Exception {
-197 InputStream input = null ;
-198 String templatePath = null ;
-199 final File f = new File(templateName);
-200 if (f.exists() && f.isFile()) {
-201 try {
-202 templatePath = templateName;
-203 input = new FileInputStream(f);
-204 } catch (FileNotFoundException ex) {
-205 final String msg = "Unable to generate the report, the report template file could not be found." ;
-206 LOGGER.log(Level.SEVERE, msg);
-207 LOGGER.log(Level.FINE, null , ex);
-208 }
-209 } else {
-210 templatePath = "templates/" + templateName + ".vsl" ;
-211 input = this .getClass().getClassLoader().getResourceAsStream(templatePath);
-212 }
-213 if (input == null ) {
-214 throw new IOException("Template file doesn't exist" );
-215 }
-216
-217 final InputStreamReader reader = new InputStreamReader(input, "UTF-8" );
-218 OutputStreamWriter writer = null ;
-219 OutputStream outputStream = null ;
-220
-221 try {
-222 final File outDir = new File(outFileName).getParentFile();
-223 if (!outDir.exists()) {
-224 final boolean created = outDir.mkdirs();
-225 if (!created) {
-226 throw new Exception("Unable to create directory '" + outDir.getAbsolutePath() + "'." );
-227 }
-228 }
+170 final String pathToCheck = outputDir.toLowerCase();
+171 if (format.matches("^(XML|HTML|VULN|ALL)$" )) {
+172 if ("XML" .equalsIgnoreCase(format)) {
+173 if (pathToCheck.endsWith(".xml" )) {
+174 generateReport("XmlReport" , outputDir);
+175 } else {
+176 generateReports(outputDir, Format.XML);
+177 }
+178 }
+179 if ("HTML" .equalsIgnoreCase(format)) {
+180 if (pathToCheck.endsWith(".html" ) || pathToCheck.endsWith(".htm" )) {
+181 generateReport("HtmlReport" , outputDir);
+182 } else {
+183 generateReports(outputDir, Format.HTML);
+184 }
+185 }
+186 if ("VULN" .equalsIgnoreCase(format)) {
+187 if (pathToCheck.endsWith(".html" ) || pathToCheck.endsWith(".htm" )) {
+188 generateReport("VulnReport" , outputDir);
+189 } else {
+190 generateReports(outputDir, Format.VULN);
+191 }
+192 }
+193 if ("ALL" .equalsIgnoreCase(format)) {
+194 generateReports(outputDir, Format.ALL);
+195 }
+196 }
+197 }
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209 protected void generateReport(String templateName, String outFileName) throws IOException, Exception {
+210 InputStream input = null ;
+211 String templatePath = null ;
+212 final File f = new File(templateName);
+213 if (f.exists() && f.isFile()) {
+214 try {
+215 templatePath = templateName;
+216 input = new FileInputStream(f);
+217 } catch (FileNotFoundException ex) {
+218 final String msg = "Unable to generate the report, the report template file could not be found." ;
+219 LOGGER.log(Level.SEVERE, msg);
+220 LOGGER.log(Level.FINE, null , ex);
+221 }
+222 } else {
+223 templatePath = "templates/" + templateName + ".vsl" ;
+224 input = this .getClass().getClassLoader().getResourceAsStream(templatePath);
+225 }
+226 if (input == null ) {
+227 throw new IOException("Template file doesn't exist" );
+228 }
229
-230 outputStream = new FileOutputStream(outFileName);
-231 writer = new OutputStreamWriter(outputStream, "UTF-8" );
-232
-233 if (!engine.evaluate(context, writer, templatePath, reader)) {
-234 throw new Exception("Failed to convert the template into html." );
-235 }
-236 writer.flush();
-237 } finally {
-238 if (writer != null ) {
-239 try {
-240 writer.close();
-241 } catch (IOException ex) {
-242 LOGGER.log(Level.FINEST, null , ex);
-243 }
-244 }
-245 if (outputStream != null ) {
-246 try {
-247 outputStream.close();
-248 } catch (IOException ex) {
-249 LOGGER.log(Level.FINEST, null , ex);
-250 }
-251 }
-252 try {
-253 reader.close();
-254 } catch (IOException ex) {
-255 LOGGER.log(Level.FINEST, null , ex);
-256 }
-257 }
-258 }
-259 }
+230 final InputStreamReader reader = new InputStreamReader(input, "UTF-8" );
+231 OutputStreamWriter writer = null ;
+232 OutputStream outputStream = null ;
+233
+234 try {
+235 final File outDir = new File(outFileName).getParentFile();
+236 if (!outDir.exists()) {
+237 final boolean created = outDir.mkdirs();
+238 if (!created) {
+239 throw new Exception("Unable to create directory '" + outDir.getAbsolutePath() + "'." );
+240 }
+241 }
+242
+243 outputStream = new FileOutputStream(outFileName);
+244 writer = new OutputStreamWriter(outputStream, "UTF-8" );
+245
+246 if (!engine.evaluate(context, writer, templatePath, reader)) {
+247 throw new Exception("Failed to convert the template into html." );
+248 }
+249 writer.flush();
+250 } finally {
+251 if (writer != null ) {
+252 try {
+253 writer.close();
+254 } catch (IOException ex) {
+255 LOGGER.log(Level.FINEST, null , ex);
+256 }
+257 }
+258 if (outputStream != null ) {
+259 try {
+260 outputStream.close();
+261 } catch (IOException ex) {
+262 LOGGER.log(Level.FINEST, null , ex);
+263 }
+264 }
+265 try {
+266 reader.close();
+267 } catch (IOException ex) {
+268 LOGGER.log(Level.FINEST, null , ex);
+269 }
+270 }
+271 }
+272 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html
index d23497425..50767911a 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html
index 74a030fbe..d3b3499bb 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/reporting/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.reporting
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.reporting
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionParseException.html b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionParseException.html
index 98f2a279f..a9b76cf3b 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionParseException.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionParseException.html
@@ -35,45 +35,40 @@
27 public class SuppressionParseException extends IOException {
28
29
-30
+30
31
-32 private static final long serialVersionUID = 1L;
-33
-34
-35
-36
-37 public SuppressionParseException () {
-38 super ();
-39 }
-40
-41
-42
-43
-44
-45
-46 public SuppressionParseException (String msg) {
-47 super (msg);
-48 }
-49
-50
-51
-52
-53
-54
-55 public SuppressionParseException (Throwable ex) {
-56 super (ex);
-57 }
-58
-59
-60
-61
-62
-63
-64
-65 public SuppressionParseException (String msg, Throwable ex) {
-66 super (msg, ex);
-67 }
-68 }
+32 public SuppressionParseException () {
+33 super ();
+34 }
+35
+36
+37
+38
+39
+40
+41 public SuppressionParseException (String msg) {
+42 super (msg);
+43 }
+44
+45
+46
+47
+48
+49
+50 public SuppressionParseException (Throwable ex) {
+51 super (ex);
+52 }
+53
+54
+55
+56
+57
+58
+59
+60 public SuppressionParseException (String msg, Throwable ex) {
+61 super (msg, ex);
+62 }
+63 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionRule.html b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionRule.html
index 174403973..6bbc0de3b 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionRule.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/SuppressionRule.html
@@ -274,218 +274,222 @@
266 return gav != null ;
267 }
268
-269 private boolean base;
-270
-271
-272
-273
-274
-275
-276 public boolean isBase() {
-277 return base;
-278 }
-279
-280
-281
-282
-283
-284
-285 public void setBase(boolean base) {
-286 this .base = base;
-287 }
-288
-289
-290
-291
-292
-293
-294
-295 public void process(Dependency dependency) {
-296 if (filePath != null && !filePath.matches(dependency.getFilePath())) {
-297 return ;
-298 }
-299 if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) {
-300 return ;
-301 }
-302 if (gav != null ) {
-303 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
-304 boolean gavFound = false;
-305 while (itr.hasNext()) {
-306 final Identifier i = itr.next();
-307 if (identifierMatches("maven" , this .gav, i)) {
-308 gavFound = true ;
-309 break ;
-310 }
-311 }
-312 if (!gavFound) {
-313 return ;
-314 }
-315 }
-316
-317 if (this .hasCpe()) {
-318 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
-319 while (itr.hasNext()) {
-320 final Identifier i = itr.next();
-321 for (PropertyType c : this .cpe) {
-322 if (identifierMatches("cpe" , c, i)) {
-323 if (!isBase()) {
-324 dependency.addSuppressedIdentifier(i);
-325 }
-326 itr.remove();
-327 break ;
-328 }
-329 }
-330 }
-331 }
-332 if (hasCve() || hasCwe() || hasCvssBelow()) {
-333 final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator();
-334 while (itr.hasNext()) {
-335 boolean remove = false;
-336 final Vulnerability v = itr.next();
-337 for (String entry : this .cve) {
-338 if (entry.equalsIgnoreCase(v.getName())) {
-339 remove = true ;
-340 break ;
-341 }
-342 }
-343 if (!remove) {
-344 for (String entry : this .cwe) {
-345 if (v.getCwe() != null ) {
-346 final String toMatch = String.format("CWE-%s " , entry);
-347 final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase();
-348 if (toTest.equals(toMatch)) {
-349 remove = true ;
-350 break ;
-351 }
-352 }
-353 }
-354 }
-355 if (!remove) {
-356 for (float cvss : this .cvssBelow) {
-357 if (v.getCvssScore() < cvss) {
-358 remove = true ;
-359 break ;
-360 }
-361 }
-362 }
-363 if (remove) {
-364 if (!isBase()) {
-365 dependency.addSuppressedVulnerability(v);
-366 }
-367 itr.remove();
-368 }
-369 }
-370 }
-371 }
-372
-373
-374
-375
-376
-377
-378
-379 boolean cpeHasNoVersion(PropertyType c) {
-380 if (c.isRegex()) {
-381 return false;
-382 }
-383 if (countCharacter(c.getValue(), ':') == 3) {
-384 return true ;
-385 }
-386 return false;
-387 }
-388
-389
-390
-391
-392
-393
-394
-395
-396 int countCharacter(String str, char c) {
-397 int count = 0;
-398 int pos = str.indexOf(c) + 1;
-399 while (pos > 0) {
-400 count += 1;
-401 pos = str.indexOf(c, pos) + 1;
-402 }
-403 return count;
-404 }
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414 boolean identifierMatches(String identifierType, PropertyType suppressionEntry, Identifier identifier) {
-415 if (identifierType.equals(identifier.getType())) {
-416 if (suppressionEntry.matches(identifier.getValue())) {
-417 return true ;
-418 } else if ("cpe" .equals(identifierType) && cpeHasNoVersion(suppressionEntry)) {
-419 if (suppressionEntry.isCaseSensitive()) {
-420 return identifier.getValue().startsWith(suppressionEntry.getValue());
-421 } else {
-422 final String id = identifier.getValue().toLowerCase();
-423 final String check = suppressionEntry.getValue().toLowerCase();
-424 return id.startsWith(check);
-425 }
-426 }
-427 }
-428 return false;
-429 }
-430
-431
-432
-433
-434
-435
-436 @Override
-437 public String toString() {
-438 final StringBuilder sb = new StringBuilder();
-439 sb.append("SuppressionRule{" );
-440 if (filePath != null ) {
-441 sb.append("filePath=" ).append(filePath).append("," );
-442 }
-443 if (sha1 != null ) {
-444 sb.append("sha1=" ).append(sha1).append("," );
-445 }
-446 if (gav != null ) {
-447 sb.append("gav=" ).append(gav).append("," );
-448 }
-449 if (cpe != null && cpe.size() > 0) {
-450 sb.append("cpe={" );
-451 for (PropertyType pt : cpe) {
-452 sb.append(pt).append("," );
-453 }
-454 sb.append("}" );
-455 }
-456 if (cwe != null && cwe.size() > 0) {
-457 sb.append("cwe={" );
-458 for (String s : cwe) {
-459 sb.append(s).append("," );
-460 }
-461 sb.append("}" );
-462 }
-463 if (cve != null && cve.size() > 0) {
-464 sb.append("cve={" );
-465 for (String s : cve) {
-466 sb.append(s).append("," );
-467 }
-468 sb.append("}" );
-469 }
-470 if (cvssBelow != null && cvssBelow.size() > 0) {
-471 sb.append("cvssBelow={" );
-472 for (Float s : cvssBelow) {
-473 sb.append(s).append("," );
-474 }
-475 sb.append("}" );
-476 }
-477 sb.append("}" );
-478 return sb.toString();
-479 }
-480 }
+269
+270
+271
+272
+273 private boolean base;
+274
+275
+276
+277
+278
+279
+280 public boolean isBase() {
+281 return base;
+282 }
+283
+284
+285
+286
+287
+288
+289 public void setBase(boolean base) {
+290 this .base = base;
+291 }
+292
+293
+294
+295
+296
+297
+298
+299 public void process(Dependency dependency) {
+300 if (filePath != null && !filePath.matches(dependency.getFilePath())) {
+301 return ;
+302 }
+303 if (sha1 != null && !sha1.equalsIgnoreCase(dependency.getSha1sum())) {
+304 return ;
+305 }
+306 if (gav != null ) {
+307 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+308 boolean gavFound = false;
+309 while (itr.hasNext()) {
+310 final Identifier i = itr.next();
+311 if (identifierMatches("maven" , this .gav, i)) {
+312 gavFound = true ;
+313 break ;
+314 }
+315 }
+316 if (!gavFound) {
+317 return ;
+318 }
+319 }
+320
+321 if (this .hasCpe()) {
+322 final Iterator<Identifier> itr = dependency.getIdentifiers().iterator();
+323 while (itr.hasNext()) {
+324 final Identifier i = itr.next();
+325 for (PropertyType c : this .cpe) {
+326 if (identifierMatches("cpe" , c, i)) {
+327 if (!isBase()) {
+328 dependency.addSuppressedIdentifier(i);
+329 }
+330 itr.remove();
+331 break ;
+332 }
+333 }
+334 }
+335 }
+336 if (hasCve() || hasCwe() || hasCvssBelow()) {
+337 final Iterator<Vulnerability> itr = dependency.getVulnerabilities().iterator();
+338 while (itr.hasNext()) {
+339 boolean remove = false;
+340 final Vulnerability v = itr.next();
+341 for (String entry : this .cve) {
+342 if (entry.equalsIgnoreCase(v.getName())) {
+343 remove = true ;
+344 break ;
+345 }
+346 }
+347 if (!remove) {
+348 for (String entry : this .cwe) {
+349 if (v.getCwe() != null ) {
+350 final String toMatch = String.format("CWE-%s " , entry);
+351 final String toTest = v.getCwe().substring(0, toMatch.length()).toUpperCase();
+352 if (toTest.equals(toMatch)) {
+353 remove = true ;
+354 break ;
+355 }
+356 }
+357 }
+358 }
+359 if (!remove) {
+360 for (float cvss : this .cvssBelow) {
+361 if (v.getCvssScore() < cvss) {
+362 remove = true ;
+363 break ;
+364 }
+365 }
+366 }
+367 if (remove) {
+368 if (!isBase()) {
+369 dependency.addSuppressedVulnerability(v);
+370 }
+371 itr.remove();
+372 }
+373 }
+374 }
+375 }
+376
+377
+378
+379
+380
+381
+382
+383 boolean cpeHasNoVersion(PropertyType c) {
+384 if (c.isRegex()) {
+385 return false;
+386 }
+387 if (countCharacter(c.getValue(), ':') == 3) {
+388 return true ;
+389 }
+390 return false;
+391 }
+392
+393
+394
+395
+396
+397
+398
+399
+400 int countCharacter(String str, char c) {
+401 int count = 0;
+402 int pos = str.indexOf(c) + 1;
+403 while (pos > 0) {
+404 count += 1;
+405 pos = str.indexOf(c, pos) + 1;
+406 }
+407 return count;
+408 }
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418 boolean identifierMatches(String identifierType, PropertyType suppressionEntry, Identifier identifier) {
+419 if (identifierType.equals(identifier.getType())) {
+420 if (suppressionEntry.matches(identifier.getValue())) {
+421 return true ;
+422 } else if ("cpe" .equals(identifierType) && cpeHasNoVersion(suppressionEntry)) {
+423 if (suppressionEntry.isCaseSensitive()) {
+424 return identifier.getValue().startsWith(suppressionEntry.getValue());
+425 } else {
+426 final String id = identifier.getValue().toLowerCase();
+427 final String check = suppressionEntry.getValue().toLowerCase();
+428 return id.startsWith(check);
+429 }
+430 }
+431 }
+432 return false;
+433 }
+434
+435
+436
+437
+438
+439
+440 @Override
+441 public String toString() {
+442 final StringBuilder sb = new StringBuilder();
+443 sb.append("SuppressionRule{" );
+444 if (filePath != null ) {
+445 sb.append("filePath=" ).append(filePath).append("," );
+446 }
+447 if (sha1 != null ) {
+448 sb.append("sha1=" ).append(sha1).append("," );
+449 }
+450 if (gav != null ) {
+451 sb.append("gav=" ).append(gav).append("," );
+452 }
+453 if (cpe != null && cpe.size() > 0) {
+454 sb.append("cpe={" );
+455 for (PropertyType pt : cpe) {
+456 sb.append(pt).append("," );
+457 }
+458 sb.append("}" );
+459 }
+460 if (cwe != null && cwe.size() > 0) {
+461 sb.append("cwe={" );
+462 for (String s : cwe) {
+463 sb.append(s).append("," );
+464 }
+465 sb.append("}" );
+466 }
+467 if (cve != null && cve.size() > 0) {
+468 sb.append("cve={" );
+469 for (String s : cve) {
+470 sb.append(s).append("," );
+471 }
+472 sb.append("}" );
+473 }
+474 if (cvssBelow != null && cvssBelow.size() > 0) {
+475 sb.append("cvssBelow={" );
+476 for (Float s : cvssBelow) {
+477 sb.append(s).append("," );
+478 }
+479 sb.append("}" );
+480 }
+481 sb.append("}" );
+482 return sb.toString();
+483 }
+484 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-frame.html
index 9486eb4c2..93401221f 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.suppression
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.suppression
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-summary.html
index a490c6421..4264970b7 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/suppression/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.suppression
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.suppression
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/DBUtils.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/DBUtils.html
index fdaf8071d..214d91ce1 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/DBUtils.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/DBUtils.html
@@ -62,46 +62,48 @@
54 int id = 0;
55 try {
56 rs = statement.getGeneratedKeys();
-57 rs.next();
-58 id = rs.getInt(1);
-59 } catch (SQLException ex) {
-60 throw new DatabaseException ("Unable to get primary key for inserted row" );
-61 } finally {
-62 closeResultSet(rs);
-63 }
-64 return id;
-65 }
-66
-67
-68
-69
-70
-71
-72 public static void closeStatement(Statement statement) {
-73 if (statement != null ) {
-74 try {
-75 statement.close();
-76 } catch (SQLException ex) {
-77 LOGGER.log(Level.FINEST, statement.toString(), ex);
-78 }
-79 }
-80 }
-81
-82
-83
-84
-85
-86
-87 public static void closeResultSet(ResultSet rs) {
-88 if (rs != null ) {
-89 try {
-90 rs.close();
-91 } catch (SQLException ex) {
-92 LOGGER.log(Level.FINEST, rs.toString(), ex);
-93 }
-94 }
-95 }
-96 }
+57 if (!rs.next()) {
+58 throw new DatabaseException ("Unable to get primary key for inserted row" );
+59 }
+60 id = rs.getInt(1);
+61 } catch (SQLException ex) {
+62 throw new DatabaseException ("Unable to get primary key for inserted row" );
+63 } finally {
+64 closeResultSet(rs);
+65 }
+66 return id;
+67 }
+68
+69
+70
+71
+72
+73
+74 public static void closeStatement(Statement statement) {
+75 if (statement != null ) {
+76 try {
+77 statement.close();
+78 } catch (SQLException ex) {
+79 LOGGER.log(Level.FINEST, statement.toString(), ex);
+80 }
+81 }
+82 }
+83
+84
+85
+86
+87
+88
+89 public static void closeResultSet(ResultSet rs) {
+90 if (rs != null ) {
+91 try {
+92 rs.close();
+93 } catch (SQLException ex) {
+94 LOGGER.log(Level.FINEST, rs.toString(), ex);
+95 }
+96 }
+97 }
+98 }
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersion.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersion.html
index 63380d61c..0fe296227 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersion.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersion.html
@@ -73,7 +73,7 @@
65 public final void parseVersion(String version) {
66 versionParts = new ArrayList<String>();
67 if (version != null ) {
-68 final Pattern rx = Pattern.compile("(\\d+|[a-z]+\\d+|(release|beta|alpha)$)" );
+68 final Pattern rx = Pattern.compile("(\\d+[a-z]{1,3}$|[a-z]+\\d+|\\d+|(release|beta|alpha)$)" );
69 final Matcher matcher = rx.matcher(version.toLowerCase());
70 while (matcher.find()) {
71 versionParts.add(matcher.group());
@@ -206,8 +206,8 @@
198
199 boolean ret = true ;
200 for (int i = 0; i < max; i++) {
-201 String thisVersion = this .versionParts.get(i);
-202 String otherVersion = version.getVersionParts().get(i);
+201 final String thisVersion = this .versionParts.get(i);
+202 final String otherVersion = version.getVersionParts().get(i);
203 if (i >= 3) {
204 if (thisVersion.compareToIgnoreCase(otherVersion) >= 0) {
205 ret = false;
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersionUtil.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersionUtil.html
index 246742c98..7a206edc0 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersionUtil.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/DependencyVersionUtil.html
@@ -40,7 +40,7 @@
32
33
34
-35 private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha)|[a-zA-Z_-]{1,3}\\d{1,8}))?" );
+35 private static final Pattern RX_VERSION = Pattern.compile("\\d+(\\.\\d{1,6})+(\\.?([_-](release|beta|alpha|\\d+)|[a-zA-Z_-]{1,3}\\d{0,8}))?" );
36
37
38
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html
index b4a761ea2..2dc071204 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html
index eb8b664d1..e2b7538be 100644
--- a/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html
+++ b/dependency-check-core/xref/org/owasp/dependencycheck/utils/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Core 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-core/xref/overview-frame.html b/dependency-check-core/xref/overview-frame.html
index e30838387..16382768c 100644
--- a/dependency-check-core/xref/overview-frame.html
+++ b/dependency-check-core/xref/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
@@ -26,6 +26,9 @@
org.owasp.dependencycheck.analyzer.exception
+
+
+ org.owasp.dependencycheck.data.central
org.owasp.dependencycheck.data.cpe
diff --git a/dependency-check-core/xref/overview-summary.html b/dependency-check-core/xref/overview-summary.html
index 61ff8dd43..d93f3faf6 100644
--- a/dependency-check-core/xref/overview-summary.html
+++ b/dependency-check-core/xref/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Core 1.2.5 Reference
+ Dependency-Check Core 1.2.6 Reference
@@ -52,6 +52,11 @@
org.owasp.dependencycheck.analyzer.exception
+
+
+
+ org.owasp.dependencycheck.data.central
+
diff --git a/dependency-check-jenkins/index.html b/dependency-check-jenkins/index.html
index f78aba029..44445ed87 100644
--- a/dependency-check-jenkins/index.html
+++ b/dependency-check-jenkins/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins -
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-jenkins/license.html b/dependency-check-jenkins/license.html
index 964a632f5..07dd0f4d9 100644
--- a/dependency-check-jenkins/license.html
+++ b/dependency-check-jenkins/license.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins - Project License
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-jenkins/project-info.html b/dependency-check-jenkins/project-info.html
index b7c231ce2..8a486bebe 100644
--- a/dependency-check-jenkins/project-info.html
+++ b/dependency-check-jenkins/project-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins - Project Information
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-jenkins/project-summary.html b/dependency-check-jenkins/project-summary.html
index 42cfcb7e1..319b51817 100644
--- a/dependency-check-jenkins/project-summary.html
+++ b/dependency-check-jenkins/project-summary.html
@@ -1,13 +1,13 @@
-
+
dependency-check-jenkins - Project Summary
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -196,7 +196,7 @@
dependency-check-jenkins
Version
-1.2.5
+1.2.6
Type
pom
diff --git a/dependency-check-maven/apidocs/allclasses-frame.html b/dependency-check-maven/apidocs/allclasses-frame.html
index 0d8750a7a..2fc880542 100644
--- a/dependency-check-maven/apidocs/allclasses-frame.html
+++ b/dependency-check-maven/apidocs/allclasses-frame.html
@@ -2,10 +2,10 @@
-
+
-All Classes (Dependency-Check Maven Plugin 1.2.5 API)
-
+All Classes (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/allclasses-noframe.html b/dependency-check-maven/apidocs/allclasses-noframe.html
index 81483d18e..9cddfd719 100644
--- a/dependency-check-maven/apidocs/allclasses-noframe.html
+++ b/dependency-check-maven/apidocs/allclasses-noframe.html
@@ -2,10 +2,10 @@
-
+
-All Classes (Dependency-Check Maven Plugin 1.2.5 API)
-
+All Classes (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/constant-values.html b/dependency-check-maven/apidocs/constant-values.html
index 451945e11..b872ba3dc 100644
--- a/dependency-check-maven/apidocs/constant-values.html
+++ b/dependency-check-maven/apidocs/constant-values.html
@@ -2,16 +2,16 @@
-
+
-Constant Field Values (Dependency-Check Maven Plugin 1.2.5 API)
-
+Constant Field Values (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/deprecated-list.html b/dependency-check-maven/apidocs/deprecated-list.html
index 02f479c7a..f23bd3744 100644
--- a/dependency-check-maven/apidocs/deprecated-list.html
+++ b/dependency-check-maven/apidocs/deprecated-list.html
@@ -2,16 +2,16 @@
-
+
-Deprecated List (Dependency-Check Maven Plugin 1.2.5 API)
-
+Deprecated List (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/help-doc.html b/dependency-check-maven/apidocs/help-doc.html
index bd7c0f722..ce733bfb0 100644
--- a/dependency-check-maven/apidocs/help-doc.html
+++ b/dependency-check-maven/apidocs/help-doc.html
@@ -2,16 +2,16 @@
-
+
-API Help (Dependency-Check Maven Plugin 1.2.5 API)
-
+API Help (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/index-all.html b/dependency-check-maven/apidocs/index-all.html
index 01c8ae053..e33c8c96a 100644
--- a/dependency-check-maven/apidocs/index-all.html
+++ b/dependency-check-maven/apidocs/index-all.html
@@ -2,16 +2,16 @@
-
+
-Index (Dependency-Check Maven Plugin 1.2.5 API)
-
+Index (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/index.html b/dependency-check-maven/apidocs/index.html
index e8e905784..bb215b96f 100644
--- a/dependency-check-maven/apidocs/index.html
+++ b/dependency-check-maven/apidocs/index.html
@@ -2,9 +2,9 @@
-
+
-Dependency-Check Maven Plugin 1.2.5 API
+Dependency-Check Maven Plugin 1.2.6 API
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html
index 32950a32a..7c6a6395b 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/HelpMojo.html
@@ -2,16 +2,16 @@
-
+
-HelpMojo (Dependency-Check Maven Plugin 1.2.5 API)
-
+HelpMojo (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/ReportAggregationMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/ReportAggregationMojo.html
index 87a077126..b429f8e2d 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/ReportAggregationMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/ReportAggregationMojo.html
@@ -2,16 +2,16 @@
-
+
-ReportAggregationMojo (Dependency-Check Maven Plugin 1.2.5 API)
-
+ReportAggregationMojo (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html
index 9168d827d..5856ad259 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/DependencyCheckMojo.html
@@ -2,16 +2,16 @@
-
+
-Uses of Class org.owasp.dependencycheck.maven.DependencyCheckMojo (Dependency-Check Maven Plugin 1.2.5 API)
-
+Uses of Class org.owasp.dependencycheck.maven.DependencyCheckMojo (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html
index 7628b42bf..aa519944f 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/HelpMojo.html
@@ -2,16 +2,16 @@
-
+
-Uses of Class org.owasp.dependencycheck.maven.HelpMojo (Dependency-Check Maven Plugin 1.2.5 API)
-
+Uses of Class org.owasp.dependencycheck.maven.HelpMojo (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/ReportAggregationMojo.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/ReportAggregationMojo.html
index c8dcb30a6..77aa43104 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/ReportAggregationMojo.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/class-use/ReportAggregationMojo.html
@@ -2,16 +2,16 @@
-
+
-Uses of Class org.owasp.dependencycheck.maven.ReportAggregationMojo (Dependency-Check Maven Plugin 1.2.5 API)
-
+Uses of Class org.owasp.dependencycheck.maven.ReportAggregationMojo (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html
index 3721697c0..2fea09f8f 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-frame.html
@@ -2,10 +2,10 @@
-
+
-org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.2.5 API)
-
+org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html
index 07fb8e2e0..c62c93812 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-summary.html
@@ -2,16 +2,16 @@
-
+
-org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.2.5 API)
-
+org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html
index 4713e1adb..e169cb087 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-tree.html
@@ -2,16 +2,16 @@
-
+
-org.owasp.dependencycheck.maven Class Hierarchy (Dependency-Check Maven Plugin 1.2.5 API)
-
+org.owasp.dependencycheck.maven Class Hierarchy (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html
index 82519b125..f85c8ca2f 100644
--- a/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html
+++ b/dependency-check-maven/apidocs/org/owasp/dependencycheck/maven/package-use.html
@@ -2,16 +2,16 @@
-
+
-Uses of Package org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.2.5 API)
-
+Uses of Package org.owasp.dependencycheck.maven (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/apidocs/overview-tree.html b/dependency-check-maven/apidocs/overview-tree.html
index afb165ac4..70a4df21d 100644
--- a/dependency-check-maven/apidocs/overview-tree.html
+++ b/dependency-check-maven/apidocs/overview-tree.html
@@ -2,16 +2,16 @@
-
+
-Class Hierarchy (Dependency-Check Maven Plugin 1.2.5 API)
-
+Class Hierarchy (Dependency-Check Maven Plugin 1.2.6 API)
+
diff --git a/dependency-check-maven/check-mojo.html b/dependency-check-maven/check-mojo.html
index b0c427651..a07d73e09 100644
--- a/dependency-check-maven/check-mojo.html
+++ b/dependency-check-maven/check-mojo.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven -
dependency-check:check
@@ -55,7 +55,7 @@
-
+
/
@@ -69,9 +69,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -165,7 +165,7 @@
Full name :
-org.owasp:dependency-check-maven:1.2.5:check
+org.owasp:dependency-check-maven:1.2.6:check
Description :
diff --git a/dependency-check-maven/checkstyle.html b/dependency-check-maven/checkstyle.html
index 1cea0aae5..570986770 100644
--- a/dependency-check-maven/checkstyle.html
+++ b/dependency-check-maven/checkstyle.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Checkstyle Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html b/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html
index c6e872445..2e43d28e6 100644
--- a/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html
+++ b/dependency-check-maven/cobertura/frame-summary-org.owasp.dependencycheck.maven.html
@@ -16,7 +16,7 @@
-
+
diff --git a/dependency-check-maven/cobertura/frame-summary.html b/dependency-check-maven/cobertura/frame-summary.html
index ebef30df5..e710d70da 100644
--- a/dependency-check-maven/cobertura/frame-summary.html
+++ b/dependency-check-maven/cobertura/frame-summary.html
@@ -16,8 +16,8 @@
-
+
diff --git a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html
index 6d75e862f..520c7e8e2 100644
--- a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html
+++ b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.DependencyCheckMojo.html
@@ -12,7 +12,7 @@
@@ -114,1149 +114,1147 @@
48
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
49
- import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
+ import org.owasp.dependencycheck.data.nexus.MavenArtifact;
50
- import org.owasp.dependencycheck.dependency.Dependency;
+ import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
51
- import org.owasp.dependencycheck.dependency.Identifier;
+ import org.owasp.dependencycheck.dependency.Confidence;
52
- import org.owasp.dependencycheck.dependency.Vulnerability;
+ import org.owasp.dependencycheck.dependency.Dependency;
53
- import org.owasp.dependencycheck.utils.LogUtils;
+ import org.owasp.dependencycheck.dependency.Identifier;
54
- import org.owasp.dependencycheck.utils.Settings;
+ import org.owasp.dependencycheck.dependency.Vulnerability;
55
-
+ import org.owasp.dependencycheck.utils.LogUtils;
56
-
+ import org.owasp.dependencycheck.utils.Settings;
57
-
+
58
-
+
59
-
+
60
-
+
61
- @Mojo(name = "check" , defaultPhase = LifecyclePhase.COMPILE, threadSafe = true ,
+
62
- requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM,
+
63
- requiresOnline = true )
+ @Mojo(
64
- public class DependencyCheckMojo extends ReportAggregationMojo {
+ name = "check" ,
65
-
+ defaultPhase = LifecyclePhase.COMPILE,
66
-
+ threadSafe = true ,
67
-
+ requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM,
68
-
+ requiresOnline = true
69
-
- 70 0 private static final Logger LOGGER = Logger.getLogger(DependencyCheckMojo.class .getName());
+ )
+ 70
+ public class DependencyCheckMojo extends ReportAggregationMojo {
71
-
- 72
-
- 73
-
- 74
- private static final String PROPERTIES_FILE = "mojo.properties" ;
- 75
-
- 76
-
- 77
-
- 78
- private static final String LOG_PROPERTIES_FILE = "log.properties" ;
- 79
-
- 80
-
- 81
-
- 82 0 private static final String NEW_LINE = System.getProperty("line.separator" , "\n" ).intern();
- 83
-
- 84
-
- 85
-
- 86 0 private Engine engine = null ;
- 87
-
- 88
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76 0 private static final Logger LOGGER = Logger.getLogger(DependencyCheckMojo.class .getName());
+ 77
+
+ 78
+
+ 79
+
+ 80
+ private static final String PROPERTIES_FILE = "mojo.properties" ;
+ 81
+
+ 82
+
+ 83
+
+ 84
+ private static final String LOG_PROPERTIES_FILE = "log.properties" ;
+ 85
+
+ 86
+
+ 87
+
+ 88 0 private static final String NEW_LINE = System.getProperty("line.separator" , "\n" ).intern();
89
-
+
90
-
+
91
-
- 92
- 93 0 @Parameter(property = "logfile" , defaultValue = "" )
+ 92 0 private Engine engine = null ;
+ 93
+
94
- private String logFile = null ;
+
95
-
+
96
-
- 97
-
- 98
- @Parameter(defaultValue = "${project.build.directory}" , required = true )
- 99
- private File outputDirectory;
- 100
+ 97
+
+ 98
+
+ 99 0 @Parameter(property = "logfile" , defaultValue = "" )
+ 100
+ private String logFile = null ;
101
-
+
102
-
+
103
- 104 0 @SuppressWarnings("CanBeFinal" )
+ 104
+ @Parameter(defaultValue = "${project.build.directory}" , required = true )
105
- @Parameter(property = "failBuildOnCVSS" , defaultValue = "11" , required = true )
+ private File outputDirectory;
106
- private float failBuildOnCVSS = 11;
+
107
-
+
108
-
+
109
-
- 110
- 111 0 @SuppressWarnings("CanBeFinal" )
+ 110 0 @SuppressWarnings("CanBeFinal" )
+ 111
+ @Parameter(property = "failBuildOnCVSS" , defaultValue = "11" , required = true )
112
- @Parameter(property = "autoupdate" , defaultValue = "true" , required = true )
+ private float failBuildOnCVSS = 11;
113
- private boolean autoUpdate = true ;
+
114
-
+
115
-
+
116
-
- 117
- 118 0 @SuppressWarnings("CanBeFinal" )
+ 117 0 @SuppressWarnings("CanBeFinal" )
+ 118
+ @Parameter(property = "autoupdate" , defaultValue = "true" , required = true )
119
- @Parameter(property = "format" , defaultValue = "HTML" , required = true )
+ private boolean autoUpdate = true ;
120
- private String format = "HTML" ;
- 121
+ 121
+
122
-
+
123
- 124
- @Parameter(property = "mavenSettings" , defaultValue = "${settings}" , required = false )
+ 124 0 @SuppressWarnings("CanBeFinal" )
125
- private org.apache.maven.settings.Settings mavenSettings;
+ @Parameter(property = "format" , defaultValue = "HTML" , required = true )
126
-
+ private String format = "HTML" ;
127
128
-
+
129
130
- @SuppressWarnings("CanBeFinal" )
+ @Parameter(property = "mavenSettings" , defaultValue = "${settings}" , required = false )
131
- @Parameter(property = "mavenSettingsProxyId" , required = false )
+ private org.apache.maven.settings.Settings mavenSettings;
132
- private String mavenSettingsProxyId;
- 133
- 134
+ 133
+ 134
+
135
-
- 136
- 137 0 @SuppressWarnings("CanBeFinal" )
+ 136
+ @SuppressWarnings("CanBeFinal" )
+ 137
+ @Parameter(property = "mavenSettingsProxyId" , required = false )
138
- @Parameter(property = "connectionTimeout" , defaultValue = "" , required = false )
+ private String mavenSettingsProxyId;
139
- private String connectionTimeout = null ;
+
140
141
-
+
142
143 0 @SuppressWarnings("CanBeFinal" )
144
- @Parameter(property = "suppressionFile" , defaultValue = "" , required = false )
+ @Parameter(property = "connectionTimeout" , defaultValue = "" , required = false )
145
- private String suppressionFile = null ;
+ private String connectionTimeout = null ;
146
147
-
+
148
149 0 @SuppressWarnings("CanBeFinal" )
150
- @Parameter(property = "showSummary" , defaultValue = "true" , required = false )
+ @Parameter(property = "suppressionFile" , defaultValue = "" , required = false )
151
- private boolean showSummary = true ;
+ private String suppressionFile = null ;
152
-
+
153
-
+
154
-
- 155
- 156 0 @SuppressWarnings("CanBeFinal" )
+ 155 0 @SuppressWarnings("CanBeFinal" )
+ 156
+ @Parameter(property = "showSummary" , defaultValue = "true" , required = false )
157
- @Parameter(property = "jarAnalyzerEnabled" , defaultValue = "true" , required = false )
+ private boolean showSummary = true ;
158
- private boolean jarAnalyzerEnabled = true ;
+
159
-
+
160
-
+
161
-
- 162
- 163 0 @SuppressWarnings("CanBeFinal" )
+ 162 0 @SuppressWarnings("CanBeFinal" )
+ 163
+ @Parameter(property = "jarAnalyzerEnabled" , defaultValue = "true" , required = false )
164
- @Parameter(property = "archiveAnalyzerEnabled" , defaultValue = "true" , required = false )
+ private boolean jarAnalyzerEnabled = true ;
165
- private boolean archiveAnalyzerEnabled = true ;
+
166
-
+
167
-
+
168
-
- 169
- 170 0 @SuppressWarnings("CanBeFinal" )
+ 169 0 @SuppressWarnings("CanBeFinal" )
+ 170
+ @Parameter(property = "archiveAnalyzerEnabled" , defaultValue = "true" , required = false )
171
- @Parameter(property = "assemblyAnalyzerEnabled" , defaultValue = "true" , required = false )
+ private boolean archiveAnalyzerEnabled = true ;
172
- private boolean assemblyAnalyzerEnabled = true ;
+
173
-
+
174
-
+
175
-
- 176
- 177 0 @SuppressWarnings("CanBeFinal" )
+ 176 0 @SuppressWarnings("CanBeFinal" )
+ 177
+ @Parameter(property = "assemblyAnalyzerEnabled" , defaultValue = "true" , required = false )
178
- @Parameter(property = "nuspecAnalyzerEnabled" , defaultValue = "true" , required = false )
+ private boolean assemblyAnalyzerEnabled = true ;
179
- private boolean nuspecAnalyzerEnabled = true ;
- 180
- 181
+ 180
+ 181
+
182
-
- 183
- 184 0 @SuppressWarnings("CanBeFinal" )
+ 183 0 @SuppressWarnings("CanBeFinal" )
+ 184
+ @Parameter(property = "nuspecAnalyzerEnabled" , defaultValue = "true" , required = false )
185
- @Parameter(property = "nexusAnalyzerEnabled" , defaultValue = "true" , required = false )
+ private boolean nuspecAnalyzerEnabled = true ;
186
- private boolean nexusAnalyzerEnabled = true ;
+
187
188
189
- 190
- @Parameter(property = "nexusUrl" , defaultValue = "" , required = false )
+ 190 0 @SuppressWarnings("CanBeFinal" )
191
- private String nexusUrl;
+ @Parameter(property = "nexusAnalyzerEnabled" , defaultValue = "true" , required = false )
192
-
+ private boolean nexusAnalyzerEnabled = true ;
193
-
+
194
+
+ 195
- 195 0 @Parameter(property = "nexusUsesProxy" , defaultValue = "true" , required = false )
196
- private boolean nexusUsesProxy = true ;
+ @Parameter(property = "nexusUrl" , defaultValue = "" , required = false )
197
-
+ private String nexusUrl;
198
-
+
199
-
+
200
- @Parameter(property = "connectionString" , defaultValue = "" , required = false )
- 201
- private String connectionString;
+
+ 201 0 @Parameter(property = "nexusUsesProxy" , defaultValue = "true" , required = false )
202
-
+ private boolean nexusUsesProxy = true ;
203
-
+
204
-
+
205
- @Parameter(property = "databaseDriverName" , defaultValue = "" , required = false )
+
206
- private String databaseDriverName;
+ @Parameter(property = "connectionString" , defaultValue = "" , required = false )
207
-
+ private String connectionString;
208
-
+
209
-
+
210
- @Parameter(property = "databaseDriverPath" , defaultValue = "" , required = false )
+
211
- private String databaseDriverPath;
+ @Parameter(property = "databaseDriverName" , defaultValue = "" , required = false )
212
-
+ private String databaseDriverName;
213
-
+
214
-
+
215
- @Parameter(property = "databaseUser" , defaultValue = "" , required = false )
+
216
- private String databaseUser;
+ @Parameter(property = "databaseDriverPath" , defaultValue = "" , required = false )
217
-
+ private String databaseDriverPath;
218
-
+
219
-
+
220
- @Parameter(property = "databasePassword" , defaultValue = "" , required = false )
+
221
- private String databasePassword;
+ @Parameter(property = "databaseUser" , defaultValue = "" , required = false )
222
-
+ private String databaseUser;
223
-
- 224
-
- 225
- @Parameter(property = "zipExtensions" , required = false )
- 226
- private String zipExtensions;
- 227
- 228
-
- 229
+ 224
+
+ 225
+
+ 226
+ @Parameter(property = "databasePassword" , defaultValue = "" , required = false )
+ 227
+ private String databasePassword;
+ 228
+
+ 229
+
+ 230
- 230 0 @SuppressWarnings("CanBeFinal" )
231
- @Parameter(property = "skipTestScope" , defaultValue = "true" , required = false )
+ @Parameter(property = "zipExtensions" , required = false )
232
- private boolean skipTestScope = true ;
+ private String zipExtensions;
233
234
-
+
235
236 0 @SuppressWarnings("CanBeFinal" )
237
- @Parameter(property = "skipRuntimeScope" , defaultValue = "false" , required = false )
+ @Parameter(property = "skipTestScope" , defaultValue = "true" , required = false )
238
- private boolean skipRuntimeScope = false ;
+ private boolean skipTestScope = true ;
239
240
-
+
241
242 0 @SuppressWarnings("CanBeFinal" )
243
- @Parameter(property = "skipProvidedScope" , defaultValue = "false" , required = false )
+ @Parameter(property = "skipRuntimeScope" , defaultValue = "false" , required = false )
244
- private boolean skipProvidedScope = false ;
+ private boolean skipRuntimeScope = false ;
245
246
-
+
247
- 248
- @Parameter(property = "dataDirectory" , defaultValue = "" , required = false )
+ 248 0 @SuppressWarnings("CanBeFinal" )
249
- private String dataDirectory;
+ @Parameter(property = "skipProvidedScope" , defaultValue = "false" , required = false )
250
-
+ private boolean skipProvidedScope = false ;
251
-
+
252
-
+
253
- @Parameter(property = "cveUrl12Modified" , defaultValue = "" , required = false )
+
254
- private String cveUrl12Modified;
+ @Parameter(property = "dataDirectory" , defaultValue = "" , required = false )
255
-
+ private String dataDirectory;
256
-
+
257
-
+
258
- @Parameter(property = "cveUrl20Modified" , defaultValue = "" , required = false )
+
259
- private String cveUrl20Modified;
+ @Parameter(property = "cveUrl12Modified" , defaultValue = "" , required = false )
260
-
+ private String cveUrl12Modified;
261
-
- 262
-
- 263
- @Parameter(property = "cveUrl12Base" , defaultValue = "" , required = false )
- 264
- private String cveUrl12Base;
- 265
- 266
+ 262
- 267
+ 263
+ 264
+ @Parameter(property = "cveUrl20Modified" , defaultValue = "" , required = false )
+ 265
+ private String cveUrl20Modified;
+ 266
+
+ 267
+
268
- @Parameter(property = "cveUrl20Base" , defaultValue = "" , required = false )
+
269
- private String cveUrl20Base;
+ @Parameter(property = "cveUrl12Base" , defaultValue = "" , required = false )
270
-
+ private String cveUrl12Base;
271
272
-
+
273
274
- @Parameter(property = "pathToMono" , defaultValue = "" , required = false )
+ @Parameter(property = "cveUrl20Base" , defaultValue = "" , required = false )
275
- private String pathToMono;
+ private String cveUrl20Base;
276
277
278
-
+
279
-
+
280
-
+ @Parameter(property = "pathToMono" , defaultValue = "" , required = false )
281
-
- 282 0 @SuppressWarnings("CanBeFinal" )
+ private String pathToMono;
+ 282
+
283
- @Parameter(property = "proxyUrl" , defaultValue = "" , required = false )
+
284
- @Deprecated
+
285
- private String proxyUrl = null ;
+
286
-
+
287
-
- 288
-
+
+ 288 0 @SuppressWarnings("CanBeFinal" )
289
-
+ @Parameter(property = "proxyUrl" , defaultValue = "" , required = false )
290
-
- 291 0 @SuppressWarnings("CanBeFinal" )
- 292
- @Parameter(property = "externalReport" )
- 293
@Deprecated
+ 291
+ private String proxyUrl = null ;
+ 292
+
+ 293
+
294
- private String externalReport = null ;
+
295
-
+
296
-
- 297
-
+
+ 297 0 @SuppressWarnings("CanBeFinal" )
298
-
- 299 0 public DependencyCheckMojo() {
- 300 0 final InputStream in = DependencyCheckMojo.class .getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
- 301 0 LogUtils.prepareLogger(in, logFile);
- 302 0 }
+ @Parameter(property = "externalReport" )
+ 299
+ @Deprecated
+ 300
+ private String externalReport = null ;
+ 301
+
+ 302
+
303
-
+
304
-
+
305
-
- 306
-
- 307
-
- 308
-
- 309
+ 306 0 public DependencyCheckMojo() {
+ 307 0 final InputStream in = DependencyCheckMojo.class .getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
+ 308 0 LogUtils.prepareLogger(in, logFile);
+ 309 0 }
310
- private Engine executeDependencyCheck() throws DatabaseException {
- 311 0 return executeDependencyCheck(getProject());
+
+ 311
+
312
- }
- 313
-
- 314
-
- 315
- 316
+ 313
- 317
-
- 318
+ 314
- 319
+ 315
+ 316
+
+ 317
+ private Engine executeDependencyCheck() throws DatabaseException {
+ 318 0 return executeDependencyCheck(getProject());
+ 319
+ }
320
-
+
321
- private Engine executeDependencyCheck(MavenProject project) throws DatabaseException {
- 322 0 final Engine localEngine = initializeEngine();
+
+ 322
+
323
-
- 324 0 final Set<Artifact> artifacts = project.getArtifacts();
- 325 0 for (Artifact a : artifacts) {
- 326 0 if (excludeFromScan(a)) {
- 327 0 continue ;
+
+ 324
+
+ 325
+
+ 326
+
+ 327
+
328
- }
- 329
+ private Engine executeDependencyCheck(MavenProject project) throws DatabaseException {
+ 329 0 final Engine localEngine = initializeEngine();
+ 330
- 330 0 localEngine.scan(a.getFile().getAbsolutePath());
- 331 0 }
- 332 0 localEngine.analyzeDependencies();
- 333
-
- 334 0 return localEngine;
+ 331 0 final Set<Artifact> artifacts = project.getArtifacts();
+ 332 0 for (Artifact a : artifacts) {
+ 333 0 if (excludeFromScan(a)) {
+ 334 0 continue ;
335
- }
- 336
-
- 337
-
- 338
-
- 339
-
- 340
-
- 341
-
- 342
-
+ }
+ 336 0 final List<Dependency> deps = localEngine.scan(a.getFile().getAbsoluteFile());
+ 337 0 if (deps != null ) {
+ 338 0 if (deps.size() == 1) {
+ 339 0 final Dependency d = deps.get(0);
+ 340 0 if (d != null ) {
+ 341 0 final MavenArtifact ma = new MavenArtifact(a.getGroupId(), a.getArtifactId(), a.getVersion());
+ 342 0 d.addAsEvidence("pom" , ma, Confidence.HIGHEST);
343
- private Engine initializeEngine() throws DatabaseException {
- 344 0 populateSettings();
- 345 0 final Engine localEngine = new Engine();
- 346 0 return localEngine;
- 347
- }
+ }
+ 344 0 } else {
+ 345 0 final String msg = String.format("More then 1 dependency was identified in first pass scan of '%s:%s:%s'" ,
+ 346
+ a.getGroupId(), a.getArtifactId(), a.getVersion());
+ 347 0 LOGGER.info(msg);
348
-
+ }
349
-
- 350
-
- 351
-
+ }
+ 350 0 }
+ 351 0 localEngine.analyzeDependencies();
352
-
- 353
-
+
+ 353 0 return localEngine;
354
-
+ }
355
- private boolean excludeFromScan(Artifact a) {
- 356 0 if (skipTestScope && Artifact.SCOPE_TEST.equals(a.getScope())) {
- 357 0 return true ;
+
+ 356
+
+ 357
+
358
- }
- 359 0 if (skipProvidedScope && Artifact.SCOPE_PROVIDED.equals(a.getScope())) {
- 360 0 return true ;
+
+ 359
+
+ 360
+
361
- }
- 362 0 if (skipRuntimeScope && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
- 363 0 return true ;
- 364
- }
- 365 0 return false ;
+
+ 362
+ private Engine initializeEngine() throws DatabaseException {
+ 363 0 populateSettings();
+ 364 0 final Engine localEngine = new Engine();
+ 365 0 return localEngine;
366
}
367
368
-
- 369
+ 369
+
370
-
+
371
-
+
372
-
+
373
- private void populateSettings() {
- 374 0 Settings.initialize();
- 375 0 InputStream mojoProperties = null ;
- 376
- try {
- 377 0 mojoProperties = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
- 378 0 Settings.mergeProperties(mojoProperties);
- 379 0 } catch (IOException ex) {
- 380 0 LOGGER.log(Level.WARNING, "Unable to load the dependency-check ant task.properties file." );
- 381 0 LOGGER.log(Level.FINE, null , ex);
- 382
- } finally {
- 383 0 if (mojoProperties != null ) {
- 384
- try {
- 385 0 mojoProperties.close();
- 386 0 } catch (IOException ex) {
- 387 0 LOGGER.log(Level.FINEST, null , ex);
- 388 0 }
+
+ 374
+ private boolean excludeFromScan(Artifact a) {
+ 375 0 if (skipTestScope && Artifact.SCOPE_TEST.equals(a.getScope())) {
+ 376 0 return true ;
+ 377
+ }
+ 378 0 if (skipProvidedScope && Artifact.SCOPE_PROVIDED.equals(a.getScope())) {
+ 379 0 return true ;
+ 380
+ }
+ 381 0 if (skipRuntimeScope && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
+ 382 0 return true ;
+ 383
+ }
+ 384 0 return false ;
+ 385
+ }
+ 386
+
+ 387
+
+ 388
+
389
- }
+
390
- }
+
391
-
- 392 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
- 393 0 if (externalReport != null ) {
- 394 0 LOGGER.warning("The 'externalReport' option was set; this configuration option has been removed. "
+
+ 392
+ private void populateSettings() {
+ 393 0 Settings.initialize();
+ 394 0 InputStream mojoProperties = null ;
395
- + "Please update the dependency-check-maven plugin's configuration" );
- 396
- }
- 397
-
- 398 0 if (proxyUrl != null && !proxyUrl.isEmpty()) {
- 399 0 LOGGER.warning("Deprecated configuration detected, proxyUrl will be ignored; use the maven settings "
- 400
- + "to configure the proxy instead" );
+ try {
+ 396 0 mojoProperties = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
+ 397 0 Settings.mergeProperties(mojoProperties);
+ 398 0 } catch (IOException ex) {
+ 399 0 LOGGER.log(Level.WARNING, "Unable to load the dependency-check ant task.properties file." );
+ 400 0 LOGGER.log(Level.FINE, null , ex);
401
+ } finally {
+ 402 0 if (mojoProperties != null ) {
+ 403
+ try {
+ 404 0 mojoProperties.close();
+ 405 0 } catch (IOException ex) {
+ 406 0 LOGGER.log(Level.FINEST, null , ex);
+ 407 0 }
+ 408
+ }
+ 409
}
- 402 0 final Proxy proxy = getMavenProxy();
- 403 0 if (proxy != null ) {
- 404 0 Settings.setString(Settings.KEYS.PROXY_SERVER, proxy.getHost());
- 405 0 Settings.setString(Settings.KEYS.PROXY_PORT, Integer.toString(proxy.getPort()));
- 406 0 final String userName = proxy.getUsername();
- 407 0 final String password = proxy.getPassword();
- 408 0 if (userName != null ) {
- 409 0 Settings.setString(Settings.KEYS.PROXY_USERNAME, userName);
410
- }
- 411 0 if (password != null ) {
- 412 0 Settings.setString(Settings.KEYS.PROXY_PASSWORD, password);
- 413
- }
- 414
+ 411 0 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
+ 412 0 if (externalReport != null ) {
+ 413 0 LOGGER.warning("The 'externalReport' option was set; this configuration option has been removed. "
+ 414
+ + "Please update the dependency-check-maven plugin's configuration" );
415
}
416
- 417 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
- 418 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
+ 417 0 if (proxyUrl != null && !proxyUrl.isEmpty()) {
+ 418 0 LOGGER.warning("Deprecated configuration detected, proxyUrl will be ignored; use the maven settings " + "to configure the proxy instead" );
419
}
- 420 0 if (suppressionFile != null && !suppressionFile.isEmpty()) {
- 421 0 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
- 422
- }
- 423
+ 420 0 final Proxy proxy = getMavenProxy();
+ 421 0 if (proxy != null ) {
+ 422 0 Settings.setString(Settings.KEYS.PROXY_SERVER, proxy.getHost());
+ 423 0 Settings.setString(Settings.KEYS.PROXY_PORT, Integer.toString(proxy.getPort()));
+ 424 0 final String userName = proxy.getUsername();
+ 425 0 final String password = proxy.getPassword();
+ 426 0 if (userName != null ) {
+ 427 0 Settings.setString(Settings.KEYS.PROXY_USERNAME, userName);
+ 428
+ }
+ 429 0 if (password != null ) {
+ 430 0 Settings.setString(Settings.KEYS.PROXY_PASSWORD, password);
+ 431
+ }
+ 432
- 424
-
- 425
-
- 426 0 Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, jarAnalyzerEnabled);
- 427
-
- 428 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, nuspecAnalyzerEnabled);
- 429
-
- 430 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
- 431 0 if (nexusUrl != null && !nexusUrl.isEmpty()) {
- 432 0 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
433
}
- 434 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
- 435
-
- 436 0 Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, archiveAnalyzerEnabled);
- 437 0 if (zipExtensions != null && !zipExtensions.isEmpty()) {
- 438 0 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
- 439
+ 434
+
+ 435 0 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
+ 436 0 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
+ 437
}
+ 438 0 if (suppressionFile != null && !suppressionFile.isEmpty()) {
+ 439 0 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
440
-
- 441 0 Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, assemblyAnalyzerEnabled);
- 442 0 if (pathToMono != null && !pathToMono.isEmpty()) {
- 443 0 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
- 444
}
+ 441
+
+ 442
+
+ 443
+
+ 444 0 Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, jarAnalyzerEnabled);
445
-
- 446
-
- 447 0 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
- 448 0 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
- 449
+
+ 446 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, nuspecAnalyzerEnabled);
+ 447
+
+ 448 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
+ 449 0 if (nexusUrl != null && !nexusUrl.isEmpty()) {
+ 450 0 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
+ 451
}
- 450 0 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
- 451 0 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
- 452
+ 452 0 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
+ 453
+
+ 454 0 Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, archiveAnalyzerEnabled);
+ 455 0 if (zipExtensions != null && !zipExtensions.isEmpty()) {
+ 456 0 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
+ 457
}
- 453 0 if (connectionString != null && !connectionString.isEmpty()) {
- 454 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
- 455
- }
- 456 0 if (databaseUser != null && !databaseUser.isEmpty()) {
- 457 0 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
458
- }
- 459 0 if (databasePassword != null && !databasePassword.isEmpty()) {
- 460 0 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
- 461
- }
+
+ 459 0 Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, assemblyAnalyzerEnabled);
+ 460 0 if (pathToMono != null && !pathToMono.isEmpty()) {
+ 461 0 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
462
-
- 463 0 if (dataDirectory != null && !dataDirectory.isEmpty()) {
- 464 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
- 465
}
- 466
+ 463
+ 464
+
+ 465 0 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
+ 466 0 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
467
-
- 468 0 Settings.setBoolean(Settings.KEYS.SKIP_TEST_SCOPE, skipTestScope);
- 469 0 Settings.setBoolean(Settings.KEYS.SKIP_RUNTIME_SCOPE, skipRuntimeScope);
- 470 0 Settings.setBoolean(Settings.KEYS.SKIP_PROVIDED_SCOPE, skipProvidedScope);
- 471
-
- 472
-
- 473 0 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
- 474 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
- 475
}
- 476 0 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
- 477 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
- 478
+ 468 0 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
+ 469 0 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
+ 470
}
- 479 0 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
- 480 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
- 481
+ 471 0 if (connectionString != null && !connectionString.isEmpty()) {
+ 472 0 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
+ 473
+ }
+ 474 0 if (databaseUser != null && !databaseUser.isEmpty()) {
+ 475 0 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
+ 476
+ }
+ 477 0 if (databasePassword != null && !databasePassword.isEmpty()) {
+ 478 0 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
+ 479
+ }
+ 480
+
+ 481 0 if (dataDirectory != null && !dataDirectory.isEmpty()) {
+ 482 0 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
+ 483
}
- 482 0 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
- 483 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
484
- }
- 485 0 }
- 486
- 487
-
- 488
-
+ 485
+
+ 486 0 Settings.setBoolean(Settings.KEYS.SKIP_TEST_SCOPE, skipTestScope);
+ 487 0 Settings.setBoolean(Settings.KEYS.SKIP_RUNTIME_SCOPE, skipRuntimeScope);
+ 488 0 Settings.setBoolean(Settings.KEYS.SKIP_PROVIDED_SCOPE, skipProvidedScope);
489
-
+
490
-
- 491
-
- 492
- private Proxy getMavenProxy() {
- 493 0 if (mavenSettings != null ) {
- 494 0 final List<Proxy> proxies = mavenSettings.getProxies();
- 495 0 if (proxies != null && proxies.size() > 0) {
- 496 0 if (mavenSettingsProxyId != null ) {
- 497 0 for (Proxy proxy : proxies) {
- 498 0 if (mavenSettingsProxyId.equalsIgnoreCase(proxy.getId())) {
- 499 0 return proxy;
- 500
- }
- 501 0 }
- 502 0 } else if (proxies.size() == 1) {
- 503 0 return proxies.get(0);
- 504
- } else {
- 505 0 LOGGER.warning("Multiple proxy defentiions exist in the Maven settings. In the dependency-check "
- 506
- + "configuration set the maveSettingsProxyId so that the correct proxy will be used." );
- 507 0 throw new IllegalStateException("Ambiguous proxy definition" );
- 508
- }
- 509
- }
- 510
+
+ 491 0 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
+ 492 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
+ 493
}
- 511 0 return null ;
- 512
- }
- 513
-
- 514
+ 494 0 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
+ 495 0 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
+ 496
+ }
+ 497 0 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
+ 498 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
+ 499
+ }
+ 500 0 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
+ 501 0 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
+ 502
+ }
+ 503 0 }
+ 504
- 515
+ 505
- 516
-
- 517
+ 506
+
+ 507
- 518
-
- 519
-
- 520
+ 508
+
+ 509
- 521
- @Override
+ 510
+ private Proxy getMavenProxy() {
+ 511 0 if (mavenSettings != null ) {
+ 512 0 final List<Proxy> proxies = mavenSettings.getProxies();
+ 513 0 if (proxies != null && proxies.size() > 0) {
+ 514 0 if (mavenSettingsProxyId != null ) {
+ 515 0 for (Proxy proxy : proxies) {
+ 516 0 if (mavenSettingsProxyId.equalsIgnoreCase(proxy.getId())) {
+ 517 0 return proxy;
+ 518
+ }
+ 519 0 }
+ 520 0 } else if (proxies.size() == 1) {
+ 521 0 return proxies.get(0);
522
- protected void performExecute() throws MojoExecutionException, MojoFailureException {
- 523
- try {
- 524 0 engine = executeDependencyCheck();
- 525 0 ReportingUtil.generateExternalReports(engine, outputDirectory, getProject().getName(), format);
- 526 0 if (this .showSummary) {
- 527 0 showSummary(engine.getDependencies());
+ } else {
+ 523 0 LOGGER.warning("Multiple proxy defentiions exist in the Maven settings. In the dependency-check "
+ 524
+ + "configuration set the maveSettingsProxyId so that the correct proxy will be used." );
+ 525 0 throw new IllegalStateException("Ambiguous proxy definition" );
+ 526
+ }
+ 527
+ }
528
- }
- 529 0 if (this .failBuildOnCVSS <= 10) {
- 530 0 checkForFailure(engine.getDependencies());
+ }
+ 529 0 return null ;
+ 530
+ }
531
- }
- 532 0 } catch (DatabaseException ex) {
- 533 0 LOGGER.log(Level.SEVERE,
- 534
- "Unable to connect to the dependency-check database; analysis has stopped" );
- 535 0 LOGGER.log(Level.FINE, "" , ex);
- 536 0 }
- 537 0 }
- 538
+ 532
+
+ 533
+
+ 534
+
+ 535
+
+ 536
+
+ 537
+
+ 538
+
539
@Override
540
- protected void postExecute() throws MojoExecutionException, MojoFailureException {
+ protected void performExecute() throws MojoExecutionException, MojoFailureException {
541
try {
- 542 0 super .postExecute();
- 543
- } finally {
- 544 0 cleanupEngine();
- 545 0 }
- 546 0 }
- 547
-
- 548
- @Override
+ 542 0 engine = executeDependencyCheck();
+ 543 0 ReportingUtil.generateExternalReports(engine, outputDirectory, getProject().getName(), format);
+ 544 0 if (this .showSummary) {
+ 545 0 showSummary(engine.getDependencies());
+ 546
+ }
+ 547 0 if (this .failBuildOnCVSS <= 10) {
+ 548 0 checkForFailure(engine.getDependencies());
549
- protected void postGenerate() throws MavenReportException {
- 550
- try {
- 551 0 super .postGenerate();
- 552
- } finally {
- 553 0 cleanupEngine();
- 554 0 }
- 555 0 }
+ }
+ 550 0 } catch (DatabaseException ex) {
+ 551 0 LOGGER.log(Level.SEVERE, "Unable to connect to the dependency-check database; analysis has stopped" );
+ 552 0 LOGGER.log(Level.FINE, "" , ex);
+ 553 0 }
+ 554 0 }
+ 555
+
556
-
+ @Override
557
-
+ protected void postExecute() throws MojoExecutionException, MojoFailureException {
558
-
- 559
-
- 560
- private void cleanupEngine() {
- 561 0 if (engine != null ) {
- 562 0 engine.cleanup();
- 563 0 engine = null ;
- 564
- }
- 565 0 Settings.cleanup(true );
- 566 0 }
- 567
-
- 568
-
- 569
-
- 570
-
- 571
-
- 572
-
- 573
-
- 574
- @Override
- 575
- protected void executeNonAggregateReport(Locale locale) throws MavenReportException {
- 576
-
- 577 0 final List<Dependency> deps = readDataFile();
- 578 0 if (deps != null ) {
- 579
- try {
- 580 0 engine = initializeEngine();
- 581 0 engine.getDependencies().addAll(deps);
- 582 0 } catch (DatabaseException ex) {
- 583 0 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
- 584
- getProject().getName());
- 585 0 throw new MavenReportException(msg, ex);
- 586 0 }
- 587
- } else {
- 588
- try {
- 589 0 engine = executeDependencyCheck();
- 590 0 } catch (DatabaseException ex) {
- 591 0 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
- 592
- getProject().getName());
- 593 0 throw new MavenReportException(msg, ex);
- 594 0 }
- 595
- }
- 596 0 ReportingUtil.generateExternalReports(engine, getReportOutputDirectory(), getProject().getName(), format);
- 597 0 }
- 598
-
- 599
- @Override
- 600
- protected void executeAggregateReport(MavenProject project, Locale locale) throws MavenReportException {
- 601 0 List<Dependency> deps = readDataFile(project);
- 602 0 if (deps != null ) {
- 603
- try {
- 604 0 engine = initializeEngine();
- 605 0 engine.getDependencies().addAll(deps);
- 606 0 } catch (DatabaseException ex) {
- 607 0 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
- 608
- project.getName());
- 609 0 throw new MavenReportException(msg, ex);
- 610 0 }
- 611
- } else {
- 612
- try {
- 613 0 engine = executeDependencyCheck(project);
- 614 0 } catch (DatabaseException ex) {
- 615 0 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
- 616
- project.getName());
- 617 0 throw new MavenReportException(msg, ex);
- 618 0 }
- 619
- }
- 620 0 for (MavenProject child : getAllChildren(project)) {
- 621 0 deps = readDataFile(child);
- 622 0 if (deps == null ) {
- 623 0 final String msg = String.format("Unable to include information on %s in the dependency-check aggregate report" , child.getName());
- 624 0 LOGGER.severe(msg);
- 625 0 } else {
- 626 0 engine.getDependencies().addAll(deps);
- 627
- }
- 628 0 }
- 629 0 final DependencyBundlingAnalyzer bundler = new DependencyBundlingAnalyzer();
- 630
try {
- 631 0 bundler.analyze(null , engine);
- 632 0 } catch (AnalysisException ex) {
- 633 0 LOGGER.log(Level.WARNING, "An error occured grouping the dependencies; duplicate entries may exist in the report" , ex);
- 634 0 LOGGER.log(Level.FINE, "Bundling Exception" , ex);
- 635 0 }
- 636 0 final File outputDir = getReportOutputDirectory(project);
- 637 0 if (outputDir != null ) {
- 638 0 ReportingUtil.generateExternalReports(engine, outputDir, project.getName(), format);
- 639
- }
- 640 0 }
- 641
+ 559 0 super .postExecute();
+ 560
+ } finally {
+ 561 0 cleanupEngine();
+ 562 0 }
+ 563 0 }
+ 564
- 642
-
- 643
-
- 644
-
- 645
-
- 646
-
- 647
-
- 648
- public String getOutputName() {
- 649 0 if ("HTML" .equalsIgnoreCase(this .format)
- 650
- || "ALL" .equalsIgnoreCase(this .format)) {
- 651 0 return "dependency-check-report" ;
- 652 0 } else if ("XML" .equalsIgnoreCase(this .format)) {
- 653 0 return "dependency-check-report.xml#" ;
- 654 0 } else if ("VULN" .equalsIgnoreCase(this .format)) {
- 655 0 return "dependency-check-vulnerability" ;
- 656
- } else {
- 657 0 LOGGER.log(Level.WARNING, "Unknown report format used during site generation." );
- 658 0 return "dependency-check-report" ;
- 659
- }
- 660
- }
- 661
-
- 662
-
- 663
-
- 664
-
- 665
-
- 666
-
- 667
- public String getCategoryName() {
- 668 0 return MavenReport.CATEGORY_PROJECT_REPORTS;
- 669
- }
- 670
-
- 671
-
- 672
-
- 673
-
- 674
-
- 675
-
- 676
-
- 677
- public String getName(Locale locale) {
- 678 0 return "dependency-check" ;
- 679
- }
- 680
-
- 681
-
- 682
-
- 683
-
- 684
-
- 685
-
- 686
-
- 687
- public String getDescription(Locale locale) {
- 688 0 return "A report providing details on any published "
- 689
- + "vulnerabilities within project dependencies. This report is a best effort but may contain "
- 690
- + "false positives and false negatives." ;
- 691
- }
- 692
-
- 693
-
- 694
-
- 695
-
- 696
-
- 697
-
- 698
- public boolean canGenerateReport() {
- 699 0 if (canGenerateAggregateReport() || (isAggregate() && isMultiModule())) {
- 700 0 return true ;
- 701
- }
- 702 0 if (canGenerateNonAggregateReport()) {
- 703 0 return true ;
- 704
- } else {
- 705
- final String msg;
- 706 0 if (getProject().getArtifacts().size() > 0) {
- 707 0 msg = "No project dependencies exist in the included scope - dependency-check:check is unable to generate a report." ;
- 708
- } else {
- 709 0 msg = "No project dependencies exist - dependency-check:check is unable to generate a report." ;
- 710
- }
- 711 0 LOGGER.warning(msg);
- 712
- }
- 713
-
- 714 0 return false ;
- 715
- }
- 716
-
- 717
-
- 718
-
- 719
-
- 720
-
- 721
-
- 722
+ 565
@Override
- 723
- protected boolean canGenerateNonAggregateReport() {
- 724 0 boolean ability = false ;
- 725 0 for (Artifact a : getProject().getArtifacts()) {
- 726 0 if (!excludeFromScan(a)) {
- 727 0 ability = true ;
- 728 0 break ;
- 729
+ 566
+ protected void postGenerate() throws MavenReportException {
+ 567
+ try {
+ 568 0 super .postGenerate();
+ 569
+ } finally {
+ 570 0 cleanupEngine();
+ 571 0 }
+ 572 0 }
+ 573
+
+ 574
+
+ 575
+
+ 576
+
+ 577
+ private void cleanupEngine() {
+ 578 0 if (engine != null ) {
+ 579 0 engine.cleanup();
+ 580 0 engine = null ;
+ 581
+ }
+ 582 0 Settings.cleanup(true );
+ 583 0 }
+ 584
+
+ 585
+
+ 586
+
+ 587
+
+ 588
+
+ 589
+
+ 590
+
+ 591
+ @Override
+ 592
+ protected void executeNonAggregateReport(Locale locale) throws MavenReportException {
+ 593
+
+ 594 0 final List<Dependency> deps = readDataFile();
+ 595 0 if (deps != null ) {
+ 596
+ try {
+ 597 0 engine = initializeEngine();
+ 598 0 engine.getDependencies().addAll(deps);
+ 599 0 } catch (DatabaseException ex) {
+ 600 0 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
+ 601
+ getProject().getName());
+ 602 0 throw new MavenReportException(msg, ex);
+ 603 0 }
+ 604
+ } else {
+ 605
+ try {
+ 606 0 engine = executeDependencyCheck();
+ 607 0 } catch (DatabaseException ex) {
+ 608 0 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
+ 609
+ getProject().getName());
+ 610 0 throw new MavenReportException(msg, ex);
+ 611 0 }
+ 612
+ }
+ 613 0 ReportingUtil.generateExternalReports(engine, getReportOutputDirectory(), getProject().getName(), format);
+ 614 0 }
+ 615
+
+ 616
+ @Override
+ 617
+ protected void executeAggregateReport(MavenProject project, Locale locale) throws MavenReportException {
+ 618 0 List<Dependency> deps = readDataFile(project);
+ 619 0 if (deps != null ) {
+ 620
+ try {
+ 621 0 engine = initializeEngine();
+ 622 0 engine.getDependencies().addAll(deps);
+ 623 0 } catch (DatabaseException ex) {
+ 624 0 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
+ 625
+ project.getName());
+ 626 0 throw new MavenReportException(msg, ex);
+ 627 0 }
+ 628
+ } else {
+ 629
+ try {
+ 630 0 engine = executeDependencyCheck(project);
+ 631 0 } catch (DatabaseException ex) {
+ 632 0 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
+ 633
+ project.getName());
+ 634 0 throw new MavenReportException(msg, ex);
+ 635 0 }
+ 636
+ }
+ 637 0 for (MavenProject child : getAllChildren(project)) {
+ 638 0 deps = readDataFile(child);
+ 639 0 if (deps == null ) {
+ 640 0 final String msg = String.format("Unable to include information on %s in the dependency-check aggregate report" ,
+ 641
+ child.getName());
+ 642 0 LOGGER.severe(msg);
+ 643 0 } else {
+ 644 0 engine.getDependencies().addAll(deps);
+ 645
}
- 730 0 }
- 731 0 return ability;
+ 646 0 }
+ 647 0 final DependencyBundlingAnalyzer bundler = new DependencyBundlingAnalyzer();
+ 648
+ try {
+ 649 0 bundler.analyze(null , engine);
+ 650 0 } catch (AnalysisException ex) {
+ 651 0 LOGGER.log(Level.WARNING, "An error occured grouping the dependencies; duplicate entries may exist in the report" , ex);
+ 652 0 LOGGER.log(Level.FINE, "Bundling Exception" , ex);
+ 653 0 }
+ 654 0 final File outputDir = getReportOutputDirectory(project);
+ 655 0 if (outputDir != null ) {
+ 656 0 ReportingUtil.generateExternalReports(engine, outputDir, project.getName(), format);
+ 657
+ }
+ 658 0 }
+ 659
+
+ 660
+
+ 661
+
+ 662
+
+ 663
+
+ 664
+
+ 665
+
+ 666
+ public String getOutputName() {
+ 667 0 if ("HTML" .equalsIgnoreCase(this .format) || "ALL" .equalsIgnoreCase(this .format)) {
+ 668 0 return "dependency-check-report" ;
+ 669 0 } else if ("XML" .equalsIgnoreCase(this .format)) {
+ 670 0 return "dependency-check-report.xml#" ;
+ 671 0 } else if ("VULN" .equalsIgnoreCase(this .format)) {
+ 672 0 return "dependency-check-vulnerability" ;
+ 673
+ } else {
+ 674 0 LOGGER.log(Level.WARNING, "Unknown report format used during site generation." );
+ 675 0 return "dependency-check-report" ;
+ 676
+ }
+ 677
+ }
+ 678
+
+ 679
+
+ 680
+
+ 681
+
+ 682
+
+ 683
+
+ 684
+ public String getCategoryName() {
+ 685 0 return MavenReport.CATEGORY_PROJECT_REPORTS;
+ 686
+ }
+ 687
+
+ 688
+
+ 689
+
+ 690
+
+ 691
+
+ 692
+
+ 693
+
+ 694
+ public String getName(Locale locale) {
+ 695 0 return "dependency-check" ;
+ 696
+ }
+ 697
+
+ 698
+
+ 699
+
+ 700
+
+ 701
+
+ 702
+
+ 703
+
+ 704
+ public String getDescription(Locale locale) {
+ 705 0 return "A report providing details on any published "
+ 706
+ + "vulnerabilities within project dependencies. This report is a best effort but may contain "
+ 707
+ + "false positives and false negatives." ;
+ 708
+ }
+ 709
+
+ 710
+
+ 711
+
+ 712
+
+ 713
+
+ 714
+
+ 715
+ public boolean canGenerateReport() {
+ 716 0 if (canGenerateAggregateReport() || (isAggregate() && isMultiModule())) {
+ 717 0 return true ;
+ 718
+ }
+ 719 0 if (canGenerateNonAggregateReport()) {
+ 720 0 return true ;
+ 721
+ } else {
+ 722
+ final String msg;
+ 723 0 if (getProject().getArtifacts().size() > 0) {
+ 724 0 msg = "No project dependencies exist in the included scope - dependency-check:check is unable to generate a report." ;
+ 725
+ } else {
+ 726 0 msg = "No project dependencies exist - dependency-check:check is unable to generate a report." ;
+ 727
+ }
+ 728 0 LOGGER.warning(msg);
+ 729
+ }
+ 730
+
+ 731 0 return false ;
732
}
733
@@ -1264,291 +1262,316 @@
734
735
-
+
736
737
-
+
738
739
@Override
740
- protected boolean canGenerateAggregateReport() {
- 741 0 return isAggregate() && isLastProject();
- 742
- }
- 743
-
- 744
-
- 745
-
+ protected boolean canGenerateNonAggregateReport() {
+ 741 0 boolean ability = false ;
+ 742 0 for (Artifact a : getProject().getArtifacts()) {
+ 743 0 if (!excludeFromScan(a)) {
+ 744 0 ability = true ;
+ 745 0 break ;
746
-
- 747
-
- 748
-
+ }
+ 747 0 }
+ 748 0 return ability;
749
-
+ }
750
-
+
751
-
+
752
-
+
753
- private void checkForFailure(List<Dependency> dependencies) throws MojoFailureException {
- 754 0 final StringBuilder ids = new StringBuilder();
- 755 0 for (Dependency d : dependencies) {
- 756 0 boolean addName = true ;
- 757 0 for (Vulnerability v : d.getVulnerabilities()) {
- 758 0 if (v.getCvssScore() >= failBuildOnCVSS) {
- 759 0 if (addName) {
- 760 0 addName = false ;
- 761 0 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
- 762 0 ids.append(v.getName());
- 763
- } else {
- 764 0 ids.append(", " ).append(v.getName());
- 765
- }
- 766
- }
- 767 0 }
- 768 0 }
- 769 0 if (ids.length() > 0) {
- 770 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
- 771
- + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
- 772
- + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
- 773 0 throw new MojoFailureException(msg);
- 774
- }
- 775 0 }
- 776
-
- 777
-
- 778
-
- 779
- 780
-
- 781
+ 754
+
+ 755
- 782
- private void showSummary(List<Dependency> dependencies) {
- 783 0 final StringBuilder summary = new StringBuilder();
- 784 0 for (Dependency d : dependencies) {
- 785 0 boolean firstEntry = true ;
- 786 0 final StringBuilder ids = new StringBuilder();
- 787 0 for (Vulnerability v : d.getVulnerabilities()) {
- 788 0 if (firstEntry) {
- 789 0 firstEntry = false ;
- 790
- } else {
- 791 0 ids.append(", " );
- 792
- }
- 793 0 ids.append(v.getName());
- 794 0 }
- 795 0 if (ids.length() > 0) {
- 796 0 summary.append(d.getFileName()).append(" (" );
- 797 0 firstEntry = true ;
- 798 0 for (Identifier id : d.getIdentifiers()) {
- 799 0 if (firstEntry) {
- 800 0 firstEntry = false ;
- 801
- } else {
- 802 0 summary.append(", " );
- 803
- }
- 804 0 summary.append(id.getValue());
- 805 0 }
- 806 0 summary.append(") : " ).append(ids).append(NEW_LINE);
- 807
- }
- 808 0 }
- 809 0 if (summary.length() > 0) {
- 810 0 final String msg = String.format("%n%n"
- 811
- + "One or more dependencies were identified with known vulnerabilities:%n%n%s"
- 812
- + "%n%nSee the dependency-check report for more details.%n%n" , summary.toString());
- 813 0 LOGGER.log(Level.WARNING, msg);
- 814
- }
- 815 0 }
- 816
-
- 817
-
- 818
-
- 819
-
- 820
-
- 821
-
- 822
-
- 823
-
- 824
+ 756
@Override
- 825
- protected File writeDataFile() {
- 826 0 File file = null ;
- 827 0 if (engine != null && getProject().getContextValue(this .getDataFileContextKey()) == null ) {
- 828 0 file = new File(getProject().getBuild().getDirectory(), getDataFileName());
- 829 0 OutputStream os = null ;
- 830 0 OutputStream bos = null ;
- 831 0 ObjectOutputStream out = null ;
+ 757
+ protected boolean canGenerateAggregateReport() {
+ 758 0 return isAggregate() && isLastProject();
+ 759
+ }
+ 760
+
+ 761
+
+ 762
+
+ 763
+
+ 764
+
+ 765
+
+ 766
+
+ 767
+
+ 768
+
+ 769
+
+ 770
+ private void checkForFailure(List<Dependency> dependencies) throws MojoFailureException {
+ 771 0 final StringBuilder ids = new StringBuilder();
+ 772 0 for (Dependency d : dependencies) {
+ 773 0 boolean addName = true ;
+ 774 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 775 0 if (v.getCvssScore() >= failBuildOnCVSS) {
+ 776 0 if (addName) {
+ 777 0 addName = false ;
+ 778 0 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
+ 779 0 ids.append(v.getName());
+ 780
+ } else {
+ 781 0 ids.append(", " ).append(v.getName());
+ 782
+ }
+ 783
+ }
+ 784 0 }
+ 785 0 }
+ 786 0 if (ids.length() > 0) {
+ 787 0 final String msg = String.format("%n%nDependency-Check Failure:%n"
+ 788
+ + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
+ 789
+ + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
+ 790 0 throw new MojoFailureException(msg);
+ 791
+ }
+ 792 0 }
+ 793
+
+ 794
+
+ 795
+
+ 796
+
+ 797
+
+ 798
+
+ 799
+ private void showSummary(List<Dependency> dependencies) {
+ 800 0 final StringBuilder summary = new StringBuilder();
+ 801 0 for (Dependency d : dependencies) {
+ 802 0 boolean firstEntry = true ;
+ 803 0 final StringBuilder ids = new StringBuilder();
+ 804 0 for (Vulnerability v : d.getVulnerabilities()) {
+ 805 0 if (firstEntry) {
+ 806 0 firstEntry = false ;
+ 807
+ } else {
+ 808 0 ids.append(", " );
+ 809
+ }
+ 810 0 ids.append(v.getName());
+ 811 0 }
+ 812 0 if (ids.length() > 0) {
+ 813 0 summary.append(d.getFileName()).append(" (" );
+ 814 0 firstEntry = true ;
+ 815 0 for (Identifier id : d.getIdentifiers()) {
+ 816 0 if (firstEntry) {
+ 817 0 firstEntry = false ;
+ 818
+ } else {
+ 819 0 summary.append(", " );
+ 820
+ }
+ 821 0 summary.append(id.getValue());
+ 822 0 }
+ 823 0 summary.append(") : " ).append(ids).append(NEW_LINE);
+ 824
+ }
+ 825 0 }
+ 826 0 if (summary.length() > 0) {
+ 827 0 final String msg = String.format("%n%n" + "One or more dependencies were identified with known vulnerabilities:%n%n%s"
+ 828
+ + "%n%nSee the dependency-check report for more details.%n%n" , summary.toString());
+ 829 0 LOGGER.log(Level.WARNING, msg);
+ 830
+ }
+ 831 0 }
832
- try {
- 833 0 os = new FileOutputStream(file);
- 834 0 bos = new BufferedOutputStream(os);
- 835 0 out = new ObjectOutputStream(bos);
- 836 0 out.writeObject(engine.getDependencies());
- 837 0 out.flush();
- 838
- 839
-
- 840
-
- 841 0 out.reset();
- 842
-
- 843 0 } catch (IOException ex) {
- 844 0 LOGGER.log(Level.WARNING, "Unable to create data file used for report aggregation; "
- 845
- + "if report aggregation is being used the results may be incomplete." );
- 846 0 LOGGER.log(Level.FINE, ex.getMessage(), ex);
- 847
- } finally {
- 848 0 if (out != null ) {
- 849
- try {
- 850 0 out.close();
- 851 0 } catch (IOException ex) {
- 852 0 LOGGER.log(Level.FINEST, "ignore" , ex);
- 853 0 }
- 854
- }
- 855 0 if (bos != null ) {
- 856
- try {
- 857 0 bos.close();
- 858 0 } catch (IOException ex) {
- 859 0 LOGGER.log(Level.FINEST, "ignore" , ex);
- 860 0 }
- 861
- }
- 862 0 if (os != null ) {
- 863
- try {
- 864 0 os.close();
- 865 0 } catch (IOException ex) {
- 866 0 LOGGER.log(Level.FINEST, "ignore" , ex);
- 867 0 }
- 868
- }
- 869
- }
- 870
- }
- 871 0 return file;
- 872
- }
- 873
-
- 874
-
- 875
-
- 876
-
- 877
-
- 878
-
- 879
-
- 880
-
- 881
- protected List<Dependency> readDataFile() {
- 882 0 return readDataFile(getProject());
- 883
- }
- 884
-
- 885
-
- 886
-
- 887
-
- 888
-
- 889
-
- 890
-
- 891
-
- 892
-
- 893
- protected List<Dependency> readDataFile(MavenProject project) {
- 894 0 final Object oPath = project.getContextValue(this .getDataFileContextKey());
- 895 0 if (oPath == null ) {
- 896 0 return null ;
- 897
- }
- 898 0 List<Dependency> ret = null ;
- 899 0 final String path = (String) oPath;
- 900 0 ObjectInputStream ois = null ;
- 901
- try {
- 902 0 ois = new ObjectInputStream(new FileInputStream(path));
- 903 0 ret = (List<Dependency>) ois.readObject();
- 904 0 } catch (FileNotFoundException ex) {
- 905
-
- 906 0 LOGGER.log(Level.SEVERE, null , ex);
- 907 0 } catch (IOException ex) {
- 908 0 LOGGER.log(Level.SEVERE, null , ex);
- 909 0 } catch (ClassNotFoundException ex) {
- 910 0 LOGGER.log(Level.SEVERE, null , ex);
- 911
- } finally {
- 912 0 if (ois != null ) {
- 913
- try {
- 914 0 ois.close();
- 915 0 } catch (IOException ex) {
- 916 0 LOGGER.log(Level.SEVERE, null , ex);
- 917 0 }
- 918
- }
- 919
- }
- 920 0 return ret;
- 921
- }
- 922
+ 833
- 923
+ 834
+
+ 835
+
+ 836
+
+ 837
+
+ 838
+
+ 839
+
+ 840
+ @Override
+ 841
+ protected File writeDataFile() {
+ 842 0 File file = null ;
+ 843 0 if (engine != null && getProject().getContextValue(this .getDataFileContextKey()) == null ) {
+ 844 0 file = new File(getProject().getBuild().getDirectory(), getDataFileName());
+ 845 0 OutputStream os = null ;
+ 846 0 OutputStream bos = null ;
+ 847 0 ObjectOutputStream out = null ;
+ 848
+ try {
+ 849 0 os = new FileOutputStream(file);
+ 850 0 bos = new BufferedOutputStream(os);
+ 851 0 out = new ObjectOutputStream(bos);
+ 852 0 out.writeObject(engine.getDependencies());
+ 853 0 out.flush();
+ 854
+
+ 855
+
+ 856
+
+ 857 0 out.reset();
+ 858
+
+ 859 0 } catch (IOException ex) {
+ 860 0 LOGGER.log(Level.WARNING, "Unable to create data file used for report aggregation; "
+ 861
+ + "if report aggregation is being used the results may be incomplete." );
+ 862 0 LOGGER.log(Level.FINE, ex.getMessage(), ex);
+ 863
+ } finally {
+ 864 0 if (out != null ) {
+ 865
+ try {
+ 866 0 out.close();
+ 867 0 } catch (IOException ex) {
+ 868 0 LOGGER.log(Level.FINEST, "ignore" , ex);
+ 869 0 }
+ 870
+ }
+ 871 0 if (bos != null ) {
+ 872
+ try {
+ 873 0 bos.close();
+ 874 0 } catch (IOException ex) {
+ 875 0 LOGGER.log(Level.FINEST, "ignore" , ex);
+ 876 0 }
+ 877
+ }
+ 878 0 if (os != null ) {
+ 879
+ try {
+ 880 0 os.close();
+ 881 0 } catch (IOException ex) {
+ 882 0 LOGGER.log(Level.FINEST, "ignore" , ex);
+ 883 0 }
+ 884
+ }
+ 885
+ }
+ 886
+ }
+ 887 0 return file;
+ 888
+ }
+ 889
+
+ 890
+
+ 891
+
+ 892
+
+ 893
+
+ 894
+
+ 895
+
+ 896
+
+ 897
+ protected List<Dependency> readDataFile() {
+ 898 0 return readDataFile(getProject());
+ 899
+ }
+ 900
+
+ 901
+
+ 902
+
+ 903
+
+ 904
+
+ 905
+
+ 906
+
+ 907
+
+ 908
+
+ 909
+ protected List<Dependency> readDataFile(MavenProject project) {
+ 910 0 final Object oPath = project.getContextValue(this .getDataFileContextKey());
+ 911 0 if (oPath == null ) {
+ 912 0 return null ;
+ 913
+ }
+ 914 0 List<Dependency> ret = null ;
+ 915 0 final String path = (String) oPath;
+ 916 0 ObjectInputStream ois = null ;
+ 917
+ try {
+ 918 0 ois = new ObjectInputStream(new FileInputStream(path));
+ 919 0 ret = (List<Dependency>) ois.readObject();
+ 920 0 } catch (FileNotFoundException ex) {
+ 921
+
+ 922 0 LOGGER.log(Level.SEVERE, null , ex);
+ 923 0 } catch (IOException ex) {
+ 924 0 LOGGER.log(Level.SEVERE, null , ex);
+ 925 0 } catch (ClassNotFoundException ex) {
+ 926 0 LOGGER.log(Level.SEVERE, null , ex);
+ 927
+ } finally {
+ 928 0 if (ois != null ) {
+ 929
+ try {
+ 930 0 ois.close();
+ 931 0 } catch (IOException ex) {
+ 932 0 LOGGER.log(Level.SEVERE, null , ex);
+ 933 0 }
+ 934
+ }
+ 935
+ }
+ 936 0 return ret;
+ 937
+ }
+ 938
+
+ 939
}
-
+
diff --git a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html
index 9157f91ac..78553f0ed 100644
--- a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html
+++ b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.HelpMojo.html
@@ -744,6 +744,6 @@
}
-
+
diff --git a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportAggregationMojo.html b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportAggregationMojo.html
index 4c000f950..22cc81e13 100644
--- a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportAggregationMojo.html
+++ b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportAggregationMojo.html
@@ -856,6 +856,6 @@
}
-
+
diff --git a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportingUtil.html b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportingUtil.html
index 4457a7bf1..1a8353a86 100644
--- a/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportingUtil.html
+++ b/dependency-check-maven/cobertura/org.owasp.dependencycheck.maven.ReportingUtil.html
@@ -678,6 +678,6 @@
}
-
+
diff --git a/dependency-check-maven/configuration.html b/dependency-check-maven/configuration.html
index 9f9387182..7efa58497 100644
--- a/dependency-check-maven/configuration.html
+++ b/dependency-check-maven/configuration.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Configuration
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -317,9 +317,9 @@
nexusUrl
-Defines the Nexus URL.
+Defines the Nexus Pro Server URL. If not set the Nexus Analyzer will be disabled.
-https://repository.sonatype.org/service/local/
+
@@ -353,7 +353,7 @@
pathToMono
-The path to Mono for .NET assembly analysis on non-windows systems
+The path to Mono for .NET assembly analysis on non-windows systems.
diff --git a/dependency-check-maven/dependency-updates-report.html b/dependency-check-maven/dependency-updates-report.html
index 05fa851cd..358482bba 100644
--- a/dependency-check-maven/dependency-updates-report.html
+++ b/dependency-check-maven/dependency-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Dependency Updates Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -380,7 +380,7 @@
org.owasp
dependency-check-core
-1.2.5
+1.2.6
compile
jar
@@ -392,7 +392,7 @@
org.owasp
dependency-check-utils
-1.2.5
+1.2.6
compile
jar
@@ -441,7 +441,7 @@
jar
Newer versions
-4.12-beta-1 Next Incremental
+4.12-beta-1 Next Incremental 4.12-beta-24.12-beta-3 Latest Incremental
org.apache.maven:maven-core
@@ -642,7 +642,7 @@
dependency-check-core
Current Version
-1.2.5
+1.2.6
Scope
compile
@@ -666,7 +666,7 @@
dependency-check-utils
Current Version
-1.2.5
+1.2.6
Scope
compile
diff --git a/dependency-check-maven/findbugs.html b/dependency-check-maven/findbugs.html
index 0ed23e954..4529eb52c 100644
--- a/dependency-check-maven/findbugs.html
+++ b/dependency-check-maven/findbugs.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - FindBugs Bug Detector Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-maven/help-mojo.html b/dependency-check-maven/help-mojo.html
index d8ff713f5..93441b9b7 100644
--- a/dependency-check-maven/help-mojo.html
+++ b/dependency-check-maven/help-mojo.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven -
dependency-check:help
@@ -55,7 +55,7 @@
-
+
/
@@ -69,9 +69,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -163,7 +163,7 @@
Full name :
-org.owasp:dependency-check-maven:1.2.5:help
+org.owasp:dependency-check-maven:1.2.6:help
Description :
diff --git a/dependency-check-maven/index.html b/dependency-check-maven/index.html
index bcc5b13e8..4212dc661 100644
--- a/dependency-check-maven/index.html
+++ b/dependency-check-maven/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - About
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-maven/license.html b/dependency-check-maven/license.html
index 5ce846900..3dc943327 100644
--- a/dependency-check-maven/license.html
+++ b/dependency-check-maven/license.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Project License
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-maven/plugin-info.html b/dependency-check-maven/plugin-info.html
index 265bd544e..947dd9bbe 100644
--- a/dependency-check-maven/plugin-info.html
+++ b/dependency-check-maven/plugin-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Plugin Documentation
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -286,7 +286,7 @@ Call mvn dependency-check:help -Ddetail=true
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
</plugin>
...
</plugins>
@@ -296,7 +296,7 @@ Call mvn dependency-check:help -Ddetail=true
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
</plugin>
...
</plugins>
@@ -308,7 +308,7 @@ Call mvn dependency-check:help -Ddetail=true
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
</plugin>
...
</plugins>
diff --git a/dependency-check-maven/plugin-updates-report.html b/dependency-check-maven/plugin-updates-report.html
index e07af35c7..7f6781049 100644
--- a/dependency-check-maven/plugin-updates-report.html
+++ b/dependency-check-maven/plugin-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Plugin Updates Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -245,7 +245,7 @@
# of plugins using the latest version available
-3
+0
# of plugins where the next version available is smaller than an incremental version update
@@ -257,7 +257,7 @@
# of plugins where the next version available is a minor version update
-10
+13
# of plugins where the next version available is a major version update
@@ -343,13 +343,13 @@
Next Major
Dependency status
-
+
com.github.github
site-maven-plugin
-0.9
-
+0.9
+0.10
@@ -363,13 +363,13 @@
-
+
org.apache.maven.plugins
maven-compiler-plugin
-3.1
-
+3.1
+3.2
@@ -413,13 +413,13 @@
-
+
org.apache.maven.plugins
maven-plugin-plugin
-3.2
-
+3.2
+3.3
@@ -470,7 +470,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
com.github.github
@@ -479,7 +479,10 @@
site-maven-plugin
Current Version
-0.9
+0.9
+
+Newer versions
+0.10 Next Minor
Plugin org.apache.maven.plugins:maven-antrun-plugin
@@ -515,7 +518,7 @@
2.2-beta-5
Newer versions
-2.2 Next Version 2.2.1 Next Incremental 2.2.2 Latest Incremental 2.3 Next Minor 2.4 Latest Minor
+2.2 Next Version 2.2.1 Next Incremental 2.2.2 Latest Incremental 2.3 Next Minor 2.4 2.4.1 2.52.5.1 Latest Minor
Plugin org.apache.maven.plugins:maven-clean-plugin
@@ -533,13 +536,13 @@
2.4.1
Newer versions
-2.5 Next Minor
+2.5 Next Minor 2.62.6.1 Latest Minor
Plugin org.apache.maven.plugins:maven-compiler-plugin
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -548,7 +551,10 @@
maven-compiler-plugin
Current Version
-3.1
+3.1
+
+Newer versions
+3.2 Next Minor
Plugin org.apache.maven.plugins:maven-dependency-plugin
@@ -566,7 +572,7 @@
2.1
Newer versions
-2.2 Next Minor 2.3 2.4 2.5 2.5.1 2.6 2.72.8 Latest Minor
+2.2 Next Minor 2.3 2.4 2.5 2.5.1 2.6 2.7 2.82.9 Latest Minor
Plugin org.apache.maven.plugins:maven-deploy-plugin
@@ -584,7 +590,7 @@
2.7
Newer versions
-2.8 Next Minor 2.8.1 Latest Minor
+2.8 Next Minor 2.8.12.8.2 Latest Minor
Plugin org.apache.maven.plugins:maven-enforcer-plugin
@@ -620,7 +626,7 @@
2.3.1
Newer versions
-2.4 Next Minor 2.52.5.1 Latest Minor
+2.4 Next Minor 2.5 2.5.12.5.2 Latest Minor
Plugin org.apache.maven.plugins:maven-jar-plugin
@@ -638,13 +644,13 @@
2.3.1
Newer versions
-2.3.2 Next Incremental 2.4 Next Minor
+2.3.2 Next Incremental 2.4 Next Minor 2.5 Latest Minor
Plugin org.apache.maven.plugins:maven-plugin-plugin
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -653,7 +659,10 @@
maven-plugin-plugin
Current Version
-3.2
+3.2
+
+Newer versions
+3.3 Next Minor
Plugin org.apache.maven.plugins:maven-release-plugin
@@ -671,7 +680,7 @@
2.0
Newer versions
-2.1 Next Minor 2.2 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.12.4.2 Latest Minor
+2.1 Next Minor 2.2 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.52.5.1 Latest Minor
Plugin org.apache.maven.plugins:maven-resources-plugin
@@ -689,7 +698,7 @@
2.5
Newer versions
-2.6 Next Minor
+2.6 Next Minor 2.7 Latest Minor
Plugin org.apache.maven.plugins:maven-site-plugin
@@ -785,7 +794,7 @@
2.10
Newer versions
-2.11 Next Minor 2.12 2.12.1 2.12.2 2.12.3 2.12.4 2.13 2.14 2.14.1 2.152.16 Latest Minor
+2.11 Next Minor 2.12 2.12.1 2.12.2 2.12.3 2.12.4 2.13 2.14 2.14.1 2.15 2.16 2.172.18 Latest Minor
diff --git a/dependency-check-maven/pmd.html b/dependency-check-maven/pmd.html
index 1f521b45a..db6494f46 100644
--- a/dependency-check-maven/pmd.html
+++ b/dependency-check-maven/pmd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - PMD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -251,7 +251,7 @@
Line
Useless parentheses.
-699
+716
diff --git a/dependency-check-maven/project-info.html b/dependency-check-maven/project-info.html
index 6114a72f8..79e7e1bc2 100644
--- a/dependency-check-maven/project-info.html
+++ b/dependency-check-maven/project-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Project Information
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-maven/project-reports.html b/dependency-check-maven/project-reports.html
index d80c8be37..63b2ec0c6 100644
--- a/dependency-check-maven/project-reports.html
+++ b/dependency-check-maven/project-reports.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Generated Reports
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-maven/project-summary.html b/dependency-check-maven/project-summary.html
index 5ce4bd91e..9f8aee55d 100644
--- a/dependency-check-maven/project-summary.html
+++ b/dependency-check-maven/project-summary.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Project Summary
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -218,7 +218,7 @@
dependency-check-maven
Version
-1.2.5
+1.2.6
Type
maven-plugin
diff --git a/dependency-check-maven/surefire-report.html b/dependency-check-maven/surefire-report.html
index c228f509b..29e9d7dbf 100644
--- a/dependency-check-maven/surefire-report.html
+++ b/dependency-check-maven/surefire-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Surefire Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -274,7 +274,7 @@ function toggleDisplay(elementId) {
0
0
100%
-0.164
+0.077
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
Package List
@@ -295,7 +295,7 @@ function toggleDisplay(elementId) {
0
0
100%
-
0.164
+
0.077
Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
org.owasp.dependencycheck.maven
@@ -317,7 +317,7 @@ function toggleDisplay(elementId) {
0
0
100%
-
0.164
+0.077
Test Cases
[Summary ] [Package List ] [Test Cases ]
@@ -327,7 +327,7 @@ function toggleDisplay(elementId) {
testGenerate_Sink_SinkFactory_Locale
-0.006
+0.002
diff --git a/dependency-check-maven/taglist.html b/dependency-check-maven/taglist.html
index a4f48cec9..25c1585c3 100644
--- a/dependency-check-maven/taglist.html
+++ b/dependency-check-maven/taglist.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Tag List report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -260,7 +260,7 @@
Line
fix logging
-905
+921
org.owasp.dependencycheck.maven.DependencyCheckMojoTest
Line
diff --git a/dependency-check-maven/usage.html b/dependency-check-maven/usage.html
index f4f0b037c..38e0ec940 100644
--- a/dependency-check-maven/usage.html
+++ b/dependency-check-maven/usage.html
@@ -1,13 +1,13 @@
-
+
dependency-check-maven - Usage
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -171,7 +171,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
<executions>
<execution>
<goals>
@@ -202,7 +202,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
<configuration>
<aggregate>true</aggregate>
</configuration>
@@ -236,7 +236,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
<configuration>
<failBuildOnCVSS>8</failBuildOnCVSS>
</configuration>
@@ -269,7 +269,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
<configuration>
<skipProvidedScope>true</skipProvidedScope>
<skipRuntimeScope>true</skipRuntimeScope>
@@ -303,7 +303,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
- <version>1.2.5</version>
+ <version>1.2.6</version>
<configuration>
<cveUrl12Modified>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-modified.xml</cveUrl12Modified>
<cveUrl20Modified>http://internal-mirror.mycorp.com/downloads/nist/nvdcve-2.0-modified.xml</cveUrl20Modified>
diff --git a/dependency-check-maven/xref-test/index.html b/dependency-check-maven/xref-test/index.html
index ac4632c06..f3ceb7a7f 100644
--- a/dependency-check-maven/xref-test/index.html
+++ b/dependency-check-maven/xref-test/index.html
@@ -4,7 +4,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
diff --git a/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-frame.html b/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-frame.html
index 1ca4ba145..b2c488dfb 100644
--- a/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-frame.html
+++ b/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference Package org.owasp.dependencycheck.maven
+ Dependency-Check Maven Plugin 1.2.6 Reference Package org.owasp.dependencycheck.maven
diff --git a/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-summary.html b/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-summary.html
index 053b34b67..fabf13cd7 100644
--- a/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-summary.html
+++ b/dependency-check-maven/xref-test/org/owasp/dependencycheck/maven/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference Package org.owasp.dependencycheck.maven
+ Dependency-Check Maven Plugin 1.2.6 Reference Package org.owasp.dependencycheck.maven
diff --git a/dependency-check-maven/xref-test/overview-frame.html b/dependency-check-maven/xref-test/overview-frame.html
index 1dcb2eb31..4708992a8 100644
--- a/dependency-check-maven/xref-test/overview-frame.html
+++ b/dependency-check-maven/xref-test/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
diff --git a/dependency-check-maven/xref-test/overview-summary.html b/dependency-check-maven/xref-test/overview-summary.html
index cfa7a5fe6..6ccf78671 100644
--- a/dependency-check-maven/xref-test/overview-summary.html
+++ b/dependency-check-maven/xref-test/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
diff --git a/dependency-check-maven/xref/index.html b/dependency-check-maven/xref/index.html
index ac4632c06..f3ceb7a7f 100644
--- a/dependency-check-maven/xref/index.html
+++ b/dependency-check-maven/xref/index.html
@@ -4,7 +4,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
diff --git a/dependency-check-maven/xref/org/owasp/dependencycheck/maven/DependencyCheckMojo.html b/dependency-check-maven/xref/org/owasp/dependencycheck/maven/DependencyCheckMojo.html
index 6a6944612..110bfea1d 100644
--- a/dependency-check-maven/xref/org/owasp/dependencycheck/maven/DependencyCheckMojo.html
+++ b/dependency-check-maven/xref/org/owasp/dependencycheck/maven/DependencyCheckMojo.html
@@ -54,881 +54,897 @@
46 import org.owasp.dependencycheck.Engine;
47 import org.owasp.dependencycheck.analyzer.DependencyBundlingAnalyzer;
48 import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
-49 import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
-50 import org.owasp.dependencycheck.dependency.Dependency;
-51 import org.owasp.dependencycheck.dependency.Identifier;
-52 import org.owasp.dependencycheck.dependency.Vulnerability;
-53 import org.owasp.dependencycheck.utils.LogUtils;
-54 import org.owasp.dependencycheck.utils.Settings;
-55
-56
-57
-58
-59
-60
-61 @Mojo(name = "check" , defaultPhase = LifecyclePhase.COMPILE, threadSafe = true ,
-62 requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM,
-63 requiresOnline = true )
-64 public class DependencyCheckMojo extends ReportAggregationMojo {
-65
-66
-67
-68
-69
-70 private static final Logger LOGGER = Logger.getLogger(DependencyCheckMojo.class .getName());
-71
-72
-73
-74 private static final String PROPERTIES_FILE = "mojo.properties" ;
-75
-76
-77
-78 private static final String LOG_PROPERTIES_FILE = "log.properties" ;
-79
-80
-81
-82 private static final String NEW_LINE = System.getProperty("line.separator" , "\n" ).intern();
-83
-84
-85
-86 private Engine engine = null ;
-87
-88
-89
-90
-91
-92
-93 @Parameter(property = "logfile" , defaultValue = "" )
-94 private String logFile = null ;
-95
-96
-97
-98 @Parameter(defaultValue = "${project.build.directory}" , required = true )
-99 private File outputDirectory;
-100
-101
-102
+49 import org.owasp.dependencycheck.data.nexus.MavenArtifact;
+50 import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
+51 import org.owasp.dependencycheck.dependency.Confidence;
+52 import org.owasp.dependencycheck.dependency.Dependency;
+53 import org.owasp.dependencycheck.dependency.Identifier;
+54 import org.owasp.dependencycheck.dependency.Vulnerability;
+55 import org.owasp.dependencycheck.utils.LogUtils;
+56 import org.owasp.dependencycheck.utils.Settings;
+57
+58
+59
+60
+61
+62
+63 @Mojo(
+64 name = "check" ,
+65 defaultPhase = LifecyclePhase.COMPILE,
+66 threadSafe = true ,
+67 requiresDependencyResolution = ResolutionScope.RUNTIME_PLUS_SYSTEM,
+68 requiresOnline = true
+69 )
+70 public class DependencyCheckMojo extends ReportAggregationMojo {
+71
+72
+73
+74
+75
+76 private static final Logger LOGGER = Logger.getLogger(DependencyCheckMojo.class .getName());
+77
+78
+79
+80 private static final String PROPERTIES_FILE = "mojo.properties" ;
+81
+82
+83
+84 private static final String LOG_PROPERTIES_FILE = "log.properties" ;
+85
+86
+87
+88 private static final String NEW_LINE = System.getProperty("line.separator" , "\n" ).intern();
+89
+90
+91
+92 private Engine engine = null ;
+93
+94
+95
+96
+97
+98
+99 @Parameter(property = "logfile" , defaultValue = "" )
+100 private String logFile = null ;
+101
+102
103
-104 @SuppressWarnings("CanBeFinal" )
-105 @Parameter(property = "failBuildOnCVSS" , defaultValue = "11" , required = true )
-106 private float failBuildOnCVSS = 11;
-107
-108
-109
-110
-111 @SuppressWarnings("CanBeFinal" )
-112 @Parameter(property = "autoupdate" , defaultValue = "true" , required = true )
-113 private boolean autoUpdate = true ;
-114
-115
-116
-117
-118 @SuppressWarnings("CanBeFinal" )
-119 @Parameter(property = "format" , defaultValue = "HTML" , required = true )
-120 private String format = "HTML" ;
-121
-122
+104 @Parameter(defaultValue = "${project.build.directory}" , required = true )
+105 private File outputDirectory;
+106
+107
+108
+109
+110 @SuppressWarnings("CanBeFinal" )
+111 @Parameter(property = "failBuildOnCVSS" , defaultValue = "11" , required = true )
+112 private float failBuildOnCVSS = 11;
+113
+114
+115
+116
+117 @SuppressWarnings("CanBeFinal" )
+118 @Parameter(property = "autoupdate" , defaultValue = "true" , required = true )
+119 private boolean autoUpdate = true ;
+120
+121
+122
123
-124 @Parameter(property = "mavenSettings" , defaultValue = "${settings}" , required = false)
-125 private org.apache.maven.settings.Settings mavenSettings;
-126
+124 @SuppressWarnings("CanBeFinal" )
+125 @Parameter(property = "format" , defaultValue = "HTML" , required = true )
+126 private String format = "HTML" ;
127
-128
+128
129
-130 @SuppressWarnings("CanBeFinal" )
-131 @Parameter(property = "mavenSettingsProxyId" , required = false)
-132 private String mavenSettingsProxyId;
-133
-134
-135
-136
-137 @SuppressWarnings("CanBeFinal" )
-138 @Parameter(property = "connectionTimeout" , defaultValue = "" , required = false)
-139 private String connectionTimeout = null ;
+130 @Parameter(property = "mavenSettings" , defaultValue = "${settings}" , required = false)
+131 private org.apache.maven.settings.Settings mavenSettings;
+132
+133
+134
+135
+136 @SuppressWarnings("CanBeFinal" )
+137 @Parameter(property = "mavenSettingsProxyId" , required = false)
+138 private String mavenSettingsProxyId;
+139
140
-141
+141
142
143 @SuppressWarnings("CanBeFinal" )
-144 @Parameter(property = "suppressionFile" , defaultValue = "" , required = false)
-145 private String suppressionFile = null ;
+144 @Parameter(property = "connectionTimeout" , defaultValue = "" , required = false)
+145 private String connectionTimeout = null ;
146
-147
+147
148
149 @SuppressWarnings("CanBeFinal" )
-150 @Parameter(property = "showSummary" , defaultValue = "true" , required = false)
-151 private boolean showSummary = true ;
-152
-153
-154
-155
-156 @SuppressWarnings("CanBeFinal" )
-157 @Parameter(property = "jarAnalyzerEnabled" , defaultValue = "true" , required = false)
-158 private boolean jarAnalyzerEnabled = true ;
-159
-160
-161
-162
-163 @SuppressWarnings("CanBeFinal" )
-164 @Parameter(property = "archiveAnalyzerEnabled" , defaultValue = "true" , required = false)
-165 private boolean archiveAnalyzerEnabled = true ;
-166
-167
-168
-169
-170 @SuppressWarnings("CanBeFinal" )
-171 @Parameter(property = "assemblyAnalyzerEnabled" , defaultValue = "true" , required = false)
-172 private boolean assemblyAnalyzerEnabled = true ;
-173
-174
-175
-176
-177 @SuppressWarnings("CanBeFinal" )
-178 @Parameter(property = "nuspecAnalyzerEnabled" , defaultValue = "true" , required = false)
-179 private boolean nuspecAnalyzerEnabled = true ;
-180
-181
-182
-183
-184 @SuppressWarnings("CanBeFinal" )
-185 @Parameter(property = "nexusAnalyzerEnabled" , defaultValue = "true" , required = false)
-186 private boolean nexusAnalyzerEnabled = true ;
+150 @Parameter(property = "suppressionFile" , defaultValue = "" , required = false)
+151 private String suppressionFile = null ;
+152
+153
+154
+155 @SuppressWarnings("CanBeFinal" )
+156 @Parameter(property = "showSummary" , defaultValue = "true" , required = false)
+157 private boolean showSummary = true ;
+158
+159
+160
+161
+162 @SuppressWarnings("CanBeFinal" )
+163 @Parameter(property = "jarAnalyzerEnabled" , defaultValue = "true" , required = false)
+164 private boolean jarAnalyzerEnabled = true ;
+165
+166
+167
+168
+169 @SuppressWarnings("CanBeFinal" )
+170 @Parameter(property = "archiveAnalyzerEnabled" , defaultValue = "true" , required = false)
+171 private boolean archiveAnalyzerEnabled = true ;
+172
+173
+174
+175
+176 @SuppressWarnings("CanBeFinal" )
+177 @Parameter(property = "assemblyAnalyzerEnabled" , defaultValue = "true" , required = false)
+178 private boolean assemblyAnalyzerEnabled = true ;
+179
+180
+181
+182
+183 @SuppressWarnings("CanBeFinal" )
+184 @Parameter(property = "nuspecAnalyzerEnabled" , defaultValue = "true" , required = false)
+185 private boolean nuspecAnalyzerEnabled = true ;
+186
187
188
189
-190 @Parameter(property = "nexusUrl" , defaultValue = "" , required = false)
-191 private String nexusUrl;
-192
-193
-194
-195 @Parameter(property = "nexusUsesProxy" , defaultValue = "true" , required = false)
-196 private boolean nexusUsesProxy = true ;
-197
-198
-199
-200 @Parameter(property = "connectionString" , defaultValue = "" , required = false)
-201 private String connectionString;
-202
-203
-204
-205 @Parameter(property = "databaseDriverName" , defaultValue = "" , required = false)
-206 private String databaseDriverName;
-207
-208
-209
-210 @Parameter(property = "databaseDriverPath" , defaultValue = "" , required = false)
-211 private String databaseDriverPath;
-212
-213
-214
-215 @Parameter(property = "databaseUser" , defaultValue = "" , required = false)
-216 private String databaseUser;
-217
-218
-219
-220 @Parameter(property = "databasePassword" , defaultValue = "" , required = false)
-221 private String databasePassword;
-222
-223
-224
-225 @Parameter(property = "zipExtensions" , required = false)
-226 private String zipExtensions;
-227
-228
-229
-230 @SuppressWarnings("CanBeFinal" )
-231 @Parameter(property = "skipTestScope" , defaultValue = "true" , required = false)
-232 private boolean skipTestScope = true ;
+190 @SuppressWarnings("CanBeFinal" )
+191 @Parameter(property = "nexusAnalyzerEnabled" , defaultValue = "true" , required = false)
+192 private boolean nexusAnalyzerEnabled = true ;
+193
+194
+195
+196 @Parameter(property = "nexusUrl" , defaultValue = "" , required = false)
+197 private String nexusUrl;
+198
+199
+200
+201 @Parameter(property = "nexusUsesProxy" , defaultValue = "true" , required = false)
+202 private boolean nexusUsesProxy = true ;
+203
+204
+205
+206 @Parameter(property = "connectionString" , defaultValue = "" , required = false)
+207 private String connectionString;
+208
+209
+210
+211 @Parameter(property = "databaseDriverName" , defaultValue = "" , required = false)
+212 private String databaseDriverName;
+213
+214
+215
+216 @Parameter(property = "databaseDriverPath" , defaultValue = "" , required = false)
+217 private String databaseDriverPath;
+218
+219
+220
+221 @Parameter(property = "databaseUser" , defaultValue = "" , required = false)
+222 private String databaseUser;
+223
+224
+225
+226 @Parameter(property = "databasePassword" , defaultValue = "" , required = false)
+227 private String databasePassword;
+228
+229
+230
+231 @Parameter(property = "zipExtensions" , required = false)
+232 private String zipExtensions;
233
-234
+234
235
236 @SuppressWarnings("CanBeFinal" )
-237 @Parameter(property = "skipRuntimeScope" , defaultValue = "false" , required = false)
-238 private boolean skipRuntimeScope = false;
+237 @Parameter(property = "skipTestScope" , defaultValue = "true" , required = false)
+238 private boolean skipTestScope = true ;
239
-240
+240
241
242 @SuppressWarnings("CanBeFinal" )
-243 @Parameter(property = "skipProvidedScope" , defaultValue = "false" , required = false)
-244 private boolean skipProvidedScope = false;
+243 @Parameter(property = "skipRuntimeScope" , defaultValue = "false" , required = false)
+244 private boolean skipRuntimeScope = false;
245
-246
+246
247
-248 @Parameter(property = "dataDirectory" , defaultValue = "" , required = false)
-249 private String dataDirectory;
-250
-251
-252
-253 @Parameter(property = "cveUrl12Modified" , defaultValue = "" , required = false)
-254 private String cveUrl12Modified;
-255
-256
-257
-258 @Parameter(property = "cveUrl20Modified" , defaultValue = "" , required = false)
-259 private String cveUrl20Modified;
-260
-261
-262
-263 @Parameter(property = "cveUrl12Base" , defaultValue = "" , required = false)
-264 private String cveUrl12Base;
-265
-266
-267
-268 @Parameter(property = "cveUrl20Base" , defaultValue = "" , required = false)
-269 private String cveUrl20Base;
-270
+248 @SuppressWarnings("CanBeFinal" )
+249 @Parameter(property = "skipProvidedScope" , defaultValue = "false" , required = false)
+250 private boolean skipProvidedScope = false;
+251
+252
+253
+254 @Parameter(property = "dataDirectory" , defaultValue = "" , required = false)
+255 private String dataDirectory;
+256
+257
+258
+259 @Parameter(property = "cveUrl12Modified" , defaultValue = "" , required = false)
+260 private String cveUrl12Modified;
+261
+262
+263
+264 @Parameter(property = "cveUrl20Modified" , defaultValue = "" , required = false)
+265 private String cveUrl20Modified;
+266
+267
+268
+269 @Parameter(property = "cveUrl12Base" , defaultValue = "" , required = false)
+270 private String cveUrl12Base;
271
-272
+272
273
-274 @Parameter(property = "pathToMono" , defaultValue = "" , required = false)
-275 private String pathToMono;
+274 @Parameter(property = "cveUrl20Base" , defaultValue = "" , required = false)
+275 private String cveUrl20Base;
276
277
-278
-279
-280
-281
-282 @SuppressWarnings("CanBeFinal" )
-283 @Parameter(property = "proxyUrl" , defaultValue = "" , required = false)
-284 @Deprecated
-285 private String proxyUrl = null ;
-286
-287
-288
-289
-290
-291 @SuppressWarnings("CanBeFinal" )
-292 @Parameter(property = "externalReport" )
-293 @Deprecated
-294 private String externalReport = null ;
-295
-296
-297
-298
-299 public DependencyCheckMojo () {
-300 final InputStream in = DependencyCheckMojo.class .getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
-301 LogUtils.prepareLogger(in, logFile);
-302 }
-303
-304
-305
-306
-307
-308
-309
-310 private Engine executeDependencyCheck() throws DatabaseException {
-311 return executeDependencyCheck(getProject());
-312 }
-313
-314
-315
-316
-317
-318
-319
-320
-321 private Engine executeDependencyCheck(MavenProject project) throws DatabaseException {
-322 final Engine localEngine = initializeEngine();
-323
-324 final Set<Artifact> artifacts = project.getArtifacts();
-325 for (Artifact a : artifacts) {
-326 if (excludeFromScan(a)) {
-327 continue ;
-328 }
-329
-330 localEngine.scan(a.getFile().getAbsolutePath());
-331 }
-332 localEngine.analyzeDependencies();
-333
-334 return localEngine;
-335 }
-336
-337
-338
-339
-340
-341
-342
-343 private Engine initializeEngine() throws DatabaseException {
-344 populateSettings();
-345 final Engine localEngine = new Engine();
-346 return localEngine;
-347 }
-348
-349
-350
-351
-352
-353
-354
-355 private boolean excludeFromScan(Artifact a) {
-356 if (skipTestScope && Artifact.SCOPE_TEST.equals(a.getScope())) {
-357 return true ;
-358 }
-359 if (skipProvidedScope && Artifact.SCOPE_PROVIDED.equals(a.getScope())) {
-360 return true ;
-361 }
-362 if (skipRuntimeScope && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
-363 return true ;
-364 }
-365 return false;
+278
+279
+280 @Parameter(property = "pathToMono" , defaultValue = "" , required = false)
+281 private String pathToMono;
+282
+283
+284
+285
+286
+287
+288 @SuppressWarnings("CanBeFinal" )
+289 @Parameter(property = "proxyUrl" , defaultValue = "" , required = false)
+290 @Deprecated
+291 private String proxyUrl = null ;
+292
+293
+294
+295
+296
+297 @SuppressWarnings("CanBeFinal" )
+298 @Parameter(property = "externalReport" )
+299 @Deprecated
+300 private String externalReport = null ;
+301
+302
+303
+304
+305
+306 public DependencyCheckMojo () {
+307 final InputStream in = DependencyCheckMojo.class .getClassLoader().getResourceAsStream(LOG_PROPERTIES_FILE);
+308 LogUtils.prepareLogger(in, logFile);
+309 }
+310
+311
+312
+313
+314
+315
+316
+317 private Engine executeDependencyCheck() throws DatabaseException {
+318 return executeDependencyCheck(getProject());
+319 }
+320
+321
+322
+323
+324
+325
+326
+327
+328 private Engine executeDependencyCheck(MavenProject project) throws DatabaseException {
+329 final Engine localEngine = initializeEngine();
+330
+331 final Set<Artifact> artifacts = project.getArtifacts();
+332 for (Artifact a : artifacts) {
+333 if (excludeFromScan(a)) {
+334 continue ;
+335 }
+336 final List<Dependency> deps = localEngine.scan(a.getFile().getAbsoluteFile());
+337 if (deps != null ) {
+338 if (deps.size() == 1) {
+339 final Dependency d = deps.get(0);
+340 if (d != null ) {
+341 final MavenArtifact ma = new MavenArtifact(a.getGroupId(), a.getArtifactId(), a.getVersion());
+342 d.addAsEvidence("pom" , ma, Confidence.HIGHEST);
+343 }
+344 } else {
+345 final String msg = String.format("More then 1 dependency was identified in first pass scan of '%s:%s:%s'" ,
+346 a.getGroupId(), a.getArtifactId(), a.getVersion());
+347 LOGGER.info(msg);
+348 }
+349 }
+350 }
+351 localEngine.analyzeDependencies();
+352
+353 return localEngine;
+354 }
+355
+356
+357
+358
+359
+360
+361
+362 private Engine initializeEngine() throws DatabaseException {
+363 populateSettings();
+364 final Engine localEngine = new Engine();
+365 return localEngine;
366 }
367
-368
-369
-370
-371
-372
-373 private void populateSettings() {
-374 Settings.initialize();
-375 InputStream mojoProperties = null ;
-376 try {
-377 mojoProperties = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
-378 Settings.mergeProperties(mojoProperties);
-379 } catch (IOException ex) {
-380 LOGGER.log(Level.WARNING, "Unable to load the dependency-check ant task.properties file." );
-381 LOGGER.log(Level.FINE, null , ex);
-382 } finally {
-383 if (mojoProperties != null ) {
-384 try {
-385 mojoProperties.close();
-386 } catch (IOException ex) {
-387 LOGGER.log(Level.FINEST, null , ex);
-388 }
-389 }
-390 }
-391
-392 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
-393 if (externalReport != null ) {
-394 LOGGER.warning("The 'externalReport' option was set; this configuration option has been removed. "
-395 + "Please update the dependency-check-maven plugin's configuration" );
-396 }
-397
-398 if (proxyUrl != null && !proxyUrl.isEmpty()) {
-399 LOGGER.warning("Deprecated configuration detected, proxyUrl will be ignored; use the maven settings "
-400 + "to configure the proxy instead" );
-401 }
-402 final Proxy proxy = getMavenProxy();
-403 if (proxy != null ) {
-404 Settings.setString(Settings.KEYS.PROXY_SERVER, proxy.getHost());
-405 Settings.setString(Settings.KEYS.PROXY_PORT, Integer.toString(proxy.getPort()));
-406 final String userName = proxy.getUsername();
-407 final String password = proxy.getPassword();
-408 if (userName != null ) {
-409 Settings.setString(Settings.KEYS.PROXY_USERNAME, userName);
-410 }
-411 if (password != null ) {
-412 Settings.setString(Settings.KEYS.PROXY_PASSWORD, password);
-413 }
-414
+368
+369
+370
+371
+372
+373
+374 private boolean excludeFromScan(Artifact a) {
+375 if (skipTestScope && Artifact.SCOPE_TEST.equals(a.getScope())) {
+376 return true ;
+377 }
+378 if (skipProvidedScope && Artifact.SCOPE_PROVIDED.equals(a.getScope())) {
+379 return true ;
+380 }
+381 if (skipRuntimeScope && !Artifact.SCOPE_RUNTIME.equals(a.getScope())) {
+382 return true ;
+383 }
+384 return false;
+385 }
+386
+387
+388
+389
+390
+391
+392 private void populateSettings() {
+393 Settings.initialize();
+394 InputStream mojoProperties = null ;
+395 try {
+396 mojoProperties = this .getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
+397 Settings.mergeProperties(mojoProperties);
+398 } catch (IOException ex) {
+399 LOGGER.log(Level.WARNING, "Unable to load the dependency-check ant task.properties file." );
+400 LOGGER.log(Level.FINE, null , ex);
+401 } finally {
+402 if (mojoProperties != null ) {
+403 try {
+404 mojoProperties.close();
+405 } catch (IOException ex) {
+406 LOGGER.log(Level.FINEST, null , ex);
+407 }
+408 }
+409 }
+410
+411 Settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate);
+412 if (externalReport != null ) {
+413 LOGGER.warning("The 'externalReport' option was set; this configuration option has been removed. "
+414 + "Please update the dependency-check-maven plugin's configuration" );
415 }
416
-417 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
-418 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
+417 if (proxyUrl != null && !proxyUrl.isEmpty()) {
+418 LOGGER.warning("Deprecated configuration detected, proxyUrl will be ignored; use the maven settings " + "to configure the proxy instead" );
419 }
-420 if (suppressionFile != null && !suppressionFile.isEmpty()) {
-421 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
-422 }
-423
-424
-425
-426 Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, jarAnalyzerEnabled);
-427
-428 Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, nuspecAnalyzerEnabled);
-429
-430 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
-431 if (nexusUrl != null && !nexusUrl.isEmpty()) {
-432 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
+420 final Proxy proxy = getMavenProxy();
+421 if (proxy != null ) {
+422 Settings.setString(Settings.KEYS.PROXY_SERVER, proxy.getHost());
+423 Settings.setString(Settings.KEYS.PROXY_PORT, Integer.toString(proxy.getPort()));
+424 final String userName = proxy.getUsername();
+425 final String password = proxy.getPassword();
+426 if (userName != null ) {
+427 Settings.setString(Settings.KEYS.PROXY_USERNAME, userName);
+428 }
+429 if (password != null ) {
+430 Settings.setString(Settings.KEYS.PROXY_PASSWORD, password);
+431 }
+432
433 }
-434 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
-435
-436 Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, archiveAnalyzerEnabled);
-437 if (zipExtensions != null && !zipExtensions.isEmpty()) {
-438 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
-439 }
-440
-441 Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, assemblyAnalyzerEnabled);
-442 if (pathToMono != null && !pathToMono.isEmpty()) {
-443 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
-444 }
-445
-446
-447 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
-448 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
-449 }
-450 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
-451 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
-452 }
-453 if (connectionString != null && !connectionString.isEmpty()) {
-454 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
-455 }
-456 if (databaseUser != null && !databaseUser.isEmpty()) {
-457 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
-458 }
-459 if (databasePassword != null && !databasePassword.isEmpty()) {
-460 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
-461 }
-462
-463 if (dataDirectory != null && !dataDirectory.isEmpty()) {
-464 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
-465 }
-466
-467
-468 Settings.setBoolean(Settings.KEYS.SKIP_TEST_SCOPE, skipTestScope);
-469 Settings.setBoolean(Settings.KEYS.SKIP_RUNTIME_SCOPE, skipRuntimeScope);
-470 Settings.setBoolean(Settings.KEYS.SKIP_PROVIDED_SCOPE, skipProvidedScope);
-471
-472
-473 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
-474 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
-475 }
-476 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
-477 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
-478 }
-479 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
-480 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
-481 }
-482 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
-483 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
-484 }
-485 }
-486
-487
-488
-489
-490
-491
-492 private Proxy getMavenProxy() {
-493 if (mavenSettings != null ) {
-494 final List<Proxy> proxies = mavenSettings.getProxies();
-495 if (proxies != null && proxies.size() > 0) {
-496 if (mavenSettingsProxyId != null ) {
-497 for (Proxy proxy : proxies) {
-498 if (mavenSettingsProxyId.equalsIgnoreCase(proxy.getId())) {
-499 return proxy;
-500 }
-501 }
-502 } else if (proxies.size() == 1) {
-503 return proxies.get(0);
-504 } else {
-505 LOGGER.warning("Multiple proxy defentiions exist in the Maven settings. In the dependency-check "
-506 + "configuration set the maveSettingsProxyId so that the correct proxy will be used." );
-507 throw new IllegalStateException("Ambiguous proxy definition" );
-508 }
-509 }
-510 }
-511 return null ;
-512 }
-513
-514
-515
-516
-517
-518
-519
-520
-521 @Override
-522 protected void performExecute() throws MojoExecutionException, MojoFailureException {
-523 try {
-524 engine = executeDependencyCheck();
-525 ReportingUtil.generateExternalReports(engine, outputDirectory, getProject().getName(), format);
-526 if (this .showSummary) {
-527 showSummary(engine.getDependencies());
-528 }
-529 if (this .failBuildOnCVSS <= 10) {
-530 checkForFailure(engine.getDependencies());
-531 }
-532 } catch (DatabaseException ex) {
-533 LOGGER.log(Level.SEVERE,
-534 "Unable to connect to the dependency-check database; analysis has stopped" );
-535 LOGGER.log(Level.FINE, "" , ex);
-536 }
-537 }
-538
+434
+435 if (connectionTimeout != null && !connectionTimeout.isEmpty()) {
+436 Settings.setString(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout);
+437 }
+438 if (suppressionFile != null && !suppressionFile.isEmpty()) {
+439 Settings.setString(Settings.KEYS.SUPPRESSION_FILE, suppressionFile);
+440 }
+441
+442
+443
+444 Settings.setBoolean(Settings.KEYS.ANALYZER_JAR_ENABLED, jarAnalyzerEnabled);
+445
+446 Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, nuspecAnalyzerEnabled);
+447
+448 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
+449 if (nexusUrl != null && !nexusUrl.isEmpty()) {
+450 Settings.setString(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
+451 }
+452 Settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY, nexusUsesProxy);
+453
+454 Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, archiveAnalyzerEnabled);
+455 if (zipExtensions != null && !zipExtensions.isEmpty()) {
+456 Settings.setString(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
+457 }
+458
+459 Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, assemblyAnalyzerEnabled);
+460 if (pathToMono != null && !pathToMono.isEmpty()) {
+461 Settings.setString(Settings.KEYS.ANALYZER_ASSEMBLY_MONO_PATH, pathToMono);
+462 }
+463
+464
+465 if (databaseDriverName != null && !databaseDriverName.isEmpty()) {
+466 Settings.setString(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName);
+467 }
+468 if (databaseDriverPath != null && !databaseDriverPath.isEmpty()) {
+469 Settings.setString(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath);
+470 }
+471 if (connectionString != null && !connectionString.isEmpty()) {
+472 Settings.setString(Settings.KEYS.DB_CONNECTION_STRING, connectionString);
+473 }
+474 if (databaseUser != null && !databaseUser.isEmpty()) {
+475 Settings.setString(Settings.KEYS.DB_USER, databaseUser);
+476 }
+477 if (databasePassword != null && !databasePassword.isEmpty()) {
+478 Settings.setString(Settings.KEYS.DB_PASSWORD, databasePassword);
+479 }
+480
+481 if (dataDirectory != null && !dataDirectory.isEmpty()) {
+482 Settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory);
+483 }
+484
+485
+486 Settings.setBoolean(Settings.KEYS.SKIP_TEST_SCOPE, skipTestScope);
+487 Settings.setBoolean(Settings.KEYS.SKIP_RUNTIME_SCOPE, skipRuntimeScope);
+488 Settings.setBoolean(Settings.KEYS.SKIP_PROVIDED_SCOPE, skipProvidedScope);
+489
+490
+491 if (cveUrl12Modified != null && !cveUrl12Modified.isEmpty()) {
+492 Settings.setString(Settings.KEYS.CVE_MODIFIED_12_URL, cveUrl12Modified);
+493 }
+494 if (cveUrl20Modified != null && !cveUrl20Modified.isEmpty()) {
+495 Settings.setString(Settings.KEYS.CVE_MODIFIED_20_URL, cveUrl20Modified);
+496 }
+497 if (cveUrl12Base != null && !cveUrl12Base.isEmpty()) {
+498 Settings.setString(Settings.KEYS.CVE_SCHEMA_1_2, cveUrl12Base);
+499 }
+500 if (cveUrl20Base != null && !cveUrl20Base.isEmpty()) {
+501 Settings.setString(Settings.KEYS.CVE_SCHEMA_2_0, cveUrl20Base);
+502 }
+503 }
+504
+505
+506
+507
+508
+509
+510 private Proxy getMavenProxy() {
+511 if (mavenSettings != null ) {
+512 final List<Proxy> proxies = mavenSettings.getProxies();
+513 if (proxies != null && proxies.size() > 0) {
+514 if (mavenSettingsProxyId != null ) {
+515 for (Proxy proxy : proxies) {
+516 if (mavenSettingsProxyId.equalsIgnoreCase(proxy.getId())) {
+517 return proxy;
+518 }
+519 }
+520 } else if (proxies.size() == 1) {
+521 return proxies.get(0);
+522 } else {
+523 LOGGER.warning("Multiple proxy defentiions exist in the Maven settings. In the dependency-check "
+524 + "configuration set the maveSettingsProxyId so that the correct proxy will be used." );
+525 throw new IllegalStateException("Ambiguous proxy definition" );
+526 }
+527 }
+528 }
+529 return null ;
+530 }
+531
+532
+533
+534
+535
+536
+537
+538
539 @Override
-540 protected void postExecute() throws MojoExecutionException, MojoFailureException {
+540 protected void performExecute() throws MojoExecutionException, MojoFailureException {
541 try {
-542 super .postExecute();
-543 } finally {
-544 cleanupEngine();
-545 }
-546 }
-547
-548 @Override
-549 protected void postGenerate() throws MavenReportException {
-550 try {
-551 super .postGenerate();
-552 } finally {
-553 cleanupEngine();
-554 }
-555 }
-556
-557
-558
-559
-560 private void cleanupEngine() {
-561 if (engine != null ) {
-562 engine.cleanup();
-563 engine = null ;
-564 }
-565 Settings.cleanup(true );
-566 }
-567
-568
-569
-570
-571
-572
-573
-574 @Override
-575 protected void executeNonAggregateReport(Locale locale) throws MavenReportException {
-576
-577 final List<Dependency> deps = readDataFile();
-578 if (deps != null ) {
-579 try {
-580 engine = initializeEngine();
-581 engine.getDependencies().addAll(deps);
-582 } catch (DatabaseException ex) {
-583 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
-584 getProject().getName());
-585 throw new MavenReportException(msg, ex);
-586 }
-587 } else {
-588 try {
-589 engine = executeDependencyCheck();
-590 } catch (DatabaseException ex) {
-591 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
-592 getProject().getName());
-593 throw new MavenReportException(msg, ex);
-594 }
-595 }
-596 ReportingUtil.generateExternalReports(engine, getReportOutputDirectory(), getProject().getName(), format);
-597 }
-598
-599 @Override
-600 protected void executeAggregateReport(MavenProject project, Locale locale) throws MavenReportException {
-601 List<Dependency> deps = readDataFile(project);
-602 if (deps != null ) {
-603 try {
-604 engine = initializeEngine();
-605 engine.getDependencies().addAll(deps);
-606 } catch (DatabaseException ex) {
-607 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
-608 project.getName());
-609 throw new MavenReportException(msg, ex);
-610 }
-611 } else {
-612 try {
-613 engine = executeDependencyCheck(project);
-614 } catch (DatabaseException ex) {
-615 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
-616 project.getName());
-617 throw new MavenReportException(msg, ex);
-618 }
-619 }
-620 for (MavenProject child : getAllChildren(project)) {
-621 deps = readDataFile(child);
-622 if (deps == null ) {
-623 final String msg = String.format("Unable to include information on %s in the dependency-check aggregate report" , child.getName());
-624 LOGGER.severe(msg);
-625 } else {
-626 engine.getDependencies().addAll(deps);
+542 engine = executeDependencyCheck();
+543 ReportingUtil.generateExternalReports(engine, outputDirectory, getProject().getName(), format);
+544 if (this .showSummary) {
+545 showSummary(engine.getDependencies());
+546 }
+547 if (this .failBuildOnCVSS <= 10) {
+548 checkForFailure(engine.getDependencies());
+549 }
+550 } catch (DatabaseException ex) {
+551 LOGGER.log(Level.SEVERE, "Unable to connect to the dependency-check database; analysis has stopped" );
+552 LOGGER.log(Level.FINE, "" , ex);
+553 }
+554 }
+555
+556 @Override
+557 protected void postExecute() throws MojoExecutionException, MojoFailureException {
+558 try {
+559 super .postExecute();
+560 } finally {
+561 cleanupEngine();
+562 }
+563 }
+564
+565 @Override
+566 protected void postGenerate() throws MavenReportException {
+567 try {
+568 super .postGenerate();
+569 } finally {
+570 cleanupEngine();
+571 }
+572 }
+573
+574
+575
+576
+577 private void cleanupEngine() {
+578 if (engine != null ) {
+579 engine.cleanup();
+580 engine = null ;
+581 }
+582 Settings.cleanup(true );
+583 }
+584
+585
+586
+587
+588
+589
+590
+591 @Override
+592 protected void executeNonAggregateReport(Locale locale) throws MavenReportException {
+593
+594 final List<Dependency> deps = readDataFile();
+595 if (deps != null ) {
+596 try {
+597 engine = initializeEngine();
+598 engine.getDependencies().addAll(deps);
+599 } catch (DatabaseException ex) {
+600 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
+601 getProject().getName());
+602 throw new MavenReportException(msg, ex);
+603 }
+604 } else {
+605 try {
+606 engine = executeDependencyCheck();
+607 } catch (DatabaseException ex) {
+608 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
+609 getProject().getName());
+610 throw new MavenReportException(msg, ex);
+611 }
+612 }
+613 ReportingUtil.generateExternalReports(engine, getReportOutputDirectory(), getProject().getName(), format);
+614 }
+615
+616 @Override
+617 protected void executeAggregateReport(MavenProject project, Locale locale) throws MavenReportException {
+618 List<Dependency> deps = readDataFile(project);
+619 if (deps != null ) {
+620 try {
+621 engine = initializeEngine();
+622 engine.getDependencies().addAll(deps);
+623 } catch (DatabaseException ex) {
+624 final String msg = String.format("An unrecoverable exception with the dependency-check initialization occured while scanning %s" ,
+625 project.getName());
+626 throw new MavenReportException(msg, ex);
627 }
-628 }
-629 final DependencyBundlingAnalyzer bundler = new DependencyBundlingAnalyzer();
-630 try {
-631 bundler.analyze(null , engine);
-632 } catch (AnalysisException ex) {
-633 LOGGER.log(Level.WARNING, "An error occured grouping the dependencies; duplicate entries may exist in the report" , ex);
-634 LOGGER.log(Level.FINE, "Bundling Exception" , ex);
-635 }
-636 final File outputDir = getReportOutputDirectory(project);
-637 if (outputDir != null ) {
-638 ReportingUtil.generateExternalReports(engine, outputDir, project.getName(), format);
-639 }
-640 }
-641
-642
-643
-644
-645
-646
-647
-648 public String getOutputName() {
-649 if ("HTML" .equalsIgnoreCase(this .format)
-650 || "ALL" .equalsIgnoreCase(this .format)) {
-651 return "dependency-check-report" ;
-652 } else if ("XML" .equalsIgnoreCase(this .format)) {
-653 return "dependency-check-report.xml#" ;
-654 } else if ("VULN" .equalsIgnoreCase(this .format)) {
-655 return "dependency-check-vulnerability" ;
-656 } else {
-657 LOGGER.log(Level.WARNING, "Unknown report format used during site generation." );
-658 return "dependency-check-report" ;
-659 }
-660 }
-661
-662
-663
-664
-665
-666
-667 public String getCategoryName() {
-668 return MavenReport.CATEGORY_PROJECT_REPORTS;
-669 }
-670
-671
-672
-673
-674
-675
-676
-677 public String getName(Locale locale) {
-678 return "dependency-check" ;
-679 }
-680
-681
-682
-683
-684
-685
-686
-687 public String getDescription(Locale locale) {
-688 return "A report providing details on any published "
-689 + "vulnerabilities within project dependencies. This report is a best effort but may contain "
-690 + "false positives and false negatives." ;
-691 }
-692
-693
-694
-695
-696
-697
-698 public boolean canGenerateReport() {
-699 if (canGenerateAggregateReport() || (isAggregate() && isMultiModule())) {
-700 return true ;
-701 }
-702 if (canGenerateNonAggregateReport()) {
-703 return true ;
-704 } else {
-705 final String msg;
-706 if (getProject().getArtifacts().size() > 0) {
-707 msg = "No project dependencies exist in the included scope - dependency-check:check is unable to generate a report." ;
-708 } else {
-709 msg = "No project dependencies exist - dependency-check:check is unable to generate a report." ;
-710 }
-711 LOGGER.warning(msg);
-712 }
-713
-714 return false;
-715 }
-716
-717
-718
-719
-720
-721
-722 @Override
-723 protected boolean canGenerateNonAggregateReport() {
-724 boolean ability = false;
-725 for (Artifact a : getProject().getArtifacts()) {
-726 if (!excludeFromScan(a)) {
-727 ability = true ;
-728 break ;
-729 }
-730 }
-731 return ability;
+628 } else {
+629 try {
+630 engine = executeDependencyCheck(project);
+631 } catch (DatabaseException ex) {
+632 final String msg = String.format("An unrecoverable exception with the dependency-check scan occured while scanning %s" ,
+633 project.getName());
+634 throw new MavenReportException(msg, ex);
+635 }
+636 }
+637 for (MavenProject child : getAllChildren(project)) {
+638 deps = readDataFile(child);
+639 if (deps == null ) {
+640 final String msg = String.format("Unable to include information on %s in the dependency-check aggregate report" ,
+641 child.getName());
+642 LOGGER.severe(msg);
+643 } else {
+644 engine.getDependencies().addAll(deps);
+645 }
+646 }
+647 final DependencyBundlingAnalyzer bundler = new DependencyBundlingAnalyzer();
+648 try {
+649 bundler.analyze(null , engine);
+650 } catch (AnalysisException ex) {
+651 LOGGER.log(Level.WARNING, "An error occured grouping the dependencies; duplicate entries may exist in the report" , ex);
+652 LOGGER.log(Level.FINE, "Bundling Exception" , ex);
+653 }
+654 final File outputDir = getReportOutputDirectory(project);
+655 if (outputDir != null ) {
+656 ReportingUtil.generateExternalReports(engine, outputDir, project.getName(), format);
+657 }
+658 }
+659
+660
+661
+662
+663
+664
+665
+666 public String getOutputName() {
+667 if ("HTML" .equalsIgnoreCase(this .format) || "ALL" .equalsIgnoreCase(this .format)) {
+668 return "dependency-check-report" ;
+669 } else if ("XML" .equalsIgnoreCase(this .format)) {
+670 return "dependency-check-report.xml#" ;
+671 } else if ("VULN" .equalsIgnoreCase(this .format)) {
+672 return "dependency-check-vulnerability" ;
+673 } else {
+674 LOGGER.log(Level.WARNING, "Unknown report format used during site generation." );
+675 return "dependency-check-report" ;
+676 }
+677 }
+678
+679
+680
+681
+682
+683
+684 public String getCategoryName() {
+685 return MavenReport.CATEGORY_PROJECT_REPORTS;
+686 }
+687
+688
+689
+690
+691
+692
+693
+694 public String getName(Locale locale) {
+695 return "dependency-check" ;
+696 }
+697
+698
+699
+700
+701
+702
+703
+704 public String getDescription(Locale locale) {
+705 return "A report providing details on any published "
+706 + "vulnerabilities within project dependencies. This report is a best effort but may contain "
+707 + "false positives and false negatives." ;
+708 }
+709
+710
+711
+712
+713
+714
+715 public boolean canGenerateReport() {
+716 if (canGenerateAggregateReport() || (isAggregate() && isMultiModule())) {
+717 return true ;
+718 }
+719 if (canGenerateNonAggregateReport()) {
+720 return true ;
+721 } else {
+722 final String msg;
+723 if (getProject().getArtifacts().size() > 0) {
+724 msg = "No project dependencies exist in the included scope - dependency-check:check is unable to generate a report." ;
+725 } else {
+726 msg = "No project dependencies exist - dependency-check:check is unable to generate a report." ;
+727 }
+728 LOGGER.warning(msg);
+729 }
+730
+731 return false;
732 }
733
734
-735
+735
736
-737
+737
738
739 @Override
-740 protected boolean canGenerateAggregateReport() {
-741 return isAggregate() && isLastProject();
-742 }
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753 private void checkForFailure(List<Dependency> dependencies) throws MojoFailureException {
-754 final StringBuilder ids = new StringBuilder();
-755 for (Dependency d : dependencies) {
-756 boolean addName = true ;
-757 for (Vulnerability v : d.getVulnerabilities()) {
-758 if (v.getCvssScore() >= failBuildOnCVSS) {
-759 if (addName) {
-760 addName = false;
-761 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
-762 ids.append(v.getName());
-763 } else {
-764 ids.append(", " ).append(v.getName());
-765 }
-766 }
-767 }
-768 }
-769 if (ids.length() > 0) {
-770 final String msg = String.format("%n%nDependency-Check Failure:%n"
-771 + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
-772 + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
-773 throw new MojoFailureException(msg);
-774 }
-775 }
-776
-777
-778
-779
-780
-781
-782 private void showSummary(List<Dependency> dependencies) {
-783 final StringBuilder summary = new StringBuilder();
-784 for (Dependency d : dependencies) {
-785 boolean firstEntry = true ;
-786 final StringBuilder ids = new StringBuilder();
-787 for (Vulnerability v : d.getVulnerabilities()) {
-788 if (firstEntry) {
-789 firstEntry = false;
-790 } else {
-791 ids.append(", " );
-792 }
-793 ids.append(v.getName());
-794 }
-795 if (ids.length() > 0) {
-796 summary.append(d.getFileName()).append(" (" );
-797 firstEntry = true ;
-798 for (Identifier id : d.getIdentifiers()) {
-799 if (firstEntry) {
-800 firstEntry = false;
-801 } else {
-802 summary.append(", " );
-803 }
-804 summary.append(id.getValue());
-805 }
-806 summary.append(") : " ).append(ids).append(NEW_LINE);
-807 }
-808 }
-809 if (summary.length() > 0) {
-810 final String msg = String.format("%n%n"
-811 + "One or more dependencies were identified with known vulnerabilities:%n%n%s"
-812 + "%n%nSee the dependency-check report for more details.%n%n" , summary.toString());
-813 LOGGER.log(Level.WARNING, msg);
-814 }
-815 }
-816
-817
-818
-819
-820
-821
-822
-823
-824 @Override
-825 protected File writeDataFile() {
-826 File file = null ;
-827 if (engine != null && getProject().getContextValue(this .getDataFileContextKey()) == null ) {
-828 file = new File(getProject().getBuild().getDirectory(), getDataFileName());
-829 OutputStream os = null ;
-830 OutputStream bos = null ;
-831 ObjectOutputStream out = null ;
-832 try {
-833 os = new FileOutputStream(file);
-834 bos = new BufferedOutputStream(os);
-835 out = new ObjectOutputStream(bos);
-836 out.writeObject(engine.getDependencies());
-837 out.flush();
-838
-839
-840
-841 out.reset();
-842
-843 } catch (IOException ex) {
-844 LOGGER.log(Level.WARNING, "Unable to create data file used for report aggregation; "
-845 + "if report aggregation is being used the results may be incomplete." );
-846 LOGGER.log(Level.FINE, ex.getMessage(), ex);
-847 } finally {
-848 if (out != null ) {
-849 try {
-850 out.close();
-851 } catch (IOException ex) {
-852 LOGGER.log(Level.FINEST, "ignore" , ex);
-853 }
-854 }
-855 if (bos != null ) {
-856 try {
-857 bos.close();
-858 } catch (IOException ex) {
-859 LOGGER.log(Level.FINEST, "ignore" , ex);
-860 }
-861 }
-862 if (os != null ) {
-863 try {
-864 os.close();
-865 } catch (IOException ex) {
-866 LOGGER.log(Level.FINEST, "ignore" , ex);
-867 }
-868 }
-869 }
-870 }
-871 return file;
-872 }
-873
-874
-875
-876
-877
-878
-879
-880
-881 protected List<Dependency> readDataFile() {
-882 return readDataFile(getProject());
-883 }
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893 protected List<Dependency> readDataFile(MavenProject project) {
-894 final Object oPath = project.getContextValue(this .getDataFileContextKey());
-895 if (oPath == null ) {
-896 return null ;
-897 }
-898 List<Dependency> ret = null ;
-899 final String path = (String) oPath;
-900 ObjectInputStream ois = null ;
-901 try {
-902 ois = new ObjectInputStream(new FileInputStream(path));
-903 ret = (List<Dependency>) ois.readObject();
-904 } catch (FileNotFoundException ex) {
-905
-906 LOGGER.log(Level.SEVERE, null , ex);
-907 } catch (IOException ex) {
-908 LOGGER.log(Level.SEVERE, null , ex);
-909 } catch (ClassNotFoundException ex) {
-910 LOGGER.log(Level.SEVERE, null , ex);
-911 } finally {
-912 if (ois != null ) {
-913 try {
-914 ois.close();
-915 } catch (IOException ex) {
-916 LOGGER.log(Level.SEVERE, null , ex);
-917 }
-918 }
-919 }
-920 return ret;
-921 }
-922
-923 }
+740 protected boolean canGenerateNonAggregateReport() {
+741 boolean ability = false;
+742 for (Artifact a : getProject().getArtifacts()) {
+743 if (!excludeFromScan(a)) {
+744 ability = true ;
+745 break ;
+746 }
+747 }
+748 return ability;
+749 }
+750
+751
+752
+753
+754
+755
+756 @Override
+757 protected boolean canGenerateAggregateReport() {
+758 return isAggregate() && isLastProject();
+759 }
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770 private void checkForFailure(List<Dependency> dependencies) throws MojoFailureException {
+771 final StringBuilder ids = new StringBuilder();
+772 for (Dependency d : dependencies) {
+773 boolean addName = true ;
+774 for (Vulnerability v : d.getVulnerabilities()) {
+775 if (v.getCvssScore() >= failBuildOnCVSS) {
+776 if (addName) {
+777 addName = false;
+778 ids.append(NEW_LINE).append(d.getFileName()).append(": " );
+779 ids.append(v.getName());
+780 } else {
+781 ids.append(", " ).append(v.getName());
+782 }
+783 }
+784 }
+785 }
+786 if (ids.length() > 0) {
+787 final String msg = String.format("%n%nDependency-Check Failure:%n"
+788 + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater then '%.1f': %s%n"
+789 + "See the dependency-check report for more details.%n%n" , failBuildOnCVSS, ids.toString());
+790 throw new MojoFailureException(msg);
+791 }
+792 }
+793
+794
+795
+796
+797
+798
+799 private void showSummary(List<Dependency> dependencies) {
+800 final StringBuilder summary = new StringBuilder();
+801 for (Dependency d : dependencies) {
+802 boolean firstEntry = true ;
+803 final StringBuilder ids = new StringBuilder();
+804 for (Vulnerability v : d.getVulnerabilities()) {
+805 if (firstEntry) {
+806 firstEntry = false;
+807 } else {
+808 ids.append(", " );
+809 }
+810 ids.append(v.getName());
+811 }
+812 if (ids.length() > 0) {
+813 summary.append(d.getFileName()).append(" (" );
+814 firstEntry = true ;
+815 for (Identifier id : d.getIdentifiers()) {
+816 if (firstEntry) {
+817 firstEntry = false;
+818 } else {
+819 summary.append(", " );
+820 }
+821 summary.append(id.getValue());
+822 }
+823 summary.append(") : " ).append(ids).append(NEW_LINE);
+824 }
+825 }
+826 if (summary.length() > 0) {
+827 final String msg = String.format("%n%n" + "One or more dependencies were identified with known vulnerabilities:%n%n%s"
+828 + "%n%nSee the dependency-check report for more details.%n%n" , summary.toString());
+829 LOGGER.log(Level.WARNING, msg);
+830 }
+831 }
+832
+833
+834
+835
+836
+837
+838
+839
+840 @Override
+841 protected File writeDataFile() {
+842 File file = null ;
+843 if (engine != null && getProject().getContextValue(this .getDataFileContextKey()) == null ) {
+844 file = new File(getProject().getBuild().getDirectory(), getDataFileName());
+845 OutputStream os = null ;
+846 OutputStream bos = null ;
+847 ObjectOutputStream out = null ;
+848 try {
+849 os = new FileOutputStream(file);
+850 bos = new BufferedOutputStream(os);
+851 out = new ObjectOutputStream(bos);
+852 out.writeObject(engine.getDependencies());
+853 out.flush();
+854
+855
+856
+857 out.reset();
+858
+859 } catch (IOException ex) {
+860 LOGGER.log(Level.WARNING, "Unable to create data file used for report aggregation; "
+861 + "if report aggregation is being used the results may be incomplete." );
+862 LOGGER.log(Level.FINE, ex.getMessage(), ex);
+863 } finally {
+864 if (out != null ) {
+865 try {
+866 out.close();
+867 } catch (IOException ex) {
+868 LOGGER.log(Level.FINEST, "ignore" , ex);
+869 }
+870 }
+871 if (bos != null ) {
+872 try {
+873 bos.close();
+874 } catch (IOException ex) {
+875 LOGGER.log(Level.FINEST, "ignore" , ex);
+876 }
+877 }
+878 if (os != null ) {
+879 try {
+880 os.close();
+881 } catch (IOException ex) {
+882 LOGGER.log(Level.FINEST, "ignore" , ex);
+883 }
+884 }
+885 }
+886 }
+887 return file;
+888 }
+889
+890
+891
+892
+893
+894
+895
+896
+897 protected List<Dependency> readDataFile() {
+898 return readDataFile(getProject());
+899 }
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909 protected List<Dependency> readDataFile(MavenProject project) {
+910 final Object oPath = project.getContextValue(this .getDataFileContextKey());
+911 if (oPath == null ) {
+912 return null ;
+913 }
+914 List<Dependency> ret = null ;
+915 final String path = (String) oPath;
+916 ObjectInputStream ois = null ;
+917 try {
+918 ois = new ObjectInputStream(new FileInputStream(path));
+919 ret = (List<Dependency>) ois.readObject();
+920 } catch (FileNotFoundException ex) {
+921
+922 LOGGER.log(Level.SEVERE, null , ex);
+923 } catch (IOException ex) {
+924 LOGGER.log(Level.SEVERE, null , ex);
+925 } catch (ClassNotFoundException ex) {
+926 LOGGER.log(Level.SEVERE, null , ex);
+927 } finally {
+928 if (ois != null ) {
+929 try {
+930 ois.close();
+931 } catch (IOException ex) {
+932 LOGGER.log(Level.SEVERE, null , ex);
+933 }
+934 }
+935 }
+936 return ret;
+937 }
+938
+939 }
diff --git a/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-frame.html b/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-frame.html
index 1c24ca41a..d0a6b8e68 100644
--- a/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-frame.html
+++ b/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference Package org.owasp.dependencycheck.maven
+ Dependency-Check Maven Plugin 1.2.6 Reference Package org.owasp.dependencycheck.maven
diff --git a/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-summary.html b/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-summary.html
index 605bda809..c1036c80d 100644
--- a/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-summary.html
+++ b/dependency-check-maven/xref/org/owasp/dependencycheck/maven/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference Package org.owasp.dependencycheck.maven
+ Dependency-Check Maven Plugin 1.2.6 Reference Package org.owasp.dependencycheck.maven
diff --git a/dependency-check-maven/xref/overview-frame.html b/dependency-check-maven/xref/overview-frame.html
index 1dcb2eb31..4708992a8 100644
--- a/dependency-check-maven/xref/overview-frame.html
+++ b/dependency-check-maven/xref/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
diff --git a/dependency-check-maven/xref/overview-summary.html b/dependency-check-maven/xref/overview-summary.html
index cfa7a5fe6..6ccf78671 100644
--- a/dependency-check-maven/xref/overview-summary.html
+++ b/dependency-check-maven/xref/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Maven Plugin 1.2.5 Reference
+ Dependency-Check Maven Plugin 1.2.6 Reference
diff --git a/dependency-check-utils/apidocs/allclasses-frame.html b/dependency-check-utils/apidocs/allclasses-frame.html
index 39083e9a7..02dc65933 100644
--- a/dependency-check-utils/apidocs/allclasses-frame.html
+++ b/dependency-check-utils/apidocs/allclasses-frame.html
@@ -2,28 +2,56 @@
-
+
-All Classes (Dependency-Check Utils 1.2.5 API)
-
+All Classes (Dependency-Check Utils 1.2.6 API)
+
All Classes
diff --git a/dependency-check-utils/apidocs/allclasses-noframe.html b/dependency-check-utils/apidocs/allclasses-noframe.html
index 60073a27d..036b97b82 100644
--- a/dependency-check-utils/apidocs/allclasses-noframe.html
+++ b/dependency-check-utils/apidocs/allclasses-noframe.html
@@ -2,28 +2,56 @@
-
+
-All Classes (Dependency-Check Utils 1.2.5 API)
-
+All Classes (Dependency-Check Utils 1.2.6 API)
+
All Classes
diff --git a/dependency-check-utils/apidocs/constant-values.html b/dependency-check-utils/apidocs/constant-values.html
index e5c19ba51..6f2b3ccb2 100644
--- a/dependency-check-utils/apidocs/constant-values.html
+++ b/dependency-check-utils/apidocs/constant-values.html
@@ -2,16 +2,16 @@
-
+
-Constant Field Values (Dependency-Check Utils 1.2.5 API)
-
+Constant Field Values (Dependency-Check Utils 1.2.6 API)
+
@@ -25,10 +25,11 @@
-Package
+Overview
+Package
Class
Use
-Tree
+Tree
Deprecated
Index
Help
@@ -76,6 +77,244 @@
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Modifier and Type
+Constant Field
+Value
+
+
+
+
+
+ public static final long
+UNKNOWN_DATETIME
+0L
+
+
+
+
+ public static final long
+UNKNOWN_SIZE
+-1L
+
+
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Modifier and Type
+Constant Field
+Value
+
+
+
+
+
+ public static final String
+DEEP_TREE_MATCH
+"**"
+
+
+
+
+
+
+
+
+
@@ -102,16 +135,91 @@
+org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.createTempFile(String, String, File)
+since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.createTempFile(String, String, File, boolean)
+since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.equals(Dictionary, ?>, Dictionary, ?>)
+since 1.6.x.
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.equals(Vector>, Vector>)
+since 1.6.x.
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator.fileToURL(File)
+
+
+
+
org.owasp.dependencycheck.utils.FileUtils.getDataDirectory(String, Class)
This method should no longer be used. See the implementation in dependency-check-cli/App.java to see
how the data directory should be set.
+
+org.owasp.dependencycheck.org.apache.tools.ant.BuildException.getException()
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.getParentFile(File)
+
+
+
+
org.owasp.dependencycheck.utils.FileUtils.getPathToJar(Class)
this should no longer be used.
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.isSymbolicLink(File, String)
+use SymbolicLinkUtils instead
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.newFileUtils()
+since 1.7. Use getFileUtils instead, FileUtils do not have state.
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.putAll(Dictionary super K, ? super V>, Dictionary extends K, ? extends V>)
+since 1.6.x.
+
+
+
+
+
+
+
+
+
+
+
+
@@ -124,10 +232,11 @@
-Package
+Overview
+Package
Class
Use
-Tree
+Tree
Deprecated
Index
Help
diff --git a/dependency-check-utils/apidocs/help-doc.html b/dependency-check-utils/apidocs/help-doc.html
index 186a30b48..d3f127429 100644
--- a/dependency-check-utils/apidocs/help-doc.html
+++ b/dependency-check-utils/apidocs/help-doc.html
@@ -2,16 +2,16 @@
-
+
-API Help (Dependency-Check Utils 1.2.5 API)
-
+API Help (Dependency-Check Utils 1.2.6 API)
+
@@ -25,10 +25,11 @@
-Package
+Overview
+Package
Class
Use
-Tree
+Tree
Deprecated
Index
Help
@@ -69,6 +70,10 @@
+Overview
+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+
+
Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
@@ -174,10 +179,11 @@
-Package
+Overview
+Package
Class
Use
-Tree
+Tree
Deprecated
Index
Help
diff --git a/dependency-check-utils/apidocs/index-all.html b/dependency-check-utils/apidocs/index-all.html
index 80edd0f85..047300ed2 100644
--- a/dependency-check-utils/apidocs/index-all.html
+++ b/dependency-check-utils/apidocs/index-all.html
@@ -2,16 +2,16 @@
-
+
-Index (Dependency-Check Utils 1.2.5 API)
-
+Index (Dependency-Check Utils 1.2.6 API)
+
@@ -25,10 +25,11 @@
-A C D E F G I L M O P R S T U V
+A B C D E F G H I L M N O P R S T U V W
A
+add(E) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+add(int, E) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+This implementation may not add the element at the given index
+ if it is already contained in the collection.
+
+addAll(Collection<? extends E>) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+addAll(int, Collection<? extends E>) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+This implementation may not add all elements at the given index
+ if any of them are already contained in the collection.
+
+addDefaultExclude(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Add a pattern to the default excludes unless it is already a default exclude.
+
+addDefaultExcludes() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Add default exclusions to the current exclusions set.
+
+addDefaultExcludes() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Adds default exclusions to the current exclusions set.
+
+addElement(E) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+addExcludes(String[]) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Add to the list of exclude patterns to use.
+
ADDITIONAL_ZIP_EXTENSIONS - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The additional configured zip file extensions, if available.
@@ -83,6 +116,14 @@
The path to mono, if available.
+ ANALYZER_CENTRAL_ENABLED - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
+
+The properties key for whether the Central analyzer is enabled.
+
+ANALYZER_CENTRAL_URL - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
+
+The properties key for the Central search URL.
+
ANALYZER_JAR_ENABLED - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The properties key for whether the Jar Analyzer is enabled.
@@ -107,20 +148,114 @@
The properties key for whether the .NET Nuspec analyzer is enabled.
+ append(Enumeration<E>, Enumeration<E>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Append one enumeration to another.
+
+Appendable - Interface in org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+Interface to be implemented by "appendable" resources.
+
+areSame(File, File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Are the two File instances pointing to the same object on the file system?
+
+as(Class<T>) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Returns a view of this resource that implements the interface given as the argument or null if there is no such
+ view.
+
+asCollection(Iterator<? extends T>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Returns a collection containing all elements of the iterator.
+
+asEnumeration(Iterator<E>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Adapt the specified Iterator to the Enumeration interface.
+
+asIterator(Enumeration<E>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Adapt the specified Enumeration to the Iterator interface.
+
AUTO_UPDATE - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The properties key indicating whether or not the cached data sources should be updated.
+
+
+
+
B
+
+basedir - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The base directory to be scanned.
+
+BuildException - Exception in org.owasp.dependencycheck.org.apache.tools.ant
+
+Signals an error condition during a build
+
+BuildException() - Constructor for exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Constructs a build exception with no descriptive information.
+
+BuildException(String) - Constructor for exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Constructs an exception with the given descriptive message.
+
+BuildException(String, Throwable) - Constructor for exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Constructs an exception with the given message and exception as
+ a root cause.
+
+BuildException(String, Throwable, Location) - Constructor for exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Constructs an exception with the given message and exception as
+ a root cause and a location in a file.
+
+BuildException(Throwable) - Constructor for exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Constructs an exception with the given exception as a root cause.
+
+BuildException(String, Location) - Constructor for exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Constructs an exception with the given descriptive message and a
+ location in a file.
+
+BuildException(Throwable, Location) - Constructor for exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Constructs an exception with the given exception as
+ a root cause and a location in a file.
+
+
C
+checkAttributesAllowed() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+check that it is ok to set attributes, i.e that no reference is defined
+
+checkChildrenAllowed() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+check that it is ok to add children, i.e that no reference is defined
+
+checked - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+
+
Checksum - Class in org.owasp.dependencycheck.utils
Includes methods to generate the MD5 and SHA1 checksum.
+circularReference() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Creates an exception that indicates the user has generated a loop of data types referencing each other.
+
cleanup() - Static method in class org.owasp.dependencycheck.utils.Settings
Cleans up resources to prevent memory leaks.
@@ -129,10 +264,88 @@
Cleans up resources to prevent memory leaks.
+ clear() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+clearResults() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Clear the result caches for a scan.
+
+clone() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+clone() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+clone() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Clone this Resource.
+
+clone() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+close(Writer) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Close a Writer without throwing any exception if something went wrong.
+
+close(Reader) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Close a Reader without throwing any exception if something went wrong.
+
+close(OutputStream) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Close a stream without throwing any exception if something went wrong.
+
+close(InputStream) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Close a stream without throwing any exception if something went wrong.
+
+close(Channel) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Close a Channel without throwing any exception if something went wrong.
+
+close(URLConnection) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Closes an URLConnection if its concrete implementation provides a way to close it that Ant knows of.
+
+CollectionUtils - Class in org.owasp.dependencycheck.org.apache.tools.ant.util
+
+A set of helper methods related to collection manipulation.
+
+CollectionUtils() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+CollectionUtils.EmptyEnumeration <E > - Class in org.owasp.dependencycheck.org.apache.tools.ant.util
+
+An empty enumeration.
+
+CollectionUtils.EmptyEnumeration() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.EmptyEnumeration
+
+Constructor for the EmptyEnumeration
+
+compareTo(Resource) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Delegates to a comparison of names.
+
+compareTo(Resource) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Compare this FileResource to another Resource.
+
+Condition - Interface in org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+Interface for conditions to use inside the <condition> task.
+
CONNECTION_TIMEOUT - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The properties key for the connection timeout.
+contains(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+containsAll(Collection<?>) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+containsPattern(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+Does the tokenized pattern contain the given string?
+
+couldHoldIncluded(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a name matches the start of at least one include pattern.
+
createHttpURLConnection(URL) - Static method in class org.owasp.dependencycheck.utils.URLConnectionFactory
Utility method to create an HttpURLConnection.
@@ -141,6 +354,31 @@
Utility method to create an HttpURLConnection.
+ createNewFile(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+This was originally an emulation of File.createNewFile for JDK 1.1, but it is now implemented using that method
+ (Ant 1.6.3 onwards).
+
+createNewFile(File, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Create a new file, optionally creating parent directories.
+
+createTempFile(String, String, File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Deprecated.
+
since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+
+
+createTempFile(String, String, File, boolean, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Create a temporary file in a given directory.
+
+createTempFile(String, String, File, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Deprecated.
+
since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+
+
CVE_META_URL - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The properties key for the URL to retrieve the "meta" data from about the CVE entries.
@@ -181,6 +419,12 @@
The base path to use for the data directory (for embedded db).
+ DataType - Class in org.owasp.dependencycheck.org.apache.tools.ant.types
+
+Base class for those classes that can appear inside the build file as stand alone data types.
+
+DataType() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
DB_CONNECTION_STRING - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The database connection string.
@@ -209,10 +453,74 @@
The database schema version.
+ decodeUri(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Decodes an Uri with % characters.
+
+DEEP_TREE_MATCH - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+The pattern that matches an arbitrary number of directories.
+
+DEFAULTEXCLUDES - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+
+
+delete(File) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+
+
delete(File) - Static method in class org.owasp.dependencycheck.utils.FileUtils
Deletes a file.
+depth() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+The depth (or length) of a path.
+
+depth() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+The depth (or length) of a pattern.
+
+description - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Deprecated.
+
since 1.6.x. You should not be accessing this variable directly.
+
+
+DirectoryScanner - Class in org.owasp.dependencycheck.org.apache.tools.ant
+
+Class for scanning a directory for files/directories which match certain criteria.
+
+DirectoryScanner() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Sole constructor.
+
+dirsDeselected - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The directories which matched at least one include and no excludes but which a selector discarded.
+
+dirsExcluded - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The directories which matched at least one include and at least one exclude.
+
+dirsIncluded - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The directories which matched at least one include and no excludes and were selected.
+
+dirsNotIncluded - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The directories which were found and did not match any includes.
+
+dissect(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Dissect the specified absolute path.
+
+DOES_NOT_EXIST_POSTFIX - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The end of the exception message if something that should be there doesn't exist.
+
Downloader - Class in org.owasp.dependencycheck.utils
A utility to download files from the Internet.
@@ -243,6 +551,83 @@
E
+EMPTY_LIST - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Deprecated.
+
+EMPTY_PATH - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+Instance that holds no tokens at all.
+
+EMPTY_PATTERN - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+Instance that holds no tokens at all.
+
+encodeURI(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Encodes an Uri with % characters.
+
+endsWith(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+true if the last token equals the given string.
+
+equals(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+Equality operation.
+
+equals(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Implement basic Resource equality.
+
+equals(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Compare another Object to this FileResource for equality.
+
+equals(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+true if the original paths are equal.
+
+equals(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+true if the original patterns are equal.
+
+equals(Vector<?>, Vector<?>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Deprecated.
+
since 1.6.x.
+
+
+equals(Dictionary<?, ?>, Dictionary<?, ?>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Deprecated.
+
since 1.6.x.
+
+
+ERROR_NOT_FILE_URI - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Error string used when an invalid uri is seen
+
+errorOnMissingDir - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Whether a missing base directory is an error.
+
+eval() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition
+
+Is this condition true?
+
+eval() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Determines if the OS on which Ant is executing matches the type of
+ that set in setFamily.
+
+everythingIncluded - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Whether or not everything tested so far has been included.
+
+excludes - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The patterns for the files to be excluded.
+
ExtractionException - Exception in org.owasp.dependencycheck.utils
An exception used when a file is unable to be un-zipped.
@@ -269,6 +654,58 @@
F
+FAMILY_9X - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_DOS - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_MAC - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_NETWARE - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_NT - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_OS2 - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_OS400 - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_TANDEM - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_UNIX - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_VMS - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_WINDOWS - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAMILY_ZOS - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+OS family that can be tested for.
+
+FAT_FILE_TIMESTAMP_GRANULARITY - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+The granularity of timestamps under FAT.
+
fetchFile(URL, File) - Static method in class org.owasp.dependencycheck.utils.Downloader
Retrieves a file from a given URL and saves it to the outputPath.
@@ -277,16 +714,127 @@
Retrieves a file from a given URL and saves it to the outputPath.
+ fileNameEquals(File, File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Compares two filenames.
+
+FileProvider - Interface in org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+This is an interface that resources that can provide a file should implement.
+
+FileResource - Class in org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+A Resource representation of a File.
+
+FileResource() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Default constructor.
+
+FileResource(File, String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Construct a new FileResource using the specified basedir and relative name.
+
+FileResource(File) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Construct a new FileResource from a File.
+
+FileScanner - Interface in org.owasp.dependencycheck.org.apache.tools.ant
+
+An interface used to describe the actions required of any type of
+ directory scanner.
+
+filesDeselected - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The files which matched at least one include and no excludes and which a selector discarded.
+
+FileSelector - Interface in org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+This is the interface to be used by all selectors.
+
+filesExcluded - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The files which matched at least one include and at least one exclude.
+
+filesIncluded - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The files which matched at least one include and no excludes and were selected.
+
+filesNotIncluded - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The files which did not match any includes or selectors.
+
+fileToURL(File) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+
+
+FileUtils - Class in org.owasp.dependencycheck.org.apache.tools.ant.util
+
+This class also encapsulates methods which allow Files to be referred to using abstract path names which are
+ translated to native system file paths at runtime as well as copying files or setting their last modification time.
+
+FileUtils() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Empty constructor.
+
FileUtils - Class in org.owasp.dependencycheck.utils
A collection of utilities for processing information about files.
+findFile(File, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+From base traverse the filesystem in order to find
+ a file that matches the given name.
+
+flattenToString(Collection<?>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Creates a comma separated list of all values held in the given
+ collection.
+
+frequency(Collection<?>, Object) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Counts how often the given Object occurs in the given
+ collection using equals() for comparison.
+
+fromJarURI(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Crack a JAR URI.
+
+fromURI(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Constructs a file path from a file: URI.
+
+fromURI(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Constructs a file path from a file: URI.
+
G
+getAppendOutputStream() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable
+
+Get an appending OutputStream.
+
+getAppendOutputStream() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get an appending OutputStream.
+
+getBasedir() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the base directory to be scanned.
+
+getBasedir() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Returns the base directory to be scanned.
+
+getBaseDir() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Return the basedir to which the name is relative.
+
getBitBucket() - Static method in class org.owasp.dependencycheck.utils.FileUtils
Return the bit bucket for the OS.
@@ -304,6 +852,12 @@
Creates the cryptographic checksum of a given file using the specified algorithm.
+getClassSource(Class<?>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Find the directory or jar file the class has been loaded from.
+
+getColumnNumber() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
getConnectionString(String, String, String) - Static method in class org.owasp.dependencycheck.utils.Settings
Returns a connection string from the configured properties.
@@ -324,6 +878,70 @@
Returns a value from the properties file as a File object.
+ getDefaultEncoding() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Get the default encoding.
+
+getDefaultExcludes() - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Get the list of patterns that should be excluded by default.
+
+getDescription() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Returns the description of the current action.
+
+getDeselectedDirectories() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+
+ Return the names of the directories which were selected out and therefore not ultimately included.
+
+getDeselectedDirectories() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner
+
+Directories which were selected out of a scan.
+
+getDeselectedFiles() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+
+ Return the names of the files which were selected out and therefore not ultimately included.
+
+getDeselectedFiles() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner
+
+Files which were selected out of a scan.
+
+getException() - Method in exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+
+
+getExcludedDirectories() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the names of the directories which matched at least one of the include patterns and at least one of the
+ exclude patterns.
+
+getExcludedDirectories() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Returns the names of the directories which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+
+getExcludedFiles() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the names of the files which matched at least one of the include patterns and at least one of the exclude
+ patterns.
+
+getExcludedFiles() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Returns the names of the files which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+
+getFile() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider
+
+Get the file represented by this Resource.
+
+getFile() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get the file represented by this FileResource.
+
getFile(String) - Static method in class org.owasp.dependencycheck.utils.Settings
Returns a value from the properties file as a File object.
@@ -332,11 +950,65 @@
Returns the (lowercase) file extension for a specified file.
+ getFileName() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+getFileTimestampGranularity() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Get the granularity of file timestamps.
+
+getFileURL(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Get the URL for a file taking into account # characters.
+
+getFileUtils() - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Method to retrieve The FileUtils, which is shared by all users of this method.
+
getHex(byte[]) - Static method in class org.owasp.dependencycheck.utils.Checksum
Converts a byte array into a hex string.
+getIncludedDirectories() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the names of the directories which matched at least one of the include patterns and none of the exclude
+ patterns.
+
+getIncludedDirectories() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Returns the names of the directories which matched at least one of the
+ include patterns and none of the exclude patterns.
+
+getIncludedDirsCount() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the count of included directories.
+
+getIncludedFiles() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the names of the files which matched at least one of the include patterns and none of the exclude
+ patterns.
+
+getIncludedFiles() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Returns the names of the files which matched at least one of the
+ include patterns and none of the exclude patterns.
+
+getIncludedFilesCount() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the count of included files.
+
+getInputStream() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Get an InputStream for the Resource.
+
+getInputStream() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Return an InputStream for reading the contents of this Resource.
+
+getInstance() - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Retrieves the instance of the Singleton.
+
getInstance() - Static method in class org.owasp.dependencycheck.utils.Settings
Gets the underlying instance of the Settings object.
@@ -349,28 +1021,160 @@
Returns an int value from the properties file.
+ getLastModified() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Tells the modification time in milliseconds since 01.01.1970 (the "epoch").
+
+getLastModified() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get the modification time in milliseconds since 01.01.1970 .
+
getLastModified(URL) - Static method in class org.owasp.dependencycheck.utils.Downloader
Makes an HTTP Head request to retrieve the last modified date of the given URL.
+getLineNumber() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+getLocation() - Method in exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Returns the file location where the error occurred.
+
+getLocation() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Returns the file/location where this task was defined.
+
+getLocationURLs(File) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Get an array of URLs representing all of the jar files in the
+ given location.
+
+getLocationURLs(File, String[]) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Get an array of URLs representing all of the files of a given set of
+ extensions in the given location.
+
getLong(String) - Static method in class org.owasp.dependencycheck.utils.Settings
Returns a long value from the properties file.
+getMagicNumber(byte[]) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Create a "magic number" for use in hashCode calculations.
+
getMD5Checksum(File) - Static method in class org.owasp.dependencycheck.utils.Checksum
Calculates the MD5 checksum of a specified file.
+getName() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Name attribute will contain the path of a file relative to the root directory of its fileset or the recorded path
+ of a zip entry.
+
+getName() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get the name of this FileResource.
+
+getNotFollowedSymlinks() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Absolute paths of all symbolic links that haven't been followed but would have been followed had followsymlinks
+ been true or maxLevelsOfSymlinks been bigger.
+
+getNotIncludedDirectories() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the names of the directories which matched none of the include patterns.
+
+getNotIncludedDirectories() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Returns the names of the directories which matched none of the include
+ patterns.
+
+getNotIncludedFiles() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return the names of the files which matched none of the include patterns.
+
+getNotIncludedFiles() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Returns the names of the files which matched none of the include
+ patterns.
+
+getNotNullFile() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get the file represented by this FileResource, ensuring it is not null.
+
+getOutputStream() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Get an OutputStream for the Resource.
+
+getOutputStream() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get an OutputStream for the Resource.
+
+getParentFile(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+
+
+getPath(List) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Gets path from a List of Strings.
+
+getPath(List, char) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Gets path from a List of Strings.
+
+getPathStack(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Gets all names of the path as an array of Strings.
+
getPathToJar(Class) - Static method in class org.owasp.dependencycheck.utils.FileUtils
Deprecated.
this should no longer be used.
+getPattern() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+getRefid() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+get the reference set on this object
+
+getRefId() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Reference
+
+Get the reference id of this reference.
+
+getRelativePath(File, File) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Calculates the relative path between two files.
+
+getResource(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Get the named resource.
+
+getResource(String) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory
+
+Query a resource (file, zipentry, ...) by name
+
+getResource(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Create a new resource that matches a relative or absolute path.
+
+getResourceSource(ClassLoader, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Find the directory or jar a given resource has been loaded from.
+
getSHA1Checksum(File) - Static method in class org.owasp.dependencycheck.utils.Checksum
Calculates the SHA1 checksum of a specified file.
+getSize() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Get the size of this Resource.
+
+getSize() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get the size of this Resource.
+
getString(String, String) - Static method in class org.owasp.dependencycheck.utils.Settings
Returns a value from the properties file.
@@ -379,6 +1183,10 @@
Returns a value from the properties file.
+ getSymbolicLinkUtils() - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Method to retrieve The SymbolicLinkUtils, which is shared by all users of this method.
+
getTempDirectory() - Static method in class org.owasp.dependencycheck.utils.Settings
Returns the temporary directory.
@@ -387,12 +1195,61 @@
Generates a new temporary file name that is guaranteed to be unique.
+ getToolsJar() - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+Get the File necessary to load the Sun compiler tools.
+
+
+
+
+
+H
+
+hasErrorInCase(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+test whether a file or directory exists, with an error in the upper/lower case spelling of the name.
+
+hashCode() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+Hash operation.
+
+hashCode() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Get the hash code for this Resource.
+
+hashCode() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get the hash code for this Resource.
+
+hashCode() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+hashCode() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+hasMoreElements() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.EmptyEnumeration
+
+hasMoreTokens() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer
+
+Tests if there are more path elements available from this tokenizer's
+ path.
+
+hasWildcards(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Tests if a string contains stars or question marks
+
+haveSlowResults - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Whether or not our results were built by a slow scan.
+
I
+includes - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The patterns for the files to be included.
+
initialize() - Static method in class org.owasp.dependencycheck.utils.Settings
Initializes the thread local settings object.
@@ -401,6 +1258,8 @@
Initializes the thread local settings object.
+ insertElementAt(E, int) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
InvalidSettingException - Exception in org.owasp.dependencycheck.utils
An exception used when an error occurs reading a setting.
@@ -421,20 +1280,238 @@
Creates a new InvalidSettingException.
+ isAbsolutePath(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Verifies that the specified filename represents an absolute path.
+
+isArch(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Determines if the OS on which Ant is executing matches the
+ given OS architecture.
+
+isCaseSensitive - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Whether or not the file system should be treated as a case sensitive one.
+
+isCaseSensitive() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Find out whether include exclude patterns are matched in a case sensitive way.
+
+isChecked() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+The flag that is used to indicate that circular references have been checked.
+
+isContextRelativePath(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+On DOS and NetWare, the evaluation of certain file specifications is context-dependent.
+
+isDanglingSymbolicLink(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Checks whether a given file is a broken symbolic link.
+
+isDanglingSymbolicLink(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Checks whether a given file is a broken symbolic link.
+
+isDanglingSymbolicLink(File, String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Checks whether a given file is a broken symbolic link.
+
+isDirectory() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Tells if the resource is a directory.
+
+isDirectory() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Learn whether the resource is a directory.
+
+isEverythingIncluded() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Return whether or not the scanner has included all the files or directories it has come across so far.
+
+isExcluded(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a name matches against at least one exclude pattern.
+
+isExists() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+The exists attribute tells whether a resource exists.
+
+isExists() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Learn whether this file exists.
+
+isFamily(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Determines if the OS on which Ant is executing matches the
+ given OS family.
+
+isFilesystemOnly() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Fulfill the ResourceCollection contract.
+
+isFilesystemOnly() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection
+
+Indicate whether this ResourceCollection is composed entirely of
+ Resources accessible via local filesystem conventions.
+
+isFilesystemOnly() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Fulfill the ResourceCollection contract.
+
+isFollowSymlinks() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Get whether or not a DirectoryScanner follows symbolic links.
+
+isIncluded(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a name matches against at least one include pattern.
+
+isLeadingPath(File, File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Learn whether one path "leads" another.
+
isLoggable(LogRecord) - Method in class org.owasp.dependencycheck.utils.LogFilter
Determines if the record should be logged.
+isName(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Determines if the OS on which Ant is executing matches the
+ given OS name.
+
+isOs(String, String, String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Determines if the OS on which Ant is executing matches the
+ given OS family, name, architecture and version
+
+isOutOfDate(File, File, int) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Returns dependency information on these two files.
+
+isOutOfDate(Resource, Resource, int) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Returns dependency information on these two resources.
+
+isOutOfDate(Resource, Resource, long) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Returns dependency information on these two resources.
+
+isReference() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Has the refid attribute of this element been set?
+
+isSelected(String, File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether a file should be selected.
+
+isSelected(File, String, File) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector
+
+Method that each selector will implement to create their
+ selection behaviour.
+
+isSymbolicLink(File, String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Deprecated.
+
use SymbolicLinkUtils instead
+
+
+isSymbolicLink(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Checks whether a given file is a symbolic link.
+
+isSymbolicLink(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Checks whether a given file is a symbolic link.
+
+isSymbolicLink(File, String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Checks whether a given file is a symbolic link.
+
+isSymlink(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+Do we have to traverse a symlink when trying to reach path from
+ basedir?
+
+isUpToDate(File, File, long) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Returns true if the source is older than the dest.
+
+isUpToDate(File, File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Returns true if the source is older than the dest.
+
+isUpToDate(long, long, long) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Compare two timestamps for being up to date using the specified granularity.
+
+isUpToDate(long, long) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Compare two timestamps for being up to date using the current granularity.
+
isVerboseLoggingEnabled() - Static method in class org.owasp.dependencycheck.utils.LogUtils
Get the value of verboseLoggingEnabled.
+isVersion(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Determines if the OS on which Ant is executing matches the
+ given OS version.
+
+iterator() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Fulfill the ResourceCollection contract.
+
+iterator() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection
+
+Gets the contents of this collection.
+
L
+Location - Class in org.owasp.dependencycheck.org.apache.tools.ant
+
+Stores the location of a piece of text within a file (file name,
+ line number and column number).
+
+Location(String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+Creates a location consisting of a file name but no line number or
+ column number.
+
+Location(Locator) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+Creates a location from the SAX locator using the system ID as
+ the filename.
+
+Location(String, int, int) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+Creates a location consisting of a file name, line number and
+ column number.
+
+location - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+
+
+Locator - Class in org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+The Locator is a utility class which is used to find certain items
+ in the environment.
+
+log(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Logs a message with the default (INFO) priority.
+
+log(String, int) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Logs a message with the given priority.
+
LogFilter - Class in org.owasp.dependencycheck.utils
A simple log filter to limit the entries written to the verbose log file.
@@ -451,10 +1528,77 @@
M
+MAGIC - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Magic number
+
+match(String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a string matches against a pattern.
+
+match(String, String, boolean) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a string matches against a pattern.
+
+match(String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Tests whether or not a string matches against a pattern.
+
+match(String, String, boolean) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Tests whether or not a string matches against a pattern.
+
+matchPath(String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a given path matches a given pattern.
+
+matchPath(String, String, boolean) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a given path matches a given pattern.
+
+matchPath(String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Tests whether or not a given path matches a given pattern.
+
+matchPath(String, String, boolean) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Tests whether or not a given path matches a given pattern.
+
+matchPath(TokenizedPath, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+Tests whether or not a given path matches a given pattern.
+
+matchPatternStart(String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a given path matches the start of a given pattern up to the first "**".
+
+matchPatternStart(String, String, boolean) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Test whether or not a given path matches the start of a given pattern up to the first "**".
+
+matchPatternStart(String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Tests whether or not a given path matches the start of a given
+ pattern up to the first "**".
+
+matchPatternStart(String, String, boolean) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Tests whether or not a given path matches the start of a given
+ pattern up to the first "**".
+
+matchStartOf(TokenizedPath, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+Tests whether or not this pattern matches the start of
+ a path.
+
MAX_DOWNLOAD_THREAD_POOL_SIZE - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The maximum number of threads to allocate when downloading files.
+MAX_LEVELS_OF_SYMLINKS - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+
+
mergeProperties(File) - Static method in class org.owasp.dependencycheck.utils.Settings
Merges a new properties file into the current properties.
@@ -468,11 +1612,105 @@
Merges a new properties file into the current properties.
+
+
+
+N
+
+newFileUtils() - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Deprecated.
+
since 1.7. Use getFileUtils instead, FileUtils do not have state.
+
+
+nextElement() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.EmptyEnumeration
+
+nextToken() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer
+
+Returns the next path element from this tokenizer.
+
+noChildrenAllowed() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Creates an exception that indicates that this XML element must not have child elements if the refid attribute is
+ set.
+
+normalize(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+"Normalize" the given absolute path.
+
+NTFS_FILE_TIMESTAMP_GRANULARITY - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+The granularity of timestamps under the NT File System.
+
+
O
+org.owasp.dependencycheck.org.apache.tools.ant - package org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant
+
+
+ This is a copy of classes within Apache Ant.
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch - package org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+ This is a copy of classes within Apache Ant.
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition - package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+ This is a copy of classes within Apache Ant.
+
+org.owasp.dependencycheck.org.apache.tools.ant.types - package org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+ This is a copy of classes within Apache Ant.
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources - package org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+ This is a copy of classes within Apache Ant.
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors - package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+ This is a copy of classes within Apache Ant.
+
+org.owasp.dependencycheck.org.apache.tools.ant.util - package org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+ This is a copy of classes within Apache Ant.
+
org.owasp.dependencycheck.utils - package org.owasp.dependencycheck.utils
@@ -482,16 +1720,45 @@
Includes various utility classes such as a Settings wrapper, utilities to make URL Connections, etc.
+Os - Class in org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+Condition that tests the OS type.
+
+Os() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Default constructor
+
+Os(String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Constructor that sets the family attribute
+
P
+PathTokenizer - Class in org.owasp.dependencycheck.org.apache.tools.ant
+
+A Path tokenizer takes a path and returns the components that make up
+ that path.
+
+PathTokenizer(String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer
+
+Constructs a path tokenizer for the specified path.
+
prepareLogger(InputStream, String) - Static method in class org.owasp.dependencycheck.utils.LogUtils
Configures the logger for use by the application.
+ProjectComponent - Class in org.owasp.dependencycheck.org.apache.tools.ant
+
+Base class for components of a project, including tasks and data types.
+
+ProjectComponent() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Sole constructor.
+
PROXY_PASSWORD - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The properties key for the proxy password.
@@ -514,30 +1781,315 @@
The properties key for the proxy username.
+ putAll(Dictionary<? super K, ? super V>, Dictionary<? extends K, ? extends V>) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+Deprecated.
+
since 1.6.x.
+
+
R
+readFully(Reader) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Read from reader till EOF.
+
+readFully(Reader, int) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Read from reader till EOF.
+
+ref - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Deprecated.
+
since 1.7. The user should not be directly referencing variable. Please use DataType.getRefid()
+ instead.
+
+
+Reference - Class in org.owasp.dependencycheck.org.apache.tools.ant.types
+
+Class to hold a reference to another object in the project.
+
+Reference() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.Reference
+
+Deprecated.
+
since 1.7. Please use Reference#Reference(Project,String) instead.
+
+
+Reference(String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.Reference
+
+Deprecated.
+
since 1.7. Please use Reference#Reference(Project,String) instead.
+
+
+remove(int) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+remove(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+removeAll(Collection<?>) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+removeAllElements() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+removeDefaultExclude(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Remove a string if it is a default exclude.
+
+removeElement(Object) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+removeElementAt(int) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+removeLeadingPath(File, File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Removes a leading path from a second path.
+
removeProperty(String) - Static method in class org.owasp.dependencycheck.utils.Settings
Removes a property from the local properties collection.
+removeRange(int, int) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+removeWhitespace(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+"Flattens" a string by removing all whitespace (space, tab, linefeed,
+ carriage return, and formfeed).
+
+resetDefaultExcludes() - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Go back to the hardwired default exclude patterns.
+
+resolveFile(File, String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Interpret the filename as a file relative to the given file unless the filename already represents an absolute
+ filename.
+
+Resource - Class in org.owasp.dependencycheck.org.apache.tools.ant.types
+
+Describes a "File-like" resource (File, ZipEntry, etc.).
+
+Resource() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Default constructor.
+
+Resource(String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Only sets the name.
+
+Resource(String, boolean, long) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Sets the name, lastmodified flag, and exists flag.
+
+Resource(String, boolean, long, boolean) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Sets the name, lastmodified flag, exists flag, and directory flag.
+
+Resource(String, boolean, long, boolean, long) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Sets the name, lastmodified flag, exists flag, directory flag, and size.
+
+ResourceCollection - Interface in org.owasp.dependencycheck.org.apache.tools.ant.types
+
+Interface describing a collection of Resources.
+
+ResourceFactory - Interface in org.owasp.dependencycheck.org.apache.tools.ant.types
+
+this interface should be implemented by classes (Scanners) needing
+ to deliver information about resources.
+
+retainAll(Collection<?>) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+rtrimWildcardTokens(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+removes from a pattern all tokens to the right containing wildcards
+
+rtrimWildcardTokens() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+Returns a new TokenizedPath where all tokens of this pattern to
+ the right containing wildcards have been removed
+
S
+safeReadFully(Reader) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Safe read fully - do not return a null for an empty reader.
+
+scan() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Scan for files which match at least one include pattern and don't match any exclude patterns.
+
+scan() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Scans the base directory for files which match at least one include
+ pattern and don't match any exclude patterns.
+
+scandir(File, String, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Scan the given directory for files and directories.
+
+selectors - Variable in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Selectors that will filter which files are in our candidate list.
+
+SelectorScanner - Interface in org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+An interface used to describe the actions required by any type of
+ directory scanner that supports Selectors.
+
+SelectorUtils - Class in org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+This is a utility class used by selectors and DirectoryScanner.
+
+set(int, E) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+setArch(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Sets the desired OS architecture
+
+setBasedir(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Set the base directory to be scanned.
+
+setBasedir(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Set the base directory to be scanned.
+
+setBasedir(String) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Sets the base directory to be scanned.
+
+setBasedir(File) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Sets the base directory to be scanned.
+
+setBaseDir(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Set the basedir for this FileResource.
+
setBoolean(String, boolean) - Static method in class org.owasp.dependencycheck.utils.Settings
Sets a property value.
+setCaseSensitive(boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Set whether or not include and exclude patterns are matched in a case sensitive way.
+
+setCaseSensitive(boolean) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Sets whether or not the file system should be regarded as case sensitive.
+
+setChecked(boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Set the flag that is used to indicate that circular references have been checked.
+
+setDescription(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Sets a description of the current action.
+
+setDirectory(boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Set the directory attribute.
+
+setElementAt(E, int) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+setErrorOnMissingDir(boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Sets whether or not a missing base directory is an error
+
+setExcludes(String[]) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Set the list of exclude patterns to use.
+
+setExcludes(String[]) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Sets the list of exclude patterns to use.
+
+setExists(boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Set the exists attribute.
+
+setFamily(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Sets the desired OS family type
+
+setFile(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Set the File for this FileResource.
+
+setFollowSymlinks(boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Set whether or not symbolic links should be followed.
+
+setIncludes(String[]) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Set the list of include patterns to use.
+
+setIncludes(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+setIncludes(String[]) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+Sets the list of include patterns to use.
+
setInstance(Settings) - Static method in class org.owasp.dependencycheck.utils.Settings
Sets the instance of the Settings object to use in this thread.
+setLastModified(long) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Set the last modification attribute.
+
+setLocation(Location) - Method in exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Sets the file location where the error occurred.
+
+setLocation(Location) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+Sets the file/location where this task was defined.
+
+setMaxLevelsOfSymlinks(int) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+The maximum number of times a symbolic link may be followed during a scan.
+
+setName(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Sets the desired OS name
+
+setName(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Set the name of this Resource.
+
+setRefid(Reference) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Set the value of the refid attribute.
+
+setRefId(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Reference
+
+Set the reference id.
+
+setRefid(Reference) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Overrides the base version.
+
+setRefid(Reference) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Overrides the super version.
+
+setSelectors(FileSelector[]) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Set the selectors that will select the filelist.
+
+setSelectors(FileSelector[]) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner
+
+Sets the selectors the scanner should use.
+
+setSize(long) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Set the size of this Resource.
+
setString(String, String) - Static method in class org.owasp.dependencycheck.utils.Settings
Sets a property value.
@@ -550,6 +2102,18 @@
The collection of keys used within the properties file.
+ setVersion(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+Sets the desired OS version
+
+size() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Fulfill the ResourceCollection contract.
+
+size() - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection
+
+Learn the number of contained Resources.
+
SKIP_PROVIDED_SCOPE - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The properties key for whether Provided Scope dependencies should be skipped.
@@ -562,10 +2126,23 @@
The properties key for whether Test Scope dependencies should be skipped.
+ slowScan() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+Top level invocation for a slow scan.
+
SUPPRESSION_FILE - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The key for a list of suppression files.
+SymbolicLinkUtils - Class in org.owasp.dependencycheck.org.apache.tools.ant.util
+
+Contains methods related to symbolic links - or what Ant thinks is a symbolic link based on the absent support for
+ them in Java.
+
+SymbolicLinkUtils() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+Empty constructor.
+
@@ -576,12 +2153,131 @@
The location of the temporary directory.
+TokenizedPath - Class in org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+Container for a path that has been split into its components.
+
+TokenizedPath(String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+Initialize the TokenizedPath by parsing it.
+
+TokenizedPath(TokenizedPath, String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+Creates a new path as a child of another path.
+
+TokenizedPattern - Class in org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+Provides reusable path pattern matching.
+
+TokenizedPattern(String) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+Initialize the PathPattern by parsing it.
+
+tokenizePath(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Breaks a path up into a Vector of path elements, tokenizing on
+ File.separator.
+
+tokenizePath(String, String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+Breaks a path up into a Vector of path elements, tokenizing on
+
+toLongString() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Get a long String representation of this Resource.
+
+tooManyAttributes() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Creates an exception that indicates that refid has to be the only attribute if it is set.
+
+toPattern() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+Creates a TokenizedPattern from the same tokens that make up
+ this path.
+
+toString() - Method in exception org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+Returns the location of the error and the error message.
+
+toString() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+Returns the file name, line number, a colon and a trailing space.
+
+toString() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+Basic DataType toString().
+
+toString() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Get the string representation of this Resource.
+
+toString() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Get the string representation of this Resource.
+
+toString() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+toString() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+touch(long) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+Implement the Touchable interface.
+
+touch(long) - Method in interface org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable
+
+Method called to "touch" the resource.
+
+Touchable - Interface in org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+Interface to be implemented by "touchable" resources;
+ that is, those whose modification time can be altered.
+
+toURI(String) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Constructs a file: URI that represents the external form of the given pathname.
+
+toVMSPath(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Returns a VMS String representation of a File object.
+
+translatePath(String) - Static method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Translate a path into its native (platform specific) format.
+
+tryHardToDelete(File) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+Accommodate Windows bug encountered in both Sun and IBM JDKs.
+
+tryHardToDelete(File, boolean) - Method in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+If delete does not work, call System.gc() if asked to, wait a little and try again.
+
U
+UNIX_FILE_TIMESTAMP_GRANULARITY - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+The granularity of timestamps under Unix.
+
+UNKNOWN_DATETIME - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Constant unknown datetime for getLastModified
+
+UNKNOWN_LOCATION - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+Location to use when one is needed but no information is available
+
+UNKNOWN_SIZE - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+Constant unknown size
+
+URI_ENCODING - Static variable in class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+encoding used to represent URIs
+
URLConnectionFactory - Class in org.owasp.dependencycheck.utils
A URLConnection Factory to create new connections.
@@ -612,6 +2308,20 @@
V
+VectorSet <E > - Class in org.owasp.dependencycheck.org.apache.tools.ant.util
+
+Subclass of Vector that won't store duplicate entries and shows
+ HashSet's constant time performance characteristics for the
+ contains method.
+
+VectorSet() - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+VectorSet(int) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+VectorSet(int, int) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+VectorSet(Collection<? extends E>) - Constructor for class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
VFEED_CONNECTION_STRING - Static variable in class org.owasp.dependencycheck.utils.Settings.KEYS
The key to obtain the VFEED connection string.
@@ -633,7 +2343,17 @@
The key to obtain the VFeed update status.
-A C D E F G I L M O P R S T U V
+
+
+
+
W
+
+withoutLastToken() - Method in class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+Returns a new pattern without the last token of this pattern.
+
+
+
A B C D E F G H I L M N O P R S T U V W
@@ -641,10 +2361,11 @@
-Package
+Overview
+Package
Class
Use
-Tree
+Tree
Deprecated
Index
Help
diff --git a/dependency-check-utils/apidocs/index.html b/dependency-check-utils/apidocs/index.html
index ace6d9f42..2fc7e79fc 100644
--- a/dependency-check-utils/apidocs/index.html
+++ b/dependency-check-utils/apidocs/index.html
@@ -2,9 +2,9 @@
-
+
-Dependency-Check Utils 1.2.5 API
+Dependency-Check Utils 1.2.6 API
+
+
-
+
+
JavaScript is disabled on your browser.
Frame Alert
-This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version .
+This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version .
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/BuildException.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/BuildException.html
new file mode 100644
index 000000000..5035aab94
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/BuildException.html
@@ -0,0 +1,477 @@
+
+
+
+
+
+
+BuildException (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+BuildException ()
+Constructs a build exception with no descriptive information.
+
+
+
+BuildException (String message)
+Constructs an exception with the given descriptive message.
+
+
+
+BuildException (String message,
+ Location location)
+Constructs an exception with the given descriptive message and a
+ location in a file.
+
+
+
+BuildException (String message,
+ Throwable cause)
+Constructs an exception with the given message and exception as
+ a root cause.
+
+
+
+BuildException (String msg,
+ Throwable cause,
+ Location location)
+Constructs an exception with the given message and exception as
+ a root cause and a location in a file.
+
+
+
+BuildException (Throwable cause)
+Constructs an exception with the given exception as a root cause.
+
+
+
+BuildException (Throwable cause,
+ Location location)
+Constructs an exception with the given exception as
+ a root cause and a location in a file.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+Methods inherited from class java.lang.Throwable
+addSuppressed , fillInStackTrace , getCause , getLocalizedMessage , getMessage , getStackTrace , getSuppressed , initCause , printStackTrace , printStackTrace , printStackTrace , setStackTrace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+BuildException
+public BuildException(String message,
+ Throwable cause)
+Constructs an exception with the given message and exception as
+ a root cause.
+Parameters: message - A description of or information about the exception.
+ Should not be null unless a cause is specified.cause - The exception that might have caused this one.
+ May be null.
+
+
+
+
+
+
+
+BuildException
+public BuildException(String msg,
+ Throwable cause,
+ Location location)
+Constructs an exception with the given message and exception as
+ a root cause and a location in a file.
+Parameters: msg - A description of or information about the exception.
+ Should not be null unless a cause is specified.cause - The exception that might have caused this one.
+ May be null.location - The location in the project file where the error
+ occurred. Must not be null.
+
+
+
+
+
+
+
+
+
+
+
+BuildException
+public BuildException(String message,
+ Location location)
+Constructs an exception with the given descriptive message and a
+ location in a file.
+Parameters: message - A description of or information about the exception.
+ Should not be null.location - The location in the project file where the error
+ occurred. Must not be null.
+
+
+
+
+
+
+
+BuildException
+public BuildException(Throwable cause,
+ Location location)
+Constructs an exception with the given exception as
+ a root cause and a location in a file.
+Parameters: cause - The exception that might have caused this one.
+ Should not be null.location - The location in the project file where the error
+ occurred. Must not be null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScanner.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScanner.html
new file mode 100644
index 000000000..2d34f5f7e
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScanner.html
@@ -0,0 +1,1617 @@
+
+
+
+
+
+
+DirectoryScanner (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+protected File
+basedir
+The base directory to be scanned.
+
+
+
+protected static String []
+DEFAULTEXCLUDES
+
+
+
+
+protected Vector <String >
+dirsDeselected
+The directories which matched at least one include and no excludes but which a selector discarded.
+
+
+
+protected Vector <String >
+dirsExcluded
+The directories which matched at least one include and at least one exclude.
+
+
+
+protected Vector <String >
+dirsIncluded
+The directories which matched at least one include and no excludes and were selected.
+
+
+
+protected Vector <String >
+dirsNotIncluded
+The directories which were found and did not match any includes.
+
+
+
+static String
+DOES_NOT_EXIST_POSTFIX
+The end of the exception message if something that should be there doesn't exist.
+
+
+
+protected boolean
+errorOnMissingDir
+Whether a missing base directory is an error.
+
+
+
+protected boolean
+everythingIncluded
+Whether or not everything tested so far has been included.
+
+
+
+protected String []
+excludes
+The patterns for the files to be excluded.
+
+
+
+protected Vector <String >
+filesDeselected
+The files which matched at least one include and no excludes and which a selector discarded.
+
+
+
+protected Vector <String >
+filesExcluded
+The files which matched at least one include and at least one exclude.
+
+
+
+protected Vector <String >
+filesIncluded
+The files which matched at least one include and no excludes and were selected.
+
+
+
+protected Vector <String >
+filesNotIncluded
+The files which did not match any includes or selectors.
+
+
+
+protected boolean
+haveSlowResults
+Whether or not our results were built by a slow scan.
+
+
+
+protected String []
+includes
+The patterns for the files to be included.
+
+
+
+protected boolean
+isCaseSensitive
+Whether or not the file system should be treated as a case sensitive one.
+
+
+
+static int
+MAX_LEVELS_OF_SYMLINKS
+
+
+
+
+protected FileSelector []
+selectors
+Selectors that will filter which files are in our candidate list.
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+DirectoryScanner ()
+Sole constructor.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+static boolean
+addDefaultExclude (String s)
+Add a pattern to the default excludes unless it is already a default exclude.
+
+
+
+void
+addDefaultExcludes ()
+Add default exclusions to the current exclusions set.
+
+
+
+void
+addExcludes (String [] excludes)
+Add to the list of exclude patterns to use.
+
+
+
+protected void
+clearResults ()
+Clear the result caches for a scan.
+
+
+
+protected boolean
+couldHoldIncluded (String name)
+Test whether or not a name matches the start of at least one include pattern.
+
+
+
+File
+getBasedir ()
+Return the base directory to be scanned.
+
+
+
+static String []
+getDefaultExcludes ()
+Get the list of patterns that should be excluded by default.
+
+
+
+String []
+getDeselectedDirectories ()
+
+ Return the names of the directories which were selected out and therefore not ultimately included.
+
+
+
+String []
+getDeselectedFiles ()
+
+ Return the names of the files which were selected out and therefore not ultimately included.
+
+
+
+String []
+getExcludedDirectories ()
+Return the names of the directories which matched at least one of the include patterns and at least one of the
+ exclude patterns.
+
+
+
+String []
+getExcludedFiles ()
+Return the names of the files which matched at least one of the include patterns and at least one of the exclude
+ patterns.
+
+
+
+String []
+getIncludedDirectories ()
+Return the names of the directories which matched at least one of the include patterns and none of the exclude
+ patterns.
+
+
+
+int
+getIncludedDirsCount ()
+Return the count of included directories.
+
+
+
+String []
+getIncludedFiles ()
+Return the names of the files which matched at least one of the include patterns and none of the exclude
+ patterns.
+
+
+
+int
+getIncludedFilesCount ()
+Return the count of included files.
+
+
+
+String []
+getNotFollowedSymlinks ()
+Absolute paths of all symbolic links that haven't been followed but would have been followed had followsymlinks
+ been true or maxLevelsOfSymlinks been bigger.
+
+
+
+String []
+getNotIncludedDirectories ()
+Return the names of the directories which matched none of the include patterns.
+
+
+
+String []
+getNotIncludedFiles ()
+Return the names of the files which matched none of the include patterns.
+
+
+
+Resource
+getResource (String name)
+Get the named resource.
+
+
+
+boolean
+isCaseSensitive ()
+Find out whether include exclude patterns are matched in a case sensitive way.
+
+
+
+boolean
+isEverythingIncluded ()
+Return whether or not the scanner has included all the files or directories it has come across so far.
+
+
+
+protected boolean
+isExcluded (String name)
+Test whether or not a name matches against at least one exclude pattern.
+
+
+
+boolean
+isFollowSymlinks ()
+Get whether or not a DirectoryScanner follows symbolic links.
+
+
+
+protected boolean
+isIncluded (String name)
+Test whether or not a name matches against at least one include pattern.
+
+
+
+protected boolean
+isSelected (String name,
+ File file)
+Test whether a file should be selected.
+
+
+
+static boolean
+match (String pattern,
+ String str)
+Test whether or not a string matches against a pattern.
+
+
+
+protected static boolean
+match (String pattern,
+ String str,
+ boolean isCaseSensitive)
+Test whether or not a string matches against a pattern.
+
+
+
+protected static boolean
+matchPath (String pattern,
+ String str)
+Test whether or not a given path matches a given pattern.
+
+
+
+protected static boolean
+matchPath (String pattern,
+ String str,
+ boolean isCaseSensitive)
+Test whether or not a given path matches a given pattern.
+
+
+
+protected static boolean
+matchPatternStart (String pattern,
+ String str)
+Test whether or not a given path matches the start of a given pattern up to the first "**".
+
+
+
+protected static boolean
+matchPatternStart (String pattern,
+ String str,
+ boolean isCaseSensitive)
+Test whether or not a given path matches the start of a given pattern up to the first "**".
+
+
+
+static boolean
+removeDefaultExclude (String s)
+Remove a string if it is a default exclude.
+
+
+
+static void
+resetDefaultExcludes ()
+Go back to the hardwired default exclude patterns.
+
+
+
+void
+scan ()
+Scan for files which match at least one include pattern and don't match any exclude patterns.
+
+
+
+protected void
+scandir (File dir,
+ String vpath,
+ boolean fast)
+Scan the given directory for files and directories.
+
+
+
+void
+setBasedir (File basedir)
+Set the base directory to be scanned.
+
+
+
+void
+setBasedir (String basedir)
+Set the base directory to be scanned.
+
+
+
+void
+setCaseSensitive (boolean isCaseSensitive)
+Set whether or not include and exclude patterns are matched in a case sensitive way.
+
+
+
+void
+setErrorOnMissingDir (boolean errorOnMissingDir)
+Sets whether or not a missing base directory is an error
+
+
+
+void
+setExcludes (String [] excludes)
+Set the list of exclude patterns to use.
+
+
+
+void
+setFollowSymlinks (boolean followSymlinks)
+Set whether or not symbolic links should be followed.
+
+
+
+void
+setIncludes (String include)
+
+
+void
+setIncludes (String [] includes)
+Set the list of include patterns to use.
+
+
+
+void
+setMaxLevelsOfSymlinks (int max)
+The maximum number of times a symbolic link may be followed during a scan.
+
+
+
+void
+setSelectors (FileSelector [] selectors)
+Set the selectors that will select the filelist.
+
+
+
+protected void
+slowScan ()
+Top level invocation for a slow scan.
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+matchPath
+protected static boolean matchPath(String pattern,
+ String str)
+Test whether or not a given path matches a given pattern.
+Parameters: pattern - The pattern to match against. Must not be null.str - The path to match, as a String. Must not be null.
+Returns: true if the pattern matches against the string, or false otherwise.
+
+
+
+
+
+
+
+matchPath
+protected static boolean matchPath(String pattern,
+ String str,
+ boolean isCaseSensitive)
+Test whether or not a given path matches a given pattern.
+Parameters: pattern - The pattern to match against. Must not be null.str - The path to match, as a String. Must not be null.isCaseSensitive - Whether or not matching should be performed case sensitively.
+Returns: true if the pattern matches against the string, or false otherwise.
+
+
+
+
+
+
+
+match
+public static boolean match(String pattern,
+ String str)
+Test whether or not a string matches against a pattern. The pattern may contain two special characters:
+ '*' means zero or more characters
+ '?' means one and only one character
+Parameters: pattern - The pattern to match against. Must not be null.str - The string which must be matched against the pattern. Must not be null.
+Returns: true if the string matches against the pattern, or false otherwise.
+
+
+
+
+
+
+
+match
+protected static boolean match(String pattern,
+ String str,
+ boolean isCaseSensitive)
+Test whether or not a string matches against a pattern. The pattern may contain two special characters:
+ '*' means zero or more characters
+ '?' means one and only one character
+Parameters: pattern - The pattern to match against. Must not be null.str - The string which must be matched against the pattern. Must not be null.isCaseSensitive - Whether or not matching should be performed case sensitively.
+Returns: true if the string matches against the pattern, or false otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+setBasedir
+public void setBasedir(String basedir)
+Set the base directory to be scanned. This is the directory which is scanned recursively. All '/' and '\'
+ characters are replaced by File.separatorChar, so the separator used need not match
+ File.separatorChar.
+
+Specified by:
+setBasedir in interface FileScanner
+Parameters: basedir - The base directory to scan.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+scan
+public void scan()
+ throws IllegalStateException
+Scan for files which match at least one include pattern and don't match any exclude patterns. If there are
+ selectors then the files must pass muster there, as well. Scans under basedir, if set; otherwise the include
+ patterns without leading wildcards specify the absolute paths of the files that may be included.
+
+Specified by:
+scan in interface FileScanner
+Throws:
+IllegalStateException - if the base directory was set incorrectly (i.e. if it doesn't exist or isn't a
+ directory).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+scandir
+protected void scandir(File dir,
+ String vpath,
+ boolean fast)
+Scan the given directory for files and directories. Found files and directories are placed in their respective
+ collections, based on the matching of includes, excludes, and the selectors. When a directory is found, it is
+ scanned recursively.
+Parameters: dir - The directory to scan. Must not be null.vpath - The path relative to the base directory (needed to prevent problems with an absolute path when using
+ dir). Must not be null.fast - Whether or not this call is part of a fast scan.See Also: filesIncluded ,
+filesNotIncluded ,
+filesExcluded ,
+dirsIncluded ,
+dirsNotIncluded ,
+dirsExcluded ,
+slowScan()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+getNotIncludedFiles
+public String [] getNotIncludedFiles()
+Return the names of the files which matched none of the include patterns. The names are relative to the base
+ directory. This involves performing a slow scan if one has not already been completed.
+
+Specified by:
+getNotIncludedFiles in interface FileScanner
+Returns: the names of the files which matched none of the include patterns. See Also: slowScan()
+
+
+
+
+
+
+
+getExcludedFiles
+public String [] getExcludedFiles()
+Return the names of the files which matched at least one of the include patterns and at least one of the exclude
+ patterns. The names are relative to the base directory. This involves performing a slow scan if one has not
+ already been completed.
+
+Specified by:
+getExcludedFiles in interface FileScanner
+Returns: the names of the files which matched at least one of the include patterns and at least one of the exclude
+ patterns. See Also: slowScan()
+
+
+
+
+
+
+
+
+
+
+
+getIncludedDirectories
+public String [] getIncludedDirectories()
+Return the names of the directories which matched at least one of the include patterns and none of the exclude
+ patterns. The names are relative to the base directory.
+
+Specified by:
+getIncludedDirectories in interface FileScanner
+Returns: the names of the directories which matched at least one of the include patterns and none of the exclude
+ patterns.
+
+
+
+
+
+
+
+
+
+
+
+getNotIncludedDirectories
+public String [] getNotIncludedDirectories()
+Return the names of the directories which matched none of the include patterns. The names are relative to the
+ base directory. This involves performing a slow scan if one has not already been completed.
+
+Specified by:
+getNotIncludedDirectories in interface FileScanner
+Returns: the names of the directories which matched none of the include patterns. See Also: slowScan()
+
+
+
+
+
+
+
+getExcludedDirectories
+public String [] getExcludedDirectories()
+Return the names of the directories which matched at least one of the include patterns and at least one of the
+ exclude patterns. The names are relative to the base directory. This involves performing a slow scan if one has
+ not already been completed.
+
+Specified by:
+getExcludedDirectories in interface FileScanner
+Returns: the names of the directories which matched at least one of the include patterns and at least one of the
+ exclude patterns. See Also: slowScan()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/FileScanner.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/FileScanner.html
new file mode 100644
index 000000000..63b47add4
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/FileScanner.html
@@ -0,0 +1,481 @@
+
+
+
+
+
+
+FileScanner (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+void
+addDefaultExcludes ()
+Adds default exclusions to the current exclusions set.
+
+
+
+File
+getBasedir ()
+Returns the base directory to be scanned.
+
+
+
+String []
+getExcludedDirectories ()
+Returns the names of the directories which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+
+
+
+String []
+getExcludedFiles ()
+Returns the names of the files which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+
+
+
+String []
+getIncludedDirectories ()
+Returns the names of the directories which matched at least one of the
+ include patterns and none of the exclude patterns.
+
+
+
+String []
+getIncludedFiles ()
+Returns the names of the files which matched at least one of the
+ include patterns and none of the exclude patterns.
+
+
+
+String []
+getNotIncludedDirectories ()
+Returns the names of the directories which matched none of the include
+ patterns.
+
+
+
+String []
+getNotIncludedFiles ()
+Returns the names of the files which matched none of the include
+ patterns.
+
+
+
+void
+scan ()
+Scans the base directory for files which match at least one include
+ pattern and don't match any exclude patterns.
+
+
+
+void
+setBasedir (File basedir)
+Sets the base directory to be scanned.
+
+
+
+void
+setBasedir (String basedir)
+Sets the base directory to be scanned.
+
+
+
+void
+setCaseSensitive (boolean isCaseSensitive)
+Sets whether or not the file system should be regarded as case sensitive.
+
+
+
+void
+setExcludes (String [] excludes)
+Sets the list of exclude patterns to use.
+
+
+
+void
+setIncludes (String [] includes)
+Sets the list of include patterns to use.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+getExcludedDirectories
+String [] getExcludedDirectories()
+Returns the names of the directories which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+ The names are relative to the base directory.
+Returns: the names of the directories which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+
+
+
+
+
+
+
+getExcludedFiles
+String [] getExcludedFiles()
+Returns the names of the files which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+ The names are relative to the base directory.
+Returns: the names of the files which matched at least one of the
+ include patterns and at least one of the exclude patterns.
+
+
+
+
+
+
+
+getIncludedDirectories
+String [] getIncludedDirectories()
+Returns the names of the directories which matched at least one of the
+ include patterns and none of the exclude patterns.
+ The names are relative to the base directory.
+Returns: the names of the directories which matched at least one of the
+ include patterns and none of the exclude patterns.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+setBasedir
+void setBasedir(String basedir)
+Sets the base directory to be scanned. This is the directory which is
+ scanned recursively. All '/' and '\' characters should be replaced by
+ File.separatorChar, so the separator used need not match
+ File.separatorChar.
+Parameters: basedir - The base directory to scan.
+ Must not be null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/Location.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/Location.html
new file mode 100644
index 000000000..982060f93
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/Location.html
@@ -0,0 +1,459 @@
+
+
+
+
+
+
+Location (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+
+
+
+
+
+
+All Implemented Interfaces:
+Serializable
+
+
+
+public class Location
+extends Object
+implements Serializable
+Stores the location of a piece of text within a file (file name,
+ line number and column number). Note that the column number is
+ currently ignored.
+See Also: Serialized Form
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+static Location
+UNKNOWN_LOCATION
+Location to use when one is needed but no information is available
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+Location (Locator loc)
+Creates a location from the SAX locator using the system ID as
+ the filename.
+
+
+
+Location (String fileName)
+Creates a location consisting of a file name but no line number or
+ column number.
+
+
+
+Location (String fileName,
+ int lineNumber,
+ int columnNumber)
+Creates a location consisting of a file name, line number and
+ column number.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+Location
+public Location(String fileName,
+ int lineNumber,
+ int columnNumber)
+Creates a location consisting of a file name, line number and
+ column number.
+Parameters: fileName - The name of the file. May be null,
+ in which case the location is equivalent to
+ UNKNOWN_LOCATION .lineNumber - Line number within the file. Use 0 for unknown
+ positions within a file.columnNumber - Column number within the line.
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+toString
+public String toString()
+Returns the file name, line number, a colon and a trailing space.
+ An error message can be appended easily. For unknown locations, an
+ empty string is returned.
+
+Overrides:
+toString in class Object
+Returns: a String of the form "fileName:lineNumber: "
+ if both file name and line number are known,
+ "fileName: " if only the file name is known,
+ and the empty string for unknown locations.
+
+
+
+
+
+
+
+
+
+
+
+hashCode
+public int hashCode()
+Hash operation.
+
+Overrides:
+hashCode in class Object
+Returns: a hash code value for this location. Since:
+ Ant 1.6.3
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/PathTokenizer.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/PathTokenizer.html
new file mode 100644
index 000000000..b35f4451c
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/PathTokenizer.html
@@ -0,0 +1,296 @@
+
+
+
+
+
+
+PathTokenizer (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer
+
+
+
+
+
+
+
+
+public class PathTokenizer
+extends Object
+A Path tokenizer takes a path and returns the components that make up
+ that path.
+
+ The path can use path separators of either ':' or ';' and file separators
+ of either '/' or '\'.
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+PathTokenizer (String path)
+Constructs a path tokenizer for the specified path.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+boolean
+hasMoreTokens ()
+Tests if there are more path elements available from this tokenizer's
+ path.
+
+
+
+String
+nextToken ()
+Returns the next path element from this tokenizer.
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+hasMoreTokens
+public boolean hasMoreTokens()
+Tests if there are more path elements available from this tokenizer's
+ path. If this method returns true, then a subsequent call
+ to nextToken will successfully return a token.
+Returns: true if and only if there is at least one token
+ in the string after the current position; false otherwise.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/ProjectComponent.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/ProjectComponent.html
new file mode 100644
index 000000000..60b1bc63f
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/ProjectComponent.html
@@ -0,0 +1,449 @@
+
+
+
+
+
+
+ProjectComponent (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+
+
+
+
+
+
+All Implemented Interfaces:
+Cloneable
+
+
+Direct Known Subclasses:
+DataType
+
+
+
+public abstract class ProjectComponent
+extends Object
+implements Cloneable
+Base class for components of a project, including tasks and data types. Provides common facilities.
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+protected String
+description
+Deprecated.
+
since 1.6.x. You should not be accessing this variable directly.
+
+
+
+
+protected Location
+location
+Deprecated.
+
since 1.6.x. You should not be accessing this variable directly. Please use the
+ getLocation() method.
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+ProjectComponent ()
+Sole constructor.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+Object
+clone ()
+
+
+String
+getDescription ()
+Returns the description of the current action.
+
+
+
+Location
+getLocation ()
+Returns the file/location where this task was defined.
+
+
+
+void
+log (String msg)
+Logs a message with the default (INFO) priority.
+
+
+
+void
+log (String msg,
+ int msgLevel)
+Logs a message with the given priority.
+
+
+
+void
+setDescription (String desc)
+Sets a description of the current action.
+
+
+
+void
+setLocation (Location location)
+Sets the file/location where this task was defined.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+description
+protected String description
+Deprecated. since 1.6.x. You should not be accessing this variable directly.
+Description of this component, if any.
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/BuildException.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/BuildException.html
new file mode 100644
index 000000000..22cabfc04
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/BuildException.html
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.BuildException (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/DirectoryScanner.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/DirectoryScanner.html
new file mode 100644
index 000000000..615957ff0
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/DirectoryScanner.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/FileScanner.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/FileScanner.html
new file mode 100644
index 000000000..fb8988095
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/FileScanner.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.FileScanner (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/Location.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/Location.html
new file mode 100644
index 000000000..010e6c97e
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/Location.html
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.Location (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/PathTokenizer.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/PathTokenizer.html
new file mode 100644
index 000000000..459c9c593
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/PathTokenizer.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/ProjectComponent.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/ProjectComponent.html
new file mode 100644
index 000000000..380a14957
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/class-use/ProjectComponent.html
@@ -0,0 +1,203 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/Locator.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/Locator.html
new file mode 100644
index 000000000..d9c0030b8
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/Locator.html
@@ -0,0 +1,528 @@
+
+
+
+
+
+
+Locator (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+Prev Class
+Next Class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+static String
+ERROR_NOT_FILE_URI
+Error string used when an invalid uri is seen
+
+
+
+static String
+URI_ENCODING
+encoding used to represent URIs
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+getResourceSource
+public static File getResourceSource(ClassLoader c,
+ String resource)
+Find the directory or jar a given resource has been loaded from.
+Parameters: c - the classloader to be consulted for the source.resource - the resource whose location is required.
+Returns: the file with the resource source or null if
+ we cannot determine the location. Since:
+ Ant 1.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+fileToURL
+@Deprecated
+public static URL fileToURL(File file)
+ throws MalformedURLException
+
+Convert a File to a URL.
+ File.toURL() does not encode characters like #.
+ File.toURI() has been introduced in java 1.4, so
+ Ant cannot use it (except by reflection)
+ FileUtils.toURI() cannot be used by Locator.java
+ Implemented this way.
+ File.toURL() adds file: and changes '\' to '/' for dos OSes
+ encodeURI converts characters like ' ' and '#' to %DD
+Parameters: file - the file to convert
+Returns: URL the converted File
+Throws:
+MalformedURLException - on error
+
+
+
+
+
+
+
+getToolsJar
+public static File getToolsJar()
+Get the File necessary to load the Sun compiler tools. If the classes
+ are available to this class, then no additional URL is required and
+ null is returned. This may be because the classes are explicitly in the
+ class path or provided by the JVM directly.
+Returns: the tools jar as a File if required, null otherwise.
+
+
+
+
+
+
+
+getLocationURLs
+public static URL [] getLocationURLs(File location)
+ throws MalformedURLException
+Get an array of URLs representing all of the jar files in the
+ given location. If the location is a file, it is returned as the only
+ element of the array. If the location is a directory, it is scanned for
+ jar files.
+Parameters: location - the location to scan for Jars.
+Returns: an array of URLs for all jars in the given location.
+Throws:
+MalformedURLException - if the URLs for the jars cannot be
+ formed.
+
+
+
+
+
+
+
+getLocationURLs
+public static URL [] getLocationURLs(File location,
+ String [] extensions)
+ throws MalformedURLException
+Get an array of URLs representing all of the files of a given set of
+ extensions in the given location. If the location is a file, it is
+ returned as the only element of the array. If the location is a
+ directory, it is scanned for matching files.
+Parameters: location - the location to scan for files.extensions - an array of extension that are to match in the
+ directory search.
+Returns: an array of URLs of matching files.
+Throws:
+MalformedURLException - if the URLs for the files cannot be
+ formed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Prev Class
+Next Class
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/class-use/Locator.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/class-use/Locator.html
new file mode 100644
index 000000000..8f7ce873f
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/class-use/Locator.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-frame.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-frame.html
new file mode 100644
index 000000000..2c769664d
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-frame.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-summary.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-summary.html
new file mode 100644
index 000000000..ab5a99c51
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-summary.html
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+Class Summary
+
+Class
+Description
+
+
+
+Locator
+
+The Locator is a utility class which is used to find certain items
+ in the environment.
+
+
+
+
+
+
+
+
+
+
Package org.owasp.dependencycheck.org.apache.tools.ant.launch Description
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+ This is a copy of classes within Apache Ant. The DirectoryScanner
+ is needed by dependency-check. However, we did not want to make
+ Ant a dependency. As such, a few files were copied and slightly
+ modified to remove any references to the Ant Project class.
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-tree.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-tree.html
new file mode 100644
index 000000000..f2535315c
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-tree.html
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch Class Hierarchy (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
Class Hierarchy
+
+java.lang.Object
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-use.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-use.html
new file mode 100644
index 000000000..08a4328d3
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-use.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Package org.owasp.dependencycheck.org.apache.tools.ant.launch (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html
new file mode 100644
index 000000000..6cdf869c0
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+
Interfaces
+
+
Classes
+
+
Exceptions
+
+
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html
new file mode 100644
index 000000000..7db2df533
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html
@@ -0,0 +1,216 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+Interface Summary
+
+Interface
+Description
+
+
+
+FileScanner
+
+An interface used to describe the actions required of any type of
+ directory scanner.
+
+
+
+
+
+
+
+Class Summary
+
+Class
+Description
+
+
+
+DirectoryScanner
+
+Class for scanning a directory for files/directories which match certain criteria.
+
+
+
+Location
+
+Stores the location of a piece of text within a file (file name,
+ line number and column number).
+
+
+
+PathTokenizer
+
+A Path tokenizer takes a path and returns the components that make up
+ that path.
+
+
+
+ProjectComponent
+
+Base class for components of a project, including tasks and data types.
+
+
+
+
+
+
+
+Exception Summary
+
+Exception
+Description
+
+
+
+BuildException
+
+Signals an error condition during a build
+
+
+
+
+
+
+
+
+
+
Package org.owasp.dependencycheck.org.apache.tools.ant Description
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant
+
+
+ This is a copy of classes within Apache Ant. The DirectoryScanner
+ is needed by dependency-check. However, we did not want to make
+ Ant a dependency. As such, a few files were copied and slightly
+ modified to remove any references to the Ant Project class.
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-tree.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-tree.html
new file mode 100644
index 000000000..bde2a8d6a
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-tree.html
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant Class Hierarchy (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
Class Hierarchy
+
+
Interface Hierarchy
+
+org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-use.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-use.html
new file mode 100644
index 000000000..490533398
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/package-use.html
@@ -0,0 +1,283 @@
+
+
+
+
+
+
+Uses of Package org.owasp.dependencycheck.org.apache.tools.ant (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Condition.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Condition.html
new file mode 100644
index 000000000..680afcbf1
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Condition.html
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+Condition (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+boolean
+eval ()
+Is this condition true?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Os.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Os.html
new file mode 100644
index 000000000..4bdf98c9b
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Os.html
@@ -0,0 +1,716 @@
+
+
+
+
+
+
+Os (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+Os ()
+Default constructor
+
+
+
+Os (String family)
+Constructor that sets the family attribute
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+boolean
+eval ()
+Determines if the OS on which Ant is executing matches the type of
+ that set in setFamily.
+
+
+
+static boolean
+isArch (String arch)
+Determines if the OS on which Ant is executing matches the
+ given OS architecture.
+
+
+
+static boolean
+isFamily (String family)
+Determines if the OS on which Ant is executing matches the
+ given OS family.
+
+
+
+static boolean
+isName (String name)
+Determines if the OS on which Ant is executing matches the
+ given OS name.
+
+
+
+static boolean
+isOs (String family,
+ String name,
+ String arch,
+ String version)
+Determines if the OS on which Ant is executing matches the
+ given OS family, name, architecture and version
+
+
+
+static boolean
+isVersion (String version)
+Determines if the OS on which Ant is executing matches the
+ given OS version.
+
+
+
+void
+setArch (String arch)
+Sets the desired OS architecture
+
+
+
+void
+setFamily (String f)
+Sets the desired OS family type
+
+
+
+void
+setName (String name)
+Sets the desired OS name
+
+
+
+void
+setVersion (String version)
+Sets the desired OS version
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+Os
+public Os()
+Default constructor
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+isOs
+public static boolean isOs(String family,
+ String name,
+ String arch,
+ String version)
+Determines if the OS on which Ant is executing matches the
+ given OS family, name, architecture and version
+Parameters: family - The OS familyname - The OS namearch - The OS architectureversion - The OS version
+Returns: true if the OS matches Since:
+ 1.7
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/class-use/Condition.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/class-use/Condition.html
new file mode 100644
index 000000000..fa3550da2
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/class-use/Condition.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/class-use/Os.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/class-use/Os.html
new file mode 100644
index 000000000..c5d41aeb7
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/class-use/Os.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-frame.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-frame.html
new file mode 100644
index 000000000..7a7d16b3d
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+
Interfaces
+
+
Classes
+
+
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-summary.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-summary.html
new file mode 100644
index 000000000..17e78ed85
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-summary.html
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+Interface Summary
+
+Interface
+Description
+
+
+
+Condition
+
+Interface for conditions to use inside the <condition> task.
+
+
+
+
+
+
+
+Class Summary
+
+Class
+Description
+
+
+
+Os
+
+Condition that tests the OS type.
+
+
+
+
+
+
+
+
+
+
Package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition Description
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+ This is a copy of classes within Apache Ant. The DirectoryScanner
+ is needed by dependency-check. However, we did not want to make
+ Ant a dependency. As such, a few files were copied and slightly
+ modified to remove any references to the Ant Project class.
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-tree.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-tree.html
new file mode 100644
index 000000000..f588fabca
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-tree.html
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition Class Hierarchy (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
Class Hierarchy
+
+java.lang.Object
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os (implements org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition )
+
+
+
+
Interface Hierarchy
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-use.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-use.html
new file mode 100644
index 000000000..ca2fa8c5d
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-use.html
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+Uses of Package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/DataType.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/DataType.html
new file mode 100644
index 000000000..b30eabc46
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/DataType.html
@@ -0,0 +1,569 @@
+
+
+
+
+
+
+DataType (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+protected boolean
+checked
+
+
+
+
+protected Reference
+ref
+Deprecated.
+
since 1.7. The user should not be directly referencing variable. Please use getRefid()
+ instead.
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+DataType ()
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+protected void
+checkAttributesAllowed ()
+check that it is ok to set attributes, i.e that no reference is defined
+
+
+
+protected void
+checkChildrenAllowed ()
+check that it is ok to add children, i.e that no reference is defined
+
+
+
+protected BuildException
+circularReference ()
+Creates an exception that indicates the user has generated a loop of data types referencing each other.
+
+
+
+Object
+clone ()
+
+
+Reference
+getRefid ()
+get the reference set on this object
+
+
+
+protected boolean
+isChecked ()
+The flag that is used to indicate that circular references have been checked.
+
+
+
+boolean
+isReference ()
+Has the refid attribute of this element been set?
+
+
+
+protected BuildException
+noChildrenAllowed ()
+Creates an exception that indicates that this XML element must not have child elements if the refid attribute is
+ set.
+
+
+
+protected void
+setChecked (boolean checked)
+Set the flag that is used to indicate that circular references have been checked.
+
+
+
+void
+setRefid (Reference ref)
+Set the value of the refid attribute.
+
+
+
+protected BuildException
+tooManyAttributes ()
+Creates an exception that indicates that refid has to be the only attribute if it is set.
+
+
+
+String
+toString ()
+Basic DataType toString().
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+DataType
+public DataType()
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+checkAttributesAllowed
+protected void checkAttributesAllowed()
+check that it is ok to set attributes, i.e that no reference is defined
+Throws:
+BuildException - if not allowedSince:
+ Ant 1.6
+
+
+
+
+
+
+
+checkChildrenAllowed
+protected void checkChildrenAllowed()
+check that it is ok to add children, i.e that no reference is defined
+Throws:
+BuildException - if not allowedSince:
+ Ant 1.6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/Reference.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/Reference.html
new file mode 100644
index 000000000..eb3a41ee7
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/Reference.html
@@ -0,0 +1,305 @@
+
+
+
+
+
+
+Reference (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.Reference
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+Reference ()
+Deprecated.
+
since 1.7. Please use Reference#Reference(Project,String) instead.
+
+
+
+
+Reference (String id)
+Deprecated.
+
since 1.7. Please use Reference#Reference(Project,String) instead.
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+String
+getRefId ()
+Get the reference id of this reference.
+
+
+
+void
+setRefId (String id)
+Set the reference id.
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+Reference
+public Reference(String id)
+Deprecated. since 1.7. Please use Reference#Reference(Project,String) instead.
+Create a reference to a named ID.
+Parameters: id - the name of this reference
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+setRefId
+public void setRefId(String id)
+Set the reference id. Should not normally be necessary; use Reference#Reference(Project, String).
+Parameters: id - the reference id to use
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/Resource.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/Resource.html
new file mode 100644
index 000000000..fdcdca1ef
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/Resource.html
@@ -0,0 +1,945 @@
+
+
+
+
+
+
+Resource (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
+All Implemented Interfaces:
+Cloneable , Comparable <Resource >, Iterable <Resource >, ResourceCollection
+
+
+Direct Known Subclasses:
+FileResource
+
+
+
+public class Resource
+extends DataType
+implements Comparable <Resource >, ResourceCollection
+Describes a "File-like" resource (File, ZipEntry, etc.).
+
+ This class is meant to be used by classes needing to record path and date/time information about a file, a zip entry
+ or some similar resource (URL, archive in a version control repository, ...).
+Since:
+ Ant 1.5.2
+See Also: org.apache.tools.ant.types.resources.Touchable
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+protected static int
+MAGIC
+Magic number
+
+
+
+static long
+UNKNOWN_DATETIME
+Constant unknown datetime for getLastModified
+
+
+
+static long
+UNKNOWN_SIZE
+Constant unknown size
+
+
+
+
+
+
+
+Fields inherited from class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+checked , ref
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+Resource ()
+Default constructor.
+
+
+
+Resource (String name)
+Only sets the name.
+
+
+
+Resource (String name,
+ boolean exists,
+ long lastmodified)
+Sets the name, lastmodified flag, and exists flag.
+
+
+
+Resource (String name,
+ boolean exists,
+ long lastmodified,
+ boolean directory)
+Sets the name, lastmodified flag, exists flag, and directory flag.
+
+
+
+Resource (String name,
+ boolean exists,
+ long lastmodified,
+ boolean directory,
+ long size)
+Sets the name, lastmodified flag, exists flag, directory flag, and size.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+<T> T
+as (Class <T> clazz)
+Returns a view of this resource that implements the interface given as the argument or null if there is no such
+ view.
+
+
+
+Object
+clone ()
+Clone this Resource.
+
+
+
+int
+compareTo (Resource other)
+Delegates to a comparison of names.
+
+
+
+boolean
+equals (Object other)
+Implement basic Resource equality.
+
+
+
+InputStream
+getInputStream ()
+Get an InputStream for the Resource.
+
+
+
+long
+getLastModified ()
+Tells the modification time in milliseconds since 01.01.1970 (the "epoch").
+
+
+
+protected static int
+getMagicNumber (byte[] seed)
+Create a "magic number" for use in hashCode calculations.
+
+
+
+String
+getName ()
+Name attribute will contain the path of a file relative to the root directory of its fileset or the recorded path
+ of a zip entry.
+
+
+
+OutputStream
+getOutputStream ()
+Get an OutputStream for the Resource.
+
+
+
+long
+getSize ()
+Get the size of this Resource.
+
+
+
+int
+hashCode ()
+Get the hash code for this Resource.
+
+
+
+boolean
+isDirectory ()
+Tells if the resource is a directory.
+
+
+
+boolean
+isExists ()
+The exists attribute tells whether a resource exists.
+
+
+
+boolean
+isFilesystemOnly ()
+Fulfill the ResourceCollection contract.
+
+
+
+Iterator <Resource >
+iterator ()
+Fulfill the ResourceCollection contract.
+
+
+
+void
+setDirectory (boolean directory)
+Set the directory attribute.
+
+
+
+void
+setExists (boolean exists)
+Set the exists attribute.
+
+
+
+void
+setLastModified (long lastmodified)
+Set the last modification attribute.
+
+
+
+void
+setName (String name)
+Set the name of this Resource.
+
+
+
+void
+setRefid (Reference r)
+Overrides the base version.
+
+
+
+void
+setSize (long size)
+Set the size of this Resource.
+
+
+
+int
+size ()
+Fulfill the ResourceCollection contract.
+
+
+
+String
+toLongString ()
+Get a long String representation of this Resource.
+
+
+
+String
+toString ()
+Get the string representation of this Resource.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+Resource
+public Resource()
+Default constructor.
+
+
+
+
+
+
+
+
+
+
+
+Resource
+public Resource(String name,
+ boolean exists,
+ long lastmodified)
+Sets the name, lastmodified flag, and exists flag.
+Parameters: name - relative path of the resource. Expects "/" to be used as the directory separator.exists - if true, this resource exists.lastmodified - the last modification time of this resource.
+
+
+
+
+
+
+
+Resource
+public Resource(String name,
+ boolean exists,
+ long lastmodified,
+ boolean directory)
+Sets the name, lastmodified flag, exists flag, and directory flag.
+Parameters: name - relative path of the resource. Expects "/" to be used as the directory separator.exists - if true the resource existslastmodified - the last modification time of the resourcedirectory - if true, this resource is a directory
+
+
+
+
+
+
+
+Resource
+public Resource(String name,
+ boolean exists,
+ long lastmodified,
+ boolean directory,
+ long size)
+Sets the name, lastmodified flag, exists flag, directory flag, and size.
+Parameters: name - relative path of the resource. Expects "/" to be used as the directory separator.exists - if true the resource existslastmodified - the last modification time of the resourcedirectory - if true, this resource is a directorysize - the size of this resource.
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+getName
+public String getName()
+Name attribute will contain the path of a file relative to the root directory of its fileset or the recorded path
+ of a zip entry.
+
+
+ example for a file with fullpath /var/opt/adm/resource.txt in a file set with root dir /var/opt it will be
+ adm/resource.txt.
+
+
+ "/" will be used as the directory separator.
+Returns: the name of this resource.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+clone
+public Object clone()
+Clone this Resource.
+
+Overrides:
+clone in class DataType
+Returns: copy of this.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceCollection.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceCollection.html
new file mode 100644
index 000000000..3c30f39fa
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceCollection.html
@@ -0,0 +1,265 @@
+
+
+
+
+
+
+ResourceCollection (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+boolean
+isFilesystemOnly ()
+Indicate whether this ResourceCollection is composed entirely of
+ Resources accessible via local filesystem conventions.
+
+
+
+Iterator <Resource >
+iterator ()
+Gets the contents of this collection.
+
+
+
+int
+size ()
+Learn the number of contained Resources.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceFactory.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceFactory.html
new file mode 100644
index 000000000..676661649
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceFactory.html
@@ -0,0 +1,224 @@
+
+
+
+
+
+
+ResourceFactory (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+Resource
+getResource (String name)
+Query a resource (file, zipentry, ...) by name
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+getResource
+Resource getResource(String name)
+Query a resource (file, zipentry, ...) by name
+Parameters: name - relative path of the resource about which
+ information is sought. Expects "/" to be used as the
+ directory separator.
+Returns: instance of Resource; the exists attribute of Resource
+ will tell whether the sought resource exists
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/DataType.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/DataType.html
new file mode 100644
index 000000000..8c934ca7e
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/DataType.html
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/Reference.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/Reference.html
new file mode 100644
index 000000000..4617295f8
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/Reference.html
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.types.Reference (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/Resource.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/Resource.html
new file mode 100644
index 000000000..9f2a223f3
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/Resource.html
@@ -0,0 +1,335 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/ResourceCollection.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/ResourceCollection.html
new file mode 100644
index 000000000..c3b57f1c4
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/ResourceCollection.html
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/ResourceFactory.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/ResourceFactory.html
new file mode 100644
index 000000000..a78b66261
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/class-use/ResourceFactory.html
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-frame.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-frame.html
new file mode 100644
index 000000000..5dbaf92c6
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-frame.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+
Interfaces
+
+
Classes
+
+
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-summary.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-summary.html
new file mode 100644
index 000000000..79e36f2eb
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-summary.html
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+Interface Summary
+
+Interface
+Description
+
+
+
+ResourceCollection
+
+Interface describing a collection of Resources.
+
+
+
+ResourceFactory
+
+this interface should be implemented by classes (Scanners) needing
+ to deliver information about resources.
+
+
+
+
+
+
+
+Class Summary
+
+Class
+Description
+
+
+
+DataType
+
+Base class for those classes that can appear inside the build file as stand alone data types.
+
+
+
+Reference
+
+Class to hold a reference to another object in the project.
+
+
+
+Resource
+
+Describes a "File-like" resource (File, ZipEntry, etc.).
+
+
+
+
+
+
+
+
+
+
Package org.owasp.dependencycheck.org.apache.tools.ant.types Description
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+ This is a copy of classes within Apache Ant. The DirectoryScanner
+ is needed by dependency-check. However, we did not want to make
+ Ant a dependency. As such, a few files were copied and slightly
+ modified to remove any references to the Ant Project class.
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-tree.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-tree.html
new file mode 100644
index 000000000..7c78178f7
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-tree.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types Class Hierarchy (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
Class Hierarchy
+
+java.lang.Object
+
+org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent (implements java.lang.Cloneable )
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.DataType (implements java.lang.Cloneable )
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.Reference
+
+
+
+
Interface Hierarchy
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-use.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-use.html
new file mode 100644
index 000000000..1d9638f9c
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/package-use.html
@@ -0,0 +1,285 @@
+
+
+
+
+
+
+Uses of Package org.owasp.dependencycheck.org.apache.tools.ant.types (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Appendable.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Appendable.html
new file mode 100644
index 000000000..df4a2f624
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Appendable.html
@@ -0,0 +1,222 @@
+
+
+
+
+
+
+Appendable (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileProvider.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileProvider.html
new file mode 100644
index 000000000..c56c06815
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileProvider.html
@@ -0,0 +1,222 @@
+
+
+
+
+
+
+FileProvider (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+File
+getFile ()
+Get the file represented by this Resource.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileResource.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileResource.html
new file mode 100644
index 000000000..2c6a3bec0
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileResource.html
@@ -0,0 +1,788 @@
+
+
+
+
+
+
+FileResource (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
+All Implemented Interfaces:
+Cloneable , Comparable <Resource >, Iterable <Resource >, ResourceCollection , ResourceFactory , Appendable , FileProvider , Touchable
+
+
+
+public class FileResource
+extends Resource
+implements Touchable , FileProvider , ResourceFactory , Appendable
+A Resource representation of a File.
+Since:
+ Ant 1.7
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+
+
+Fields inherited from class org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+checked , ref
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+FileResource ()
+Default constructor.
+
+
+
+FileResource (File f)
+Construct a new FileResource from a File.
+
+
+
+FileResource (File b,
+ String name)
+Construct a new FileResource using the specified basedir and relative name.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+int
+compareTo (Resource another)
+Compare this FileResource to another Resource.
+
+
+
+boolean
+equals (Object another)
+Compare another Object to this FileResource for equality.
+
+
+
+OutputStream
+getAppendOutputStream ()
+Get an appending OutputStream.
+
+
+
+File
+getBaseDir ()
+Return the basedir to which the name is relative.
+
+
+
+File
+getFile ()
+Get the file represented by this FileResource.
+
+
+
+InputStream
+getInputStream ()
+Return an InputStream for reading the contents of this Resource.
+
+
+
+long
+getLastModified ()
+Get the modification time in milliseconds since 01.01.1970 .
+
+
+
+String
+getName ()
+Get the name of this FileResource.
+
+
+
+protected File
+getNotNullFile ()
+Get the file represented by this FileResource, ensuring it is not null.
+
+
+
+OutputStream
+getOutputStream ()
+Get an OutputStream for the Resource.
+
+
+
+Resource
+getResource (String path)
+Create a new resource that matches a relative or absolute path.
+
+
+
+long
+getSize ()
+Get the size of this Resource.
+
+
+
+int
+hashCode ()
+Get the hash code for this Resource.
+
+
+
+boolean
+isDirectory ()
+Learn whether the resource is a directory.
+
+
+
+boolean
+isExists ()
+Learn whether this file exists.
+
+
+
+boolean
+isFilesystemOnly ()
+Fulfill the ResourceCollection contract.
+
+
+
+void
+setBaseDir (File b)
+Set the basedir for this FileResource.
+
+
+
+void
+setFile (File f)
+Set the File for this FileResource.
+
+
+
+void
+setRefid (Reference r)
+Overrides the super version.
+
+
+
+String
+toString ()
+Get the string representation of this Resource.
+
+
+
+void
+touch (long modTime)
+Implement the Touchable interface.
+
+
+
+
+
+
+
+Methods inherited from class org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+as , clone , getMagicNumber , iterator , setDirectory , setExists , setLastModified , setName , setSize , size , toLongString
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+FileResource
+public FileResource()
+Default constructor.
+
+
+
+
+
+
+
+FileResource
+public FileResource(File b,
+ String name)
+Construct a new FileResource using the specified basedir and relative name.
+Parameters: b - the basedir as File.name - the relative filename.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+getNotNullFile
+protected File getNotNullFile()
+Get the file represented by this FileResource, ensuring it is not null.
+Returns: the not-null File.
+Throws:
+BuildException - if file is null.
+
+
+
+
+
+
+
+getResource
+public Resource getResource(String path)
+Create a new resource that matches a relative or absolute path. If the current instance has a compatible baseDir
+ attribute, it is copied.
+
+Specified by:
+getResource in interface ResourceFactory
+Parameters: path - relative/absolute path to a resource
+Returns: a new resource of type FileResource
+Throws:
+BuildException - if desiredSince:
+ Ant1.8
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Touchable.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Touchable.html
new file mode 100644
index 000000000..5f789231f
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Touchable.html
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+Touchable (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+All Known Implementing Classes:
+FileResource
+
+
+
+public interface Touchable
+Interface to be implemented by "touchable" resources;
+ that is, those whose modification time can be altered.
+Since:
+ Ant 1.7
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+void
+touch (long modTime)
+Method called to "touch" the resource.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/Appendable.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/Appendable.html
new file mode 100644
index 000000000..d03cbc946
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/Appendable.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/FileProvider.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/FileProvider.html
new file mode 100644
index 000000000..b61e45db1
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/FileProvider.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/FileResource.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/FileResource.html
new file mode 100644
index 000000000..c358750bd
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/FileResource.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/Touchable.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/Touchable.html
new file mode 100644
index 000000000..380df014d
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/class-use/Touchable.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-frame.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-frame.html
new file mode 100644
index 000000000..db7a596a6
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-frame.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+
Interfaces
+
+
Classes
+
+
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-summary.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-summary.html
new file mode 100644
index 000000000..26862a0e9
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-summary.html
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+Interface Summary
+
+Interface
+Description
+
+
+
+Appendable
+
+Interface to be implemented by "appendable" resources.
+
+
+
+FileProvider
+
+This is an interface that resources that can provide a file should implement.
+
+
+
+Touchable
+
+Interface to be implemented by "touchable" resources;
+ that is, those whose modification time can be altered.
+
+
+
+
+
+
+
+Class Summary
+
+Class
+Description
+
+
+
+FileResource
+
+A Resource representation of a File.
+
+
+
+
+
+
+
+
+
+
Package org.owasp.dependencycheck.org.apache.tools.ant.types.resources Description
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+ This is a copy of classes within Apache Ant. The DirectoryScanner
+ is needed by dependency-check. However, we did not want to make
+ Ant a dependency. As such, a few files were copied and slightly
+ modified to remove any references to the Ant Project class.
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-tree.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-tree.html
new file mode 100644
index 000000000..fcca52de5
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-tree.html
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources Class Hierarchy (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
Class Hierarchy
+
+java.lang.Object
+
+org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent (implements java.lang.Cloneable )
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.DataType (implements java.lang.Cloneable )
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.Resource (implements java.lang.Comparable <T>, org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection )
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource (implements org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable , org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider , org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory , org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable )
+
+
+
+
+
+
+
+
+
+
Interface Hierarchy
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-use.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-use.html
new file mode 100644
index 000000000..a24ced153
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-use.html
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+Uses of Package org.owasp.dependencycheck.org.apache.tools.ant.types.resources (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/FileSelector.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/FileSelector.html
new file mode 100644
index 000000000..3cc670fa7
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/FileSelector.html
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+FileSelector (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+boolean
+isSelected (File basedir,
+ String filename,
+ File file)
+Method that each selector will implement to create their
+ selection behaviour.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+isSelected
+boolean isSelected(File basedir,
+ String filename,
+ File file)
+ throws BuildException
+Method that each selector will implement to create their
+ selection behaviour. If there is a problem with the setup
+ of a selector, it can throw a BuildException to indicate
+ the problem.
+Parameters: basedir - A java.io.File object for the base directoryfilename - The name of the file to checkfile - A File object for this filename
+Returns: whether the file should be selected or not
+Throws:
+BuildException - if the selector was not configured correctly
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorScanner.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorScanner.html
new file mode 100644
index 000000000..0a47ad6e7
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorScanner.html
@@ -0,0 +1,254 @@
+
+
+
+
+
+
+SelectorScanner (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Summary:
+Nested |
+Field |
+Constr |
+Method
+
+
+Detail:
+Field |
+Constr |
+Method
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorUtils.html
new file mode 100644
index 000000000..dd565214b
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorUtils.html
@@ -0,0 +1,631 @@
+
+
+
+
+
+
+SelectorUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+static String
+DEEP_TREE_MATCH
+The pattern that matches an arbitrary number of directories.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+static SelectorUtils
+getInstance ()
+Retrieves the instance of the Singleton.
+
+
+
+static boolean
+hasWildcards (String input)
+Tests if a string contains stars or question marks
+
+
+
+static boolean
+isOutOfDate (File src,
+ File target,
+ int granularity)
+Returns dependency information on these two files.
+
+
+
+static boolean
+isOutOfDate (Resource src,
+ Resource target,
+ int granularity)
+Returns dependency information on these two resources.
+
+
+
+static boolean
+isOutOfDate (Resource src,
+ Resource target,
+ long granularity)
+Returns dependency information on these two resources.
+
+
+
+static boolean
+match (String pattern,
+ String str)
+Tests whether or not a string matches against a pattern.
+
+
+
+static boolean
+match (String pattern,
+ String str,
+ boolean caseSensitive)
+Tests whether or not a string matches against a pattern.
+
+
+
+static boolean
+matchPath (String pattern,
+ String str)
+Tests whether or not a given path matches a given pattern.
+
+
+
+static boolean
+matchPath (String pattern,
+ String str,
+ boolean isCaseSensitive)
+Tests whether or not a given path matches a given pattern.
+
+
+
+static boolean
+matchPatternStart (String pattern,
+ String str)
+Tests whether or not a given path matches the start of a given
+ pattern up to the first "**".
+
+
+
+static boolean
+matchPatternStart (String pattern,
+ String str,
+ boolean isCaseSensitive)
+Tests whether or not a given path matches the start of a given
+ pattern up to the first "**".
+
+
+
+static String
+removeWhitespace (String input)
+"Flattens" a string by removing all whitespace (space, tab, linefeed,
+ carriage return, and formfeed).
+
+
+
+static String
+rtrimWildcardTokens (String input)
+removes from a pattern all tokens to the right containing wildcards
+
+
+
+static Vector <String >
+tokenizePath (String path)
+Breaks a path up into a Vector of path elements, tokenizing on
+ File.separator.
+
+
+
+static Vector <String >
+tokenizePath (String path,
+ String separator)
+Breaks a path up into a Vector of path elements, tokenizing on
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+matchPath
+public static boolean matchPath(String pattern,
+ String str)
+Tests whether or not a given path matches a given pattern.
+
+ If you need to call this method multiple times with the same
+ pattern you should rather use TokenizedPath
+Parameters: pattern - The pattern to match against. Must not be
+ null.str - The path to match, as a String. Must not be
+ null.
+Returns: true if the pattern matches against the string,
+ or false otherwise.See Also: TokenizedPath
+
+
+
+
+
+
+
+matchPath
+public static boolean matchPath(String pattern,
+ String str,
+ boolean isCaseSensitive)
+Tests whether or not a given path matches a given pattern.
+
+ If you need to call this method multiple times with the same
+ pattern you should rather use TokenizedPattern
+Parameters: pattern - The pattern to match against. Must not be
+ null.str - The path to match, as a String. Must not be
+ null.isCaseSensitive - Whether or not matching should be performed
+ case sensitively.
+Returns: true if the pattern matches against the string,
+ or false otherwise.See Also: TokenizedPattern
+
+
+
+
+
+
+
+match
+public static boolean match(String pattern,
+ String str)
+Tests whether or not a string matches against a pattern.
+ The pattern may contain two special characters:
+ '*' means zero or more characters
+ '?' means one and only one character
+Parameters: pattern - The pattern to match against.
+ Must not be null.str - The string which must be matched against the pattern.
+ Must not be null.
+Returns: true if the string matches against the pattern,
+ or false otherwise.
+
+
+
+
+
+
+
+match
+public static boolean match(String pattern,
+ String str,
+ boolean caseSensitive)
+Tests whether or not a string matches against a pattern.
+ The pattern may contain two special characters:
+ '*' means zero or more characters
+ '?' means one and only one character
+Parameters: pattern - The pattern to match against.
+ Must not be null.str - The string which must be matched against the pattern.
+ Must not be null.caseSensitive - Whether or not matching should be performed
+ case sensitively.
+Returns: true if the string matches against the pattern,
+ or false otherwise.
+
+
+
+
+
+
+
+tokenizePath
+public static Vector <String > tokenizePath(String path)
+Breaks a path up into a Vector of path elements, tokenizing on
+ File.separator.
+Parameters: path - Path to tokenize. Must not be null.
+Returns: a Vector of path elements from the tokenized path
+
+
+
+
+
+
+
+tokenizePath
+public static Vector <String > tokenizePath(String path,
+ String separator)
+Breaks a path up into a Vector of path elements, tokenizing on
+Parameters: path - Path to tokenize. Must not be null.separator - the separator against which to tokenize.
+Returns: a Vector of path elements from the tokenized path Since:
+ Ant 1.6
+
+
+
+
+
+
+
+isOutOfDate
+public static boolean isOutOfDate(File src,
+ File target,
+ int granularity)
+Returns dependency information on these two files. If src has been
+ modified later than target, it returns true. If target doesn't exist,
+ it likewise returns true. Otherwise, target is newer than src and
+ is not out of date, thus the method returns false. It also returns
+ false if the src file doesn't even exist, since how could the
+ target then be out of date.
+Parameters: src - the original filetarget - the file being compared againstgranularity - the amount in seconds of slack we will give in
+ determining out of dateness
+Returns: whether the target is out of date
+
+
+
+
+
+
+
+isOutOfDate
+public static boolean isOutOfDate(Resource src,
+ Resource target,
+ int granularity)
+Returns dependency information on these two resources. If src has been
+ modified later than target, it returns true. If target doesn't exist,
+ it likewise returns true. Otherwise, target is newer than src and
+ is not out of date, thus the method returns false. It also returns
+ false if the src file doesn't even exist, since how could the
+ target then be out of date.
+Parameters: src - the original resourcetarget - the resource being compared againstgranularity - the int amount in seconds of slack we will give in
+ determining out of dateness
+Returns: whether the target is out of date
+
+
+
+
+
+
+
+isOutOfDate
+public static boolean isOutOfDate(Resource src,
+ Resource target,
+ long granularity)
+Returns dependency information on these two resources. If src has been
+ modified later than target, it returns true. If target doesn't exist,
+ it likewise returns true. Otherwise, target is newer than src and
+ is not out of date, thus the method returns false. It also returns
+ false if the src file doesn't even exist, since how could the
+ target then be out of date.
+Parameters: src - the original resourcetarget - the resource being compared againstgranularity - the long amount in seconds of slack we will give in
+ determining out of dateness
+Returns: whether the target is out of date
+
+
+
+
+
+
+
+removeWhitespace
+public static String removeWhitespace(String input)
+"Flattens" a string by removing all whitespace (space, tab, linefeed,
+ carriage return, and formfeed). This uses StringTokenizer and the
+ default set of tokens as documented in the single argument constructor.
+Parameters: input - a String to remove all whitespace.
+Returns: a String that has had all whitespace removed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPath.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPath.html
new file mode 100644
index 000000000..6e5d03300
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPath.html
@@ -0,0 +1,439 @@
+
+
+
+
+
+
+TokenizedPath (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+static TokenizedPath
+EMPTY_PATH
+Instance that holds no tokens at all.
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+int
+depth ()
+The depth (or length) of a path.
+
+
+
+boolean
+equals (Object o)
+true if the original paths are equal.
+
+
+
+File
+findFile (File base,
+ boolean cs)
+From base traverse the filesystem in order to find
+ a file that matches the given name.
+
+
+
+int
+hashCode ()
+
+
+boolean
+isSymlink (File base)
+Do we have to traverse a symlink when trying to reach path from
+ basedir?
+
+
+
+TokenizedPattern
+toPattern ()
+Creates a TokenizedPattern from the same tokens that make up
+ this path.
+
+
+
+String
+toString ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+TokenizedPath
+public TokenizedPath(TokenizedPath parent,
+ String child)
+Creates a new path as a child of another path.
+Parameters: parent - the parent pathchild - the child, must not contain the file separator
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+toString
+public String toString()
+
+Overrides:
+toString in class Object
+Returns: The original path String
+
+
+
+
+
+
+
+
+
+
+
+findFile
+public File findFile(File base,
+ boolean cs)
+From base traverse the filesystem in order to find
+ a file that matches the given name.
+Parameters: base - base File (dir).cs - whether to scan case-sensitively.
+Returns: File object that points to the file in question or null.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+hashCode
+public int hashCode()
+
+Overrides:
+hashCode in class Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPattern.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPattern.html
new file mode 100644
index 000000000..d25f3aad1
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPattern.html
@@ -0,0 +1,490 @@
+
+
+
+
+
+
+TokenizedPattern (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Constructor and Description
+
+
+TokenizedPattern (String pattern)
+Initialize the PathPattern by parsing it.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+matchPath
+public boolean matchPath(TokenizedPath path,
+ boolean isCaseSensitive)
+Tests whether or not a given path matches a given pattern.
+Parameters: path - The path to match, as a String. Must not be
+ null.isCaseSensitive - Whether or not matching should be performed
+ case sensitively.
+Returns: true if the pattern matches against the string,
+ or false otherwise.
+
+
+
+
+
+
+
+matchStartOf
+public boolean matchStartOf(TokenizedPath path,
+ boolean caseSensitive)
+Tests whether or not this pattern matches the start of
+ a path.
+
+
+
+
+
+
+
+toString
+public String toString()
+
+Overrides:
+toString in class Object
+Returns: The pattern String
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+hashCode
+public int hashCode()
+
+Overrides:
+hashCode in class Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/FileSelector.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/FileSelector.html
new file mode 100644
index 000000000..a6c5467f9
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/FileSelector.html
@@ -0,0 +1,212 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/SelectorScanner.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/SelectorScanner.html
new file mode 100644
index 000000000..066e595ce
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/SelectorScanner.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Interface org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/SelectorUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/SelectorUtils.html
new file mode 100644
index 000000000..608846949
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/SelectorUtils.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/TokenizedPath.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/TokenizedPath.html
new file mode 100644
index 000000000..6bcf66dd7
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/TokenizedPath.html
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/TokenizedPattern.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/TokenizedPattern.html
new file mode 100644
index 000000000..20c45dcd7
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/class-use/TokenizedPattern.html
@@ -0,0 +1,188 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-frame.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-frame.html
new file mode 100644
index 000000000..0cc46cf59
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-frame.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+
Interfaces
+
+
Classes
+
+
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-summary.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-summary.html
new file mode 100644
index 000000000..3b9f2ef13
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-summary.html
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+Interface Summary
+
+Interface
+Description
+
+
+
+FileSelector
+
+This is the interface to be used by all selectors.
+
+
+
+SelectorScanner
+
+An interface used to describe the actions required by any type of
+ directory scanner that supports Selectors.
+
+
+
+
+
+
+
+Class Summary
+
+Class
+Description
+
+
+
+SelectorUtils
+
+This is a utility class used by selectors and DirectoryScanner.
+
+
+
+TokenizedPath
+
+Container for a path that has been split into its components.
+
+
+
+TokenizedPattern
+
+Provides reusable path pattern matching.
+
+
+
+
+
+
+
+
+
+
Package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors Description
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+ This is a copy of classes within Apache Ant. The DirectoryScanner
+ is needed by dependency-check. However, we did not want to make
+ Ant a dependency. As such, a few files were copied and slightly
+ modified to remove any references to the Ant Project class.
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-tree.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-tree.html
new file mode 100644
index 000000000..73886819e
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-tree.html
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors Class Hierarchy (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
Class Hierarchy
+
+java.lang.Object
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+
+
+
Interface Hierarchy
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-use.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-use.html
new file mode 100644
index 000000000..56e1e2f83
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-use.html
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+Uses of Package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.EmptyEnumeration.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.EmptyEnumeration.html
new file mode 100644
index 000000000..3afea6b2e
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.EmptyEnumeration.html
@@ -0,0 +1,297 @@
+
+
+
+
+
+
+CollectionUtils.EmptyEnumeration (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.EmptyEnumeration<E>
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.html
new file mode 100644
index 000000000..c27514149
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.html
@@ -0,0 +1,502 @@
+
+
+
+
+
+
+CollectionUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+
+
+
+
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+static List
+EMPTY_LIST
+Deprecated.
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+static <E> Enumeration <E>
+append (Enumeration <E> e1,
+ Enumeration <E> e2)
+Append one enumeration to another.
+
+
+
+static <T> Collection <T>
+asCollection (Iterator <? extends T> iter)
+Returns a collection containing all elements of the iterator.
+
+
+
+static <E> Enumeration <E>
+asEnumeration (Iterator <E> iter)
+Adapt the specified Iterator to the Enumeration interface.
+
+
+
+static <E> Iterator <E>
+asIterator (Enumeration <E> e)
+Adapt the specified Enumeration to the Iterator interface.
+
+
+
+static boolean
+equals (Dictionary <?,?> d1,
+ Dictionary <?,?> d2)
+Deprecated.
+
since 1.6.x.
+
+
+
+
+static boolean
+equals (Vector <?> v1,
+ Vector <?> v2)
+Deprecated.
+
since 1.6.x.
+
+
+
+
+static String
+flattenToString (Collection <?> c)
+Creates a comma separated list of all values held in the given
+ collection.
+
+
+
+static int
+frequency (Collection <?> c,
+ Object o)
+Counts how often the given Object occurs in the given
+ collection using equals() for comparison.
+
+
+
+static <K,V> void
+putAll (Dictionary <? super K,? super V> m1,
+ Dictionary <? extends K,? extends V> m2)
+Deprecated.
+
since 1.6.x.
+
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+CollectionUtils
+public CollectionUtils()
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+equals
+public static boolean equals(Vector <?> v1,
+ Vector <?> v2)
+Deprecated. since 1.6.x.
+Please use Vector.equals() or List.equals().
+Parameters: v1 - the first vector.v2 - the second vector.
+Returns: true if the vectors are equal. Since:
+ Ant 1.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+putAll
+public static <K,V> void putAll(Dictionary <? super K,? super V> m1,
+ Dictionary <? extends K,? extends V> m2)
+Deprecated. since 1.6.x.
+Dictionary does not know the putAll method. Please use Map.putAll().
+Parameters: m1 - the to directory.m2 - the from directory.Since:
+ Ant 1.6
+
+
+
+
+
+
+
+append
+public static <E> Enumeration <E> append(Enumeration <E> e1,
+ Enumeration <E> e2)
+Append one enumeration to another.
+ Elements are evaluated lazily.
+Parameters: e1 - the first enumeration.e2 - the subsequent enumeration.
+Returns: an enumeration representing e1 followed by e2. Since:
+ Ant 1.6.3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+frequency
+public static int frequency(Collection <?> c,
+ Object o)
+Counts how often the given Object occurs in the given
+ collection using equals() for comparison.
+Since:
+ Ant 1.8.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/FileUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/FileUtils.html
new file mode 100644
index 000000000..f3d6726c9
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/FileUtils.html
@@ -0,0 +1,1383 @@
+
+
+
+
+
+
+FileUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+
+
+
+
+
+
+
+public class FileUtils
+extends Object
+This class also encapsulates methods which allow Files to be referred to using abstract path names which are
+ translated to native system file paths at runtime as well as copying files or setting their last modification time.
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Modifier
+Constructor and Description
+
+
+protected
+FileUtils ()
+Empty constructor.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+Methods
+
+Modifier and Type
+Method and Description
+
+
+boolean
+areSame (File f1,
+ File f2)
+Are the two File instances pointing to the same object on the file system?
+
+
+
+static void
+close (Channel device)
+Close a Channel without throwing any exception if something went wrong.
+
+
+
+static void
+close (InputStream device)
+Close a stream without throwing any exception if something went wrong.
+
+
+
+static void
+close (OutputStream device)
+Close a stream without throwing any exception if something went wrong.
+
+
+
+static void
+close (Reader device)
+Close a Reader without throwing any exception if something went wrong.
+
+
+
+static void
+close (URLConnection conn)
+Closes an URLConnection if its concrete implementation provides a way to close it that Ant knows of.
+
+
+
+static void
+close (Writer device)
+Close a Writer without throwing any exception if something went wrong.
+
+
+
+boolean
+createNewFile (File f)
+This was originally an emulation of File.createNewFile for JDK 1.1, but it is now implemented using that method
+ (Ant 1.6.3 onwards).
+
+
+
+boolean
+createNewFile (File f,
+ boolean mkdirs)
+Create a new file, optionally creating parent directories.
+
+
+
+File
+createTempFile (String prefix,
+ String suffix,
+ File parentDir)
+Deprecated.
+
since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+
+
+
+
+File
+createTempFile (String prefix,
+ String suffix,
+ File parentDir,
+ boolean deleteOnExit)
+Deprecated.
+
since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+
+
+
+
+File
+createTempFile (String prefix,
+ String suffix,
+ File parentDir,
+ boolean deleteOnExit,
+ boolean createFile)
+Create a temporary file in a given directory.
+
+
+
+static void
+delete (File file)
+
+
+
+
+String []
+dissect (String path)
+Dissect the specified absolute path.
+
+
+
+boolean
+fileNameEquals (File f1,
+ File f2)
+Compares two filenames.
+
+
+
+String
+fromURI (String uri)
+Constructs a file path from a file: URI.
+
+
+
+String
+getDefaultEncoding ()
+Get the default encoding.
+
+
+
+long
+getFileTimestampGranularity ()
+Get the granularity of file timestamps.
+
+
+
+URL
+getFileURL (File file)
+Get the URL for a file taking into account # characters.
+
+
+
+static FileUtils
+getFileUtils ()
+Method to retrieve The FileUtils, which is shared by all users of this method.
+
+
+
+File
+getParentFile (File f)
+
+
+
+
+static String
+getPath (List pathStack)
+Gets path from a List of Strings.
+
+
+
+static String
+getPath (List pathStack,
+ char separatorChar)
+Gets path from a List of Strings.
+
+
+
+static String []
+getPathStack (String path)
+Gets all names of the path as an array of Strings.
+
+
+
+static String
+getRelativePath (File fromFile,
+ File toFile)
+Calculates the relative path between two files.
+
+
+
+boolean
+hasErrorInCase (File localFile)
+test whether a file or directory exists, with an error in the upper/lower case spelling of the name.
+
+
+
+static boolean
+isAbsolutePath (String filename)
+Verifies that the specified filename represents an absolute path.
+
+
+
+static boolean
+isContextRelativePath (String filename)
+On DOS and NetWare, the evaluation of certain file specifications is context-dependent.
+
+
+
+boolean
+isLeadingPath (File leading,
+ File path)
+Learn whether one path "leads" another.
+
+
+
+boolean
+isSymbolicLink (File parent,
+ String name)
+Deprecated.
+
use SymbolicLinkUtils instead
+
+
+
+
+boolean
+isUpToDate (File source,
+ File dest)
+Returns true if the source is older than the dest.
+
+
+
+boolean
+isUpToDate (File source,
+ File dest,
+ long granularity)
+Returns true if the source is older than the dest.
+
+
+
+boolean
+isUpToDate (long sourceTime,
+ long destTime)
+Compare two timestamps for being up to date using the current granularity.
+
+
+
+boolean
+isUpToDate (long sourceTime,
+ long destTime,
+ long granularity)
+Compare two timestamps for being up to date using the specified granularity.
+
+
+
+static FileUtils
+newFileUtils ()
+Deprecated.
+
since 1.7. Use getFileUtils instead, FileUtils do not have state.
+
+
+
+
+File
+normalize (String path)
+"Normalize" the given absolute path.
+
+
+
+static String
+readFully (Reader rdr)
+Read from reader till EOF.
+
+
+
+static String
+readFully (Reader rdr,
+ int bufferSize)
+Read from reader till EOF.
+
+
+
+String
+removeLeadingPath (File leading,
+ File path)
+Removes a leading path from a second path.
+
+
+
+File
+resolveFile (File file,
+ String filename)
+Interpret the filename as a file relative to the given file unless the filename already represents an absolute
+ filename.
+
+
+
+static String
+safeReadFully (Reader reader)
+Safe read fully - do not return a null for an empty reader.
+
+
+
+String
+toURI (String path)
+Constructs a file: URI that represents the external form of the given pathname.
+
+
+
+String
+toVMSPath (File f)
+Returns a VMS String representation of a File object.
+
+
+
+static String
+translatePath (String toProcess)
+Translate a path into its native (platform specific) format.
+
+
+
+boolean
+tryHardToDelete (File f)
+Accommodate Windows bug encountered in both Sun and IBM JDKs.
+
+
+
+boolean
+tryHardToDelete (File f,
+ boolean runGC)
+If delete does not work, call System.gc() if asked to, wait a little and try again.
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+NTFS_FILE_TIMESTAMP_GRANULARITY
+public static final long NTFS_FILE_TIMESTAMP_GRANULARITY
+The granularity of timestamps under the NT File System. NTFS has a granularity of 100 nanoseconds, which is less
+ than 1 millisecond, so we round this up to 1 millisecond.
+See Also: Constant Field Values
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+FileUtils
+protected FileUtils()
+Empty constructor.
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+newFileUtils
+public static FileUtils newFileUtils()
+Deprecated. since 1.7. Use getFileUtils instead, FileUtils do not have state.
+Factory method.
+Returns: a new instance of FileUtils.
+
+
+
+
+
+
+
+getFileUtils
+public static FileUtils getFileUtils()
+Method to retrieve The FileUtils, which is shared by all users of this method.
+Returns: an instance of FileUtils. Since:
+ Ant 1.6.3
+
+
+
+
+
+
+
+
+
+
+
+resolveFile
+public File resolveFile(File file,
+ String filename)
+Interpret the filename as a file relative to the given file unless the filename already represents an absolute
+ filename. Differs from new File(file, filename) in that the resulting File's path will always be a
+ normalized, absolute pathname. Also, if it is determined that filename is context-relative,
+ file will be discarded and the reference will be resolved using available context/state information
+ about the filesystem.
+Parameters: file - the "reference" file for relative paths. This instance must be an absolute file and must not contain
+ "./" or "../" sequences (same for \ instead of /). If it is null, this call is equivalent to
+ new java.io.File(filename).getAbsoluteFile().filename - a file name.
+Returns: an absolute file.
+Throws:
+NullPointerException - if filename is null.
+
+
+
+
+
+
+
+isContextRelativePath
+public static boolean isContextRelativePath(String filename)
+On DOS and NetWare, the evaluation of certain file specifications is context-dependent. These are filenames
+ beginning with a single separator (relative to current root directory) and filenames with a drive specification
+ and no intervening separator (relative to current directory of the specified root).
+Parameters: filename - the filename to evaluate.
+Returns: true if the filename is relative to system context.
+Throws:
+NullPointerException - if filename is null.Since:
+ Ant 1.7
+
+
+
+
+
+
+
+isAbsolutePath
+public static boolean isAbsolutePath(String filename)
+Verifies that the specified filename represents an absolute path. Differs from new
+ java.io.File("filename").isAbsolute() in that a path beginning with a double file separator--signifying a Windows
+ UNC--must at minimum match "\\a\b" to be considered an absolute path.
+Parameters: filename - the filename to be checked.
+Returns: true if the filename represents an absolute path.
+Throws:
+NullPointerException - if filename is null.Since:
+ Ant 1.6.3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+toVMSPath
+public String toVMSPath(File f)
+Returns a VMS String representation of a File object. This is useful since the JVM by default
+ internally converts VMS paths to Unix style. The returned String is always an absolute path.
+Parameters: f - The File to get the VMS path for.
+Returns: The absolute VMS path to f.
+
+
+
+
+
+
+
+createTempFile
+public File createTempFile(String prefix,
+ String suffix,
+ File parentDir)
+Deprecated. since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+Create a File object for a temporary file in a given directory. Without actually creating the file.
+
+
+ The file denoted by the returned abstract pathname did not exist before this method was invoked, any subsequent
+ invocation of this method will yield a different file name.
+
+
+ The filename is prefixNNNNNsuffix where NNNN is a random number.
+
+Parameters: prefix - prefix before the random number.suffix - file extension; include the '.'.parentDir - Directory to create the temporary file in; java.io.tmpdir used if not specified.
+Returns: a File reference to the new, nonexistent temporary file.
+
+
+
+
+
+
+
+createTempFile
+public File createTempFile(String prefix,
+ String suffix,
+ File parentDir,
+ boolean deleteOnExit,
+ boolean createFile)
+Create a temporary file in a given directory.
+
+
+ The file denoted by the returned abstract pathname did not exist before this method was invoked, any subsequent
+ invocation of this method will yield a different file name.
+Parameters: prefix - prefix before the random number.suffix - file extension; include the '.'.parentDir - Directory to create the temporary file in; java.io.tmpdir used if not specified.deleteOnExit - whether to set the tempfile for deletion on normal VM exit.createFile - true if the file must actually be created. If false chances exist that a file with the same
+ name is created in the time between invoking this method and the moment the file is actually created. If possible
+ set to true.
+Returns: a File reference to the new temporary file. Since:
+ Ant 1.7.1
+
+
+
+
+
+
+
+createTempFile
+public File createTempFile(String prefix,
+ String suffix,
+ File parentDir,
+ boolean deleteOnExit)
+Deprecated. since ant 1.7.1 use createTempFile(String, String, File, boolean, boolean) instead.
+Create a File object for a temporary file in a given directory. Without actually creating the file.
+
+
+ The file denoted by the returned abstract pathname did not exist before this method was invoked, any subsequent
+ invocation of this method will yield a different file name.
+
+
+ The filename is prefixNNNNNsuffix where NNNN is a random number.
+
+Parameters: prefix - prefix before the random number.suffix - file extension; include the '.'.parentDir - Directory to create the temporary file in; java.io.tmpdir used if not specified.deleteOnExit - whether to set the tempfile for deletion on normal VM exit.
+Returns: a File reference to the new, nonexistent temporary file.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+readFully
+public static String readFully(Reader rdr,
+ int bufferSize)
+ throws IOException
+Read from reader till EOF.
+Parameters: rdr - the reader from which to read.bufferSize - the buffer size to use when reading.
+Returns: the contents read out of the given reader.
+Throws:
+IOException - if the contents could not be read out from the reader.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+createNewFile
+public boolean createNewFile(File f,
+ boolean mkdirs)
+ throws IOException
+Create a new file, optionally creating parent directories.
+Parameters: f - the file to be created.mkdirs - boolean whether to create parent directories.
+Returns: true if the file did not exist already.
+Throws:
+IOException - on error.Since:
+ Ant 1.6.3
+
+
+
+
+
+
+
+isSymbolicLink
+public boolean isSymbolicLink(File parent,
+ String name)
+ throws IOException
+Deprecated. use SymbolicLinkUtils instead
+Checks whether a given file is a symbolic link.
+
+
+ It doesn't really test for symbolic links but whether the canonical and absolute paths of the file are
+ identical--this may lead to false positives on some platforms.
+Parameters: parent - the parent directory of the file to testname - the name of the file to test.
+Returns: true if the file is a symbolic link.
+Throws:
+IOException - on error.Since:
+ Ant 1.5
+
+
+
+
+
+
+
+removeLeadingPath
+public String removeLeadingPath(File leading,
+ File path)
+Removes a leading path from a second path.
+Parameters: leading - The leading path, must not be null, must be absolute.path - The path to remove from, must not be null, must be absolute.
+Returns: path's normalized absolute if it doesn't start with leading; path's path with leading's path removed
+ otherwise. Since:
+ Ant 1.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+areSame
+public boolean areSame(File f1,
+ File f2)
+ throws IOException
+Are the two File instances pointing to the same object on the file system?
+Throws:
+IOException Since:
+ Ant 1.8.2
+
+
+
+
+
+
+
+getFileTimestampGranularity
+public long getFileTimestampGranularity()
+Get the granularity of file timestamps. The choice is made based on OS, which is incorrect--it should really be
+ by filesystem. We do not have an easy way to probe for file systems, however, so this heuristic gives us a decent
+ default.
+Returns: the difference, in milliseconds, which two file timestamps must have in order for the two files to be
+ considered to have different timestamps.
+
+
+
+
+
+
+
+
+
+
+
+isUpToDate
+public boolean isUpToDate(File source,
+ File dest,
+ long granularity)
+Returns true if the source is older than the dest. If the dest file does not exist, then the test returns false;
+ it is implicitly not up do date.
+Parameters: source - source file (should be the older).dest - dest file (should be the newer).granularity - an offset added to the source time.
+Returns: true if the source is older than the dest after accounting for granularity. Since:
+ Ant 1.6.3
+
+
+
+
+
+
+
+isUpToDate
+public boolean isUpToDate(File source,
+ File dest)
+Returns true if the source is older than the dest.
+Parameters: source - source file (should be the older).dest - dest file (should be the newer).
+Returns: true if the source is older than the dest, taking the granularity into account. Since:
+ Ant 1.6.3
+
+
+
+
+
+
+
+isUpToDate
+public boolean isUpToDate(long sourceTime,
+ long destTime,
+ long granularity)
+Compare two timestamps for being up to date using the specified granularity.
+Parameters: sourceTime - timestamp of source file.destTime - timestamp of dest file.granularity - os/filesys granularity.
+Returns: true if the dest file is considered up to date.
+
+
+
+
+
+
+
+isUpToDate
+public boolean isUpToDate(long sourceTime,
+ long destTime)
+Compare two timestamps for being up to date using the current granularity.
+Parameters: sourceTime - timestamp of source file.destTime - timestamp of dest file.
+Returns: true if the dest file is considered up to date.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+tryHardToDelete
+public boolean tryHardToDelete(File f)
+Accommodate Windows bug encountered in both Sun and IBM JDKs. Others possible. If the delete does not work, call
+ System.gc(), wait a little and try again.
+Returns: whether deletion was successful Since:
+ Ant 1.8.0
+
+
+
+
+
+
+
+tryHardToDelete
+public boolean tryHardToDelete(File f,
+ boolean runGC)
+If delete does not work, call System.gc() if asked to, wait a little and try again.
+Returns: whether deletion was successful Since:
+ Ant 1.8.3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+getDefaultEncoding
+public String getDefaultEncoding()
+Get the default encoding. This is done by opening an InputStreamReader on a dummy InputStream and getting the
+ encoding. Could use System.getProperty("file.encoding"), but cannot see where this is documented.
+Returns: the default file encoding.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/SymbolicLinkUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/SymbolicLinkUtils.html
new file mode 100644
index 000000000..5ea11d028
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/SymbolicLinkUtils.html
@@ -0,0 +1,437 @@
+
+
+
+
+
+
+SymbolicLinkUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors
+
+Modifier
+Constructor and Description
+
+
+protected
+SymbolicLinkUtils ()
+Empty constructor.
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+getSymbolicLinkUtils
+public static SymbolicLinkUtils getSymbolicLinkUtils()
+Method to retrieve The SymbolicLinkUtils, which is shared by all users of this method.
+Returns: an instance of SymbolicLinkUtils.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/VectorSet.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/VectorSet.html
new file mode 100644
index 000000000..6717281ba
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/VectorSet.html
@@ -0,0 +1,757 @@
+
+
+
+
+
+
+VectorSet (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+Methods inherited from class java.util.Vector
+capacity , copyInto , elementAt , elements , ensureCapacity , equals , firstElement , get , hashCode , indexOf , indexOf , isEmpty , iterator , lastElement , lastIndexOf , lastIndexOf , listIterator , listIterator , setSize , size , subList , toArray , toArray , toString , trimToSize
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+VectorSet
+public VectorSet()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+add
+public void add(int index,
+ E o)
+This implementation may not add the element at the given index
+ if it is already contained in the collection.
+
+Specified by:
+add in interface List <E >
+Overrides:
+add in class Vector <E >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+addAll
+public boolean addAll(int index,
+ Collection <? extends E > c)
+This implementation may not add all elements at the given index
+ if any of them are already contained in the collection.
+
+Specified by:
+addAll in interface List <E >
+Overrides:
+addAll in class Vector <E >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/CollectionUtils.EmptyEnumeration.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/CollectionUtils.EmptyEnumeration.html
new file mode 100644
index 000000000..64c093796
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/CollectionUtils.EmptyEnumeration.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.EmptyEnumeration (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.EmptyEnumeration
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/CollectionUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/CollectionUtils.html
new file mode 100644
index 000000000..fa9d6fe48
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/CollectionUtils.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/FileUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/FileUtils.html
new file mode 100644
index 000000000..50478c772
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/FileUtils.html
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/SymbolicLinkUtils.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/SymbolicLinkUtils.html
new file mode 100644
index 000000000..96f931faf
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/SymbolicLinkUtils.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/VectorSet.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/VectorSet.html
new file mode 100644
index 000000000..2fdd06585
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/class-use/VectorSet.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+Uses of Class org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+No usage of org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-frame.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-frame.html
new file mode 100644
index 000000000..1c11f4ad0
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-summary.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-summary.html
new file mode 100644
index 000000000..0fe66b604
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-summary.html
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+Class Summary
+
+Class
+Description
+
+
+
+CollectionUtils
+
+A set of helper methods related to collection manipulation.
+
+
+
+CollectionUtils.EmptyEnumeration <E>
+
+An empty enumeration.
+
+
+
+FileUtils
+
+This class also encapsulates methods which allow Files to be referred to using abstract path names which are
+ translated to native system file paths at runtime as well as copying files or setting their last modification time.
+
+
+
+SymbolicLinkUtils
+
+Contains methods related to symbolic links - or what Ant thinks is a symbolic link based on the absent support for
+ them in Java.
+
+
+
+VectorSet <E>
+
+Subclass of Vector that won't store duplicate entries and shows
+ HashSet's constant time performance characteristics for the
+ contains method.
+
+
+
+
+
+
+
+
+
+
Package org.owasp.dependencycheck.org.apache.tools.ant.util Description
+
+
+
org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+ This is a copy of classes within Apache Ant. The DirectoryScanner
+ is needed by dependency-check. However, we did not want to make
+ Ant a dependency. As such, a few files were copied and slightly
+ modified to remove any references to the Ant Project class.
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-tree.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-tree.html
new file mode 100644
index 000000000..229f480e4
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-tree.html
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util Class Hierarchy (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-use.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-use.html
new file mode 100644
index 000000000..3b3a023aa
--- /dev/null
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/org/apache/tools/ant/util/package-use.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+Uses of Package org.owasp.dependencycheck.org.apache.tools.ant.util (Dependency-Check Utils 1.2.6 API)
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+
+
+Copyright© 2012-14 Jeremy Long. All Rights Reserved.
+
+
diff --git a/dependency-check-utils/apidocs/org/owasp/dependencycheck/utils/Checksum.html b/dependency-check-utils/apidocs/org/owasp/dependencycheck/utils/Checksum.html
index ec580b4d0..fb17ef7db 100644
--- a/dependency-check-utils/apidocs/org/owasp/dependencycheck/utils/Checksum.html
+++ b/dependency-check-utils/apidocs/org/owasp/dependencycheck/utils/Checksum.html
@@ -2,16 +2,16 @@
-
+
-Checksum (Dependency-Check Utils 1.2.5 API)
-
+Checksum (Dependency-Check Utils 1.2.6 API)
+
@@ -25,7 +25,8 @@
diff --git a/dependency-check-utils/checkstyle.rss b/dependency-check-utils/checkstyle.rss
index 730bab2ae..9f4326521 100644
--- a/dependency-check-utils/checkstyle.rss
+++ b/dependency-check-utils/checkstyle.rss
@@ -25,7 +25,7 @@ under the License.
en-us
©2012 - 2014 OWASP
-
-
File: 12,
+ File: 46,
Errors: 0,
Warnings: 0,
Infos: 0
@@ -46,7 +46,7 @@ under the License.
- org/owasp/dependencycheck/utils/Settings.java
+ org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-info.java
0
@@ -74,7 +74,7 @@ under the License.
- org/owasp/dependencycheck/utils/ExtractionException.java
+ org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Condition.java
0
@@ -88,7 +88,7 @@ under the License.
- org/owasp/dependencycheck/utils/LogFilter.java
+ org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceFactory.java
0
@@ -102,7 +102,7 @@ under the License.
- org/owasp/dependencycheck/utils/URLConnectionFactory.java
+ org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.java
0
@@ -116,7 +116,7 @@ under the License.
- org/owasp/dependencycheck/utils/LogUtils.java
+ org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Os.java
0
@@ -144,7 +144,21 @@ under the License.
- org/owasp/dependencycheck/utils/package-info.java
+ org/owasp/dependencycheck/org/apache/tools/ant/BuildException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/FileSelector.java
0
@@ -172,7 +186,21 @@ under the License.
- org/owasp/dependencycheck/utils/Checksum.java
+ org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorScanner.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScanner.java
0
@@ -197,6 +225,342 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/PathTokenizer.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceCollection.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/LogFilter.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/util/SymbolicLinkUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/LogUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Appendable.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/util/FileUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/launch/Locator.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/Location.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/FileScanner.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/Settings.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/URLConnectionFactory.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorUtils.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/DataType.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPath.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/Reference.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileResource.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/launch/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/Checksum.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -211,6 +575,118 @@ under the License.
0
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/util/package-info.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/utils/ExtractionException.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/ProjectComponent.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/util/VectorSet.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileProvider.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/Resource.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPattern.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Touchable.java
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
diff --git a/dependency-check-utils/cobertura/frame-packages.html b/dependency-check-utils/cobertura/frame-packages.html
index 16f3e840f..7d620ca41 100644
--- a/dependency-check-utils/cobertura/frame-packages.html
+++ b/dependency-check-utils/cobertura/frame-packages.html
@@ -13,6 +13,27 @@
All
+org.owasp.dependencycheck.org.apache.tools.ant
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
org.owasp.dependencycheck.utils
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.html b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.html
new file mode 100644
index 000000000..845f5f2cd
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.html
@@ -0,0 +1,38 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant
+
+
+Classes
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.launch.html b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.launch.html
new file mode 100644
index 000000000..2a16d8179
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.launch.html
@@ -0,0 +1,23 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+Classes
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.html b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.html
new file mode 100644
index 000000000..268e1588c
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.html
@@ -0,0 +1,26 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+Classes
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.html b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.html
new file mode 100644
index 000000000..3238d3836
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.html
@@ -0,0 +1,35 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+Classes
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.resources.html b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.resources.html
new file mode 100644
index 000000000..1b93fd7a2
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.resources.html
@@ -0,0 +1,32 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+Classes
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.html b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.html
new file mode 100644
index 000000000..78613c648
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.html
@@ -0,0 +1,35 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+Classes
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.util.html b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.util.html
new file mode 100644
index 000000000..2c415bc93
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-sourcefiles-org.owasp.dependencycheck.org.apache.tools.ant.util.html
@@ -0,0 +1,32 @@
+
+
+
+
+Coverage Report Classes
+
+
+
+
+org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+Classes
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-sourcefiles.html b/dependency-check-utils/cobertura/frame-sourcefiles.html
index eb71c9e4d..5800ed150 100644
--- a/dependency-check-utils/cobertura/frame-sourcefiles.html
+++ b/dependency-check-utils/cobertura/frame-sourcefiles.html
@@ -15,9 +15,27 @@ All Packages
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.html
new file mode 100644
index 000000000..7a3328801
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.html
@@ -0,0 +1,58 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.launch.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.launch.html
new file mode 100644
index 000000000..30f9edfe2
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.launch.html
@@ -0,0 +1,43 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.html
new file mode 100644
index 000000000..084ae32ab
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.html
@@ -0,0 +1,44 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.html
new file mode 100644
index 000000000..07944c277
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.html
@@ -0,0 +1,53 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.resources.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.resources.html
new file mode 100644
index 000000000..f2d7ecce5
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.resources.html
@@ -0,0 +1,48 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.html
new file mode 100644
index 000000000..cb0de94b8
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.html
@@ -0,0 +1,50 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.util.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.util.html
new file mode 100644
index 000000000..ff01caa6e
--- /dev/null
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.org.apache.tools.ant.util.html
@@ -0,0 +1,55 @@
+
+
+
+
+Coverage Report
+
+
+
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.utils.html b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
index e7ef3b4a7..89e619e45 100644
--- a/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
+++ b/dependency-check-utils/cobertura/frame-summary-org.owasp.dependencycheck.utils.html
@@ -59,6 +59,6 @@ var classTable = new SortableTable(document.getElementById("classResults"),
["String", "Percentage", "Percentage", "FormattedNumber"]);
classTable.sort(0);
-
+
diff --git a/dependency-check-utils/cobertura/frame-summary.html b/dependency-check-utils/cobertura/frame-summary.html
index 203735164..b3083249e 100644
--- a/dependency-check-utils/cobertura/frame-summary.html
+++ b/dependency-check-utils/cobertura/frame-summary.html
@@ -16,7 +16,14 @@
@@ -25,6 +32,6 @@ var packageTable = new SortableTable(document.getElementById("packageResults"),
["String", "Number", "Percentage", "Percentage", "FormattedNumber"]);
packageTable.sort(0);
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.BuildException.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.BuildException.html
new file mode 100644
index 000000000..557bae81b
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.BuildException.html
@@ -0,0 +1,310 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.BuildException
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant;
+ 19
+
+ 20
+
+ 21
+
+ 22
+
+ 23
+ public class BuildException extends RuntimeException {
+ 24
+
+ 25
+ private static final long serialVersionUID = -5419014565354664240L;
+ 26
+
+ 27
+
+ 28 0 private Location location = Location.UNKNOWN_LOCATION;
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+ public BuildException() {
+ 34 0 super ();
+ 35 0 }
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43
+ public BuildException(String message) {
+ 44 0 super (message);
+ 45 0 }
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+ public BuildException(String message, Throwable cause) {
+ 57 0 super (message, cause);
+ 58 0 }
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+ public BuildException(String msg, Throwable cause, Location location) {
+ 72 0 this (msg, cause);
+ 73 0 this .location = location;
+ 74 0 }
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+ public BuildException(Throwable cause) {
+ 83 0 super (cause);
+ 84 0 }
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+ public BuildException(String message, Location location) {
+ 96 0 super (message);
+ 97 0 this .location = location;
+ 98 0 }
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+ public BuildException(Throwable cause, Location location) {
+ 110 0 this (cause);
+ 111 0 this .location = location;
+ 112 0 }
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+ public Throwable getException() {
+ 122 0 return getCause();
+ 123
+ }
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+ public String toString() {
+ 131 0 return location.toString() + getMessage();
+ 132
+ }
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+ public void setLocation(Location location) {
+ 141
+ this .location = location;
+ 142
+ }
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148
+
+ 149
+ public Location getLocation() {
+ 150
+ return location;
+ 151
+ }
+ 152
+
+ 153
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner.html
new file mode 100644
index 000000000..c58f542ec
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner.html
@@ -0,0 +1,3176 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+ import java.io.IOException;
+ 22
+ import java.util.ArrayList;
+ 23
+ import java.util.Arrays;
+ 24
+ import java.util.HashMap;
+ 25
+ import java.util.HashSet;
+ 26
+ import java.util.Iterator;
+ 27
+ import java.util.LinkedList;
+ 28
+ import java.util.Map;
+ 29
+ import java.util.Set;
+ 30
+ import java.util.Vector;
+ 31
+ import org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os;
+ 32
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.Resource;
+ 33
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory;
+ 34
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource;
+ 35
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector;
+ 36
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner;
+ 37
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils;
+ 38
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath;
+ 39
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern;
+ 40
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils;
+ 41
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+ 42
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils;
+ 43
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet;
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+ public class DirectoryScanner
+ 114
+ implements FileScanner, SelectorScanner, ResourceFactory {
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119 1 private static final boolean ON_VMS = Os.isFamily("openvms" );
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130 1 protected static final String[] DEFAULTEXCLUDES = {
+ 131
+
+ 132
+ SelectorUtils.DEEP_TREE_MATCH + "/*~" ,
+ 133
+ SelectorUtils.DEEP_TREE_MATCH + "/#*#" ,
+ 134
+ SelectorUtils.DEEP_TREE_MATCH + "/.#*" ,
+ 135
+ SelectorUtils.DEEP_TREE_MATCH + "/%*%" ,
+ 136
+ SelectorUtils.DEEP_TREE_MATCH + "/._*" ,
+ 137
+
+ 138
+ SelectorUtils.DEEP_TREE_MATCH + "/CVS" ,
+ 139
+ SelectorUtils.DEEP_TREE_MATCH + "/CVS/" + SelectorUtils.DEEP_TREE_MATCH,
+ 140
+ SelectorUtils.DEEP_TREE_MATCH + "/.cvsignore" ,
+ 141
+
+ 142
+ SelectorUtils.DEEP_TREE_MATCH + "/SCCS" ,
+ 143
+ SelectorUtils.DEEP_TREE_MATCH + "/SCCS/" + SelectorUtils.DEEP_TREE_MATCH,
+ 144
+
+ 145
+ SelectorUtils.DEEP_TREE_MATCH + "/vssver.scc" ,
+ 146
+
+ 147
+ SelectorUtils.DEEP_TREE_MATCH + "/.svn" ,
+ 148
+ SelectorUtils.DEEP_TREE_MATCH + "/.svn/" + SelectorUtils.DEEP_TREE_MATCH,
+ 149
+
+ 150
+ SelectorUtils.DEEP_TREE_MATCH + "/.git" ,
+ 151
+ SelectorUtils.DEEP_TREE_MATCH + "/.git/" + SelectorUtils.DEEP_TREE_MATCH,
+ 152
+ SelectorUtils.DEEP_TREE_MATCH + "/.gitattributes" ,
+ 153
+ SelectorUtils.DEEP_TREE_MATCH + "/.gitignore" ,
+ 154
+ SelectorUtils.DEEP_TREE_MATCH + "/.gitmodules" ,
+ 155
+
+ 156
+ SelectorUtils.DEEP_TREE_MATCH + "/.hg" ,
+ 157
+ SelectorUtils.DEEP_TREE_MATCH + "/.hg/" + SelectorUtils.DEEP_TREE_MATCH,
+ 158
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgignore" ,
+ 159
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgsub" ,
+ 160
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgsubstate" ,
+ 161
+ SelectorUtils.DEEP_TREE_MATCH + "/.hgtags" ,
+ 162
+
+ 163
+ SelectorUtils.DEEP_TREE_MATCH + "/.bzr" ,
+ 164
+ SelectorUtils.DEEP_TREE_MATCH + "/.bzr/" + SelectorUtils.DEEP_TREE_MATCH,
+ 165
+ SelectorUtils.DEEP_TREE_MATCH + "/.bzrignore" ,
+ 166
+
+ 167
+ SelectorUtils.DEEP_TREE_MATCH + "/.DS_Store"
+ 168
+ };
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+ public static final int MAX_LEVELS_OF_SYMLINKS = 5;
+ 176
+
+ 177
+
+ 178
+
+ 179
+ public static final String DOES_NOT_EXIST_POSTFIX = " does not exist." ;
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184 1 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189 1 private static final SymbolicLinkUtils SYMLINK_UTILS
+ 190
+ = SymbolicLinkUtils.getSymbolicLinkUtils();
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197 1 private static final Set<String> defaultExcludes = new HashSet<String>();
+ 198
+
+ 199
+ static {
+ 200 1 resetDefaultExcludes();
+ 201 1 }
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+ protected File basedir;
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+ protected String[] includes;
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+ protected String[] excludes;
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222 1 protected FileSelector[] selectors = null ;
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+ protected Vector<String> filesIncluded;
+ 228
+
+ 229
+
+ 230
+
+ 231
+
+ 232
+ protected Vector<String> filesNotIncluded;
+ 233
+
+ 234
+
+ 235
+
+ 236
+
+ 237
+ protected Vector<String> filesExcluded;
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+ protected Vector<String> dirsIncluded;
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+ protected Vector<String> dirsNotIncluded;
+ 248
+
+ 249
+
+ 250
+
+ 251
+
+ 252
+ protected Vector<String> dirsExcluded;
+ 253
+
+ 254
+
+ 255
+
+ 256
+
+ 257
+ protected Vector<String> filesDeselected;
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+ protected Vector<String> dirsDeselected;
+ 263
+
+ 264
+
+ 265
+
+ 266
+
+ 267 1 protected boolean haveSlowResults = false ;
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272 1 protected boolean isCaseSensitive = true ;
+ 273
+
+ 274
+
+ 275
+
+ 276
+
+ 277
+
+ 278
+
+ 279 1 protected boolean errorOnMissingDir = true ;
+ 280
+
+ 281
+
+ 282
+
+ 283
+
+ 284
+
+ 285
+
+ 286 1 private boolean followSymlinks = true ;
+ 287
+
+ 288
+
+ 289
+
+ 290
+
+ 291 1 protected boolean everythingIncluded = true ;
+ 292
+
+ 293
+
+ 294
+
+ 295
+
+ 296
+
+ 297
+
+ 298
+
+ 299 1 private Set<String> scannedDirs = new HashSet<String>();
+ 300
+
+ 301
+
+ 302
+
+ 303
+
+ 304
+
+ 305
+
+ 306
+
+ 307
+
+ 308
+
+ 309
+
+ 310
+
+ 311
+
+ 312
+
+ 313
+
+ 314
+
+ 315
+
+ 316 1 private Map<String, TokenizedPath> includeNonPatterns = new HashMap<String, TokenizedPath>();
+ 317
+
+ 318
+
+ 319
+
+ 320
+
+ 321
+
+ 322
+
+ 323
+
+ 324
+
+ 325
+
+ 326
+
+ 327
+
+ 328
+
+ 329
+
+ 330
+
+ 331
+
+ 332
+
+ 333 1 private Map<String, TokenizedPath> excludeNonPatterns = new HashMap<String, TokenizedPath>();
+ 334
+
+ 335
+
+ 336
+
+ 337
+
+ 338
+
+ 339
+
+ 340
+
+ 341
+
+ 342
+ private TokenizedPattern[] includePatterns;
+ 343
+
+ 344
+
+ 345
+
+ 346
+
+ 347
+
+ 348
+
+ 349
+
+ 350
+
+ 351
+ private TokenizedPattern[] excludePatterns;
+ 352
+
+ 353
+
+ 354
+
+ 355
+
+ 356
+
+ 357
+
+ 358 1 private boolean areNonPatternSetsReady = false ;
+ 359
+
+ 360
+
+ 361
+
+ 362
+
+ 363
+
+ 364
+
+ 365 1 private boolean scanning = false ;
+ 366
+
+ 367
+
+ 368
+
+ 369
+
+ 370
+
+ 371
+
+ 372 1 private Object scanLock = new Object();
+ 373
+
+ 374
+
+ 375
+
+ 376
+
+ 377
+
+ 378
+
+ 379 1 private boolean slowScanning = false ;
+ 380
+
+ 381
+
+ 382
+
+ 383
+
+ 384
+
+ 385
+
+ 386 1 private Object slowScanLock = new Object();
+ 387
+
+ 388
+
+ 389
+
+ 390
+
+ 391
+
+ 392
+
+ 393 1 private IllegalStateException illegal = null ;
+ 394
+
+ 395
+
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400 1 private int maxLevelsOfSymlinks = MAX_LEVELS_OF_SYMLINKS;
+ 401
+
+ 402
+
+ 403
+
+ 404
+
+ 405
+
+ 406
+
+ 407
+
+ 408 1 private Set<String> notFollowedSymlinks = new HashSet<String>();
+ 409
+
+ 410
+
+ 411
+
+ 412
+
+ 413 1 public DirectoryScanner() {
+ 414 1 }
+ 415
+
+ 416
+
+ 417
+
+ 418
+
+ 419
+
+ 420
+
+ 421
+
+ 422
+
+ 423
+
+ 424
+
+ 425
+
+ 426
+
+ 427
+ protected static boolean matchPatternStart(String pattern, String str) {
+ 428 1 return SelectorUtils.matchPatternStart(pattern, str);
+ 429
+ }
+ 430
+
+ 431
+
+ 432
+
+ 433
+
+ 434
+
+ 435
+
+ 436
+
+ 437
+
+ 438
+
+ 439
+
+ 440
+
+ 441
+
+ 442
+
+ 443
+ protected static boolean matchPatternStart(String pattern, String str,
+ 444
+ boolean isCaseSensitive) {
+ 445 2 return SelectorUtils.matchPatternStart(pattern, str, isCaseSensitive);
+ 446
+ }
+ 447
+
+ 448
+
+ 449
+
+ 450
+
+ 451
+
+ 452
+
+ 453
+
+ 454
+
+ 455
+
+ 456
+ protected static boolean matchPath(String pattern, String str) {
+ 457 1 return SelectorUtils.matchPath(pattern, str);
+ 458
+ }
+ 459
+
+ 460
+
+ 461
+
+ 462
+
+ 463
+
+ 464
+
+ 465
+
+ 466
+
+ 467
+
+ 468
+
+ 469
+ protected static boolean matchPath(String pattern, String str,
+ 470
+ boolean isCaseSensitive) {
+ 471 0 return SelectorUtils.matchPath(pattern, str, isCaseSensitive);
+ 472
+ }
+ 473
+
+ 474
+
+ 475
+
+ 476
+
+ 477
+
+ 478
+
+ 479
+
+ 480
+
+ 481
+
+ 482
+
+ 483
+
+ 484
+ public static boolean match(String pattern, String str) {
+ 485 0 return SelectorUtils.match(pattern, str);
+ 486
+ }
+ 487
+
+ 488
+
+ 489
+
+ 490
+
+ 491
+
+ 492
+
+ 493
+
+ 494
+
+ 495
+
+ 496
+
+ 497
+
+ 498
+
+ 499
+
+ 500
+ protected static boolean match(String pattern, String str,
+ 501
+ boolean isCaseSensitive) {
+ 502 0 return SelectorUtils.match(pattern, str, isCaseSensitive);
+ 503
+ }
+ 504
+
+ 505
+
+ 506
+
+ 507
+
+ 508
+
+ 509
+
+ 510
+
+ 511
+
+ 512
+
+ 513
+ public static String[] getDefaultExcludes() {
+ 514 0 synchronized (defaultExcludes) {
+ 515 0 return (String[]) defaultExcludes.toArray(new String[defaultExcludes
+ 516
+ .size()]);
+ 517 0 }
+ 518
+ }
+ 519
+
+ 520
+
+ 521
+
+ 522
+
+ 523
+
+ 524
+
+ 525
+
+ 526
+
+ 527
+
+ 528
+ public static boolean addDefaultExclude(String s) {
+ 529 0 synchronized (defaultExcludes) {
+ 530 0 return defaultExcludes.add(s);
+ 531 0 }
+ 532
+ }
+ 533
+
+ 534
+
+ 535
+
+ 536
+
+ 537
+
+ 538
+
+ 539
+
+ 540
+
+ 541
+
+ 542
+
+ 543
+ public static boolean removeDefaultExclude(String s) {
+ 544 0 synchronized (defaultExcludes) {
+ 545 0 return defaultExcludes.remove(s);
+ 546 0 }
+ 547
+ }
+ 548
+
+ 549
+
+ 550
+
+ 551
+
+ 552
+
+ 553
+
+ 554
+ public static void resetDefaultExcludes() {
+ 555 1 synchronized (defaultExcludes) {
+ 556 1 defaultExcludes.clear();
+ 557 29 for (int i = 0; i < DEFAULTEXCLUDES.length; i++) {
+ 558 28 defaultExcludes.add(DEFAULTEXCLUDES[i]);
+ 559
+ }
+ 560 1 }
+ 561 1 }
+ 562
+
+ 563
+
+ 564
+
+ 565
+
+ 566
+
+ 567
+
+ 568
+
+ 569
+
+ 570
+ public void setBasedir(String basedir) {
+ 571 1 setBasedir(basedir == null ? (File) null
+ 572
+ : new File(basedir.replace('/' , File.separatorChar).replace(
+ 573
+ '\\' , File.separatorChar)));
+ 574 1 }
+ 575
+
+ 576
+
+ 577
+
+ 578
+
+ 579
+
+ 580
+
+ 581
+ public synchronized void setBasedir(File basedir) {
+ 582
+ this .basedir = basedir;
+ 583
+ }
+ 584
+
+ 585
+
+ 586
+
+ 587
+
+ 588
+
+ 589
+
+ 590
+ public synchronized File getBasedir() {
+ 591
+ return basedir;
+ 592
+ }
+ 593
+
+ 594
+
+ 595
+
+ 596
+
+ 597
+
+ 598
+
+ 599
+
+ 600
+ public synchronized boolean isCaseSensitive() {
+ 601
+ return isCaseSensitive;
+ 602
+ }
+ 603
+
+ 604
+
+ 605
+
+ 606
+
+ 607
+
+ 608
+
+ 609
+ public synchronized void setCaseSensitive(boolean isCaseSensitive) {
+ 610
+ this .isCaseSensitive = isCaseSensitive;
+ 611
+ }
+ 612
+
+ 613
+
+ 614
+
+ 615
+
+ 616
+
+ 617
+
+ 618
+
+ 619
+ public void setErrorOnMissingDir(boolean errorOnMissingDir) {
+ 620
+ this .errorOnMissingDir = errorOnMissingDir;
+ 621
+ }
+ 622
+
+ 623
+
+ 624
+
+ 625
+
+ 626
+
+ 627
+
+ 628
+
+ 629
+
+ 630
+ public synchronized boolean isFollowSymlinks() {
+ 631
+ return followSymlinks;
+ 632
+ }
+ 633
+
+ 634
+
+ 635
+
+ 636
+
+ 637
+
+ 638
+
+ 639
+ public synchronized void setFollowSymlinks(boolean followSymlinks) {
+ 640
+ this .followSymlinks = followSymlinks;
+ 641
+ }
+ 642
+
+ 643
+
+ 644
+
+ 645
+
+ 646
+
+ 647
+
+ 648
+ public void setMaxLevelsOfSymlinks(int max) {
+ 649
+ maxLevelsOfSymlinks = max;
+ 650
+ }
+ 651
+
+ 652
+
+ 653
+
+ 654
+
+ 655
+
+ 656
+
+ 657
+
+ 658
+
+ 659
+
+ 660
+
+ 661
+ public synchronized void setIncludes(String[] includes) {
+ 662 0 if (includes == null ) {
+ 663 0 this .includes = null ;
+ 664
+ } else {
+ 665 0 this .includes = new String[includes.length];
+ 666 0 for (int i = 0; i < includes.length; i++) {
+ 667 0 this .includes[i] = normalizePattern(includes[i]);
+ 668
+ }
+ 669
+ }
+ 670 0 }
+ 671
+
+ 672
+ public synchronized void setIncludes(String include) {
+ 673 1 if (include == null ) {
+ 674 0 this .includes = null ;
+ 675
+ } else {
+ 676 1 this .includes = new String[1];
+ 677 1 this .includes[0] = normalizePattern(include);
+ 678
+ }
+ 679 1 }
+ 680
+
+ 681
+
+ 682
+
+ 683
+
+ 684
+
+ 685
+
+ 686
+
+ 687
+
+ 688
+
+ 689
+
+ 690
+ public synchronized void setExcludes(String[] excludes) {
+ 691 0 if (excludes == null ) {
+ 692 0 this .excludes = null ;
+ 693
+ } else {
+ 694 0 this .excludes = new String[excludes.length];
+ 695 0 for (int i = 0; i < excludes.length; i++) {
+ 696 0 this .excludes[i] = normalizePattern(excludes[i]);
+ 697
+ }
+ 698
+ }
+ 699 0 }
+ 700
+
+ 701
+
+ 702
+
+ 703
+
+ 704
+
+ 705
+
+ 706
+
+ 707
+
+ 708
+
+ 709
+
+ 710
+
+ 711
+
+ 712
+ public synchronized void addExcludes(String[] excludes) {
+ 713 0 if (excludes != null && excludes.length > 0) {
+ 714 0 if (this .excludes != null && this .excludes.length > 0) {
+ 715 0 String[] tmp = new String[excludes.length
+ 716
+ + this .excludes.length];
+ 717 0 System.arraycopy(this .excludes, 0, tmp, 0,
+ 718
+ this .excludes.length);
+ 719 0 for (int i = 0; i < excludes.length; i++) {
+ 720 0 tmp[this .excludes.length + i]
+ 721
+ = normalizePattern(excludes[i]);
+ 722
+ }
+ 723 0 this .excludes = tmp;
+ 724 0 } else {
+ 725 0 setExcludes(excludes);
+ 726
+ }
+ 727
+ }
+ 728 0 }
+ 729
+
+ 730
+
+ 731
+
+ 732
+
+ 733
+
+ 734
+
+ 735
+
+ 736
+
+ 737
+
+ 738
+
+ 739
+ private static String normalizePattern(String p) {
+ 740 1 String pattern = p.replace('/' , File.separatorChar)
+ 741
+ .replace('\\' , File.separatorChar);
+ 742 1 if (pattern.endsWith(File.separator)) {
+ 743 0 pattern += SelectorUtils.DEEP_TREE_MATCH;
+ 744
+ }
+ 745 1 return pattern;
+ 746
+ }
+ 747
+
+ 748
+
+ 749
+
+ 750
+
+ 751
+
+ 752
+
+ 753
+ public synchronized void setSelectors(FileSelector[] selectors) {
+ 754
+ this .selectors = selectors;
+ 755
+ }
+ 756
+
+ 757
+
+ 758
+
+ 759
+
+ 760
+
+ 761
+
+ 762
+ public synchronized boolean isEverythingIncluded() {
+ 763
+ return everythingIncluded;
+ 764
+ }
+ 765
+
+ 766
+
+ 767
+
+ 768
+
+ 769
+
+ 770
+
+ 771
+
+ 772
+
+ 773
+
+ 774
+ public void scan() throws IllegalStateException {
+ 775 1 synchronized (scanLock) {
+ 776 1 if (scanning) {
+ 777 0 while (scanning) {
+ 778
+ try {
+ 779 0 scanLock.wait();
+ 780 0 } catch (InterruptedException e) {
+ 781 0 continue ;
+ 782 0 }
+ 783
+ }
+ 784 0 if (illegal != null ) {
+ 785 0 throw illegal;
+ 786
+ }
+ 787 0 return ;
+ 788
+ }
+ 789 1 scanning = true ;
+ 790 1 }
+ 791 1 File savedBase = basedir;
+ 792
+ try {
+ 793 1 synchronized (this ) {
+ 794 1 illegal = null ;
+ 795 1 clearResults();
+ 796
+
+ 797
+
+ 798 1 boolean nullIncludes = (includes == null );
+ 799 1 includes = nullIncludes
+ 800
+ ? new String[]{SelectorUtils.DEEP_TREE_MATCH} : includes;
+ 801 1 boolean nullExcludes = (excludes == null );
+ 802 1 excludes = nullExcludes ? new String[0] : excludes;
+ 803
+
+ 804 1 if (basedir != null && !followSymlinks
+ 805
+ && SYMLINK_UTILS.isSymbolicLink(basedir)) {
+ 806 0 notFollowedSymlinks.add(basedir.getAbsolutePath());
+ 807 0 basedir = null ;
+ 808
+ }
+ 809
+
+ 810 1 if (basedir == null ) {
+ 811
+
+ 812 0 if (nullIncludes) {
+ 813 0 return ;
+ 814
+ }
+ 815
+ } else {
+ 816 1 if (!basedir.exists()) {
+ 817 0 if (errorOnMissingDir) {
+ 818 0 illegal = new IllegalStateException("basedir "
+ 819
+ + basedir
+ 820
+ + DOES_NOT_EXIST_POSTFIX);
+ 821
+ } else {
+ 822
+
+ 823 0 return ;
+ 824
+ }
+ 825 1 } else if (!basedir.isDirectory()) {
+ 826 0 illegal = new IllegalStateException("basedir "
+ 827
+ + basedir
+ 828
+ + " is not a"
+ 829
+ + " directory." );
+ 830
+ }
+ 831 1 if (illegal != null ) {
+ 832 0 throw illegal;
+ 833
+ }
+ 834
+ }
+ 835 1 if (isIncluded(TokenizedPath.EMPTY_PATH)) {
+ 836 0 if (!isExcluded(TokenizedPath.EMPTY_PATH)) {
+ 837 0 if (isSelected("" , basedir)) {
+ 838 0 dirsIncluded.addElement("" );
+ 839
+ } else {
+ 840 0 dirsDeselected.addElement("" );
+ 841
+ }
+ 842
+ } else {
+ 843 0 dirsExcluded.addElement("" );
+ 844
+ }
+ 845
+ } else {
+ 846 1 dirsNotIncluded.addElement("" );
+ 847
+ }
+ 848 1 checkIncludePatterns();
+ 849 1 clearCaches();
+ 850 1 includes = nullIncludes ? null : includes;
+ 851 1 excludes = nullExcludes ? null : excludes;
+ 852 1 }
+ 853 0 } catch (IOException ex) {
+ 854 0 throw new BuildException(ex);
+ 855
+ } finally {
+ 856 1 basedir = savedBase;
+ 857 1 synchronized (scanLock) {
+ 858 1 scanning = false ;
+ 859 1 scanLock.notifyAll();
+ 860 1 }
+ 861 1 }
+ 862 1 }
+ 863
+
+ 864
+
+ 865
+
+ 866
+
+ 867
+
+ 868
+
+ 869
+ private void checkIncludePatterns() {
+ 870 1 ensureNonPatternSetsReady();
+ 871 1 Map<TokenizedPath, String> newroots = new HashMap<TokenizedPath, String>();
+ 872
+
+ 873
+
+ 874
+
+ 875 2 for (int i = 0; i < includePatterns.length; i++) {
+ 876 1 String pattern = includePatterns[i].toString();
+ 877 1 if (!shouldSkipPattern(pattern)) {
+ 878 1 newroots.put(includePatterns[i].rtrimWildcardTokens(),
+ 879
+ pattern);
+ 880
+ }
+ 881
+ }
+ 882 1 for (Map.Entry<String, TokenizedPath> entry : includeNonPatterns.entrySet()) {
+ 883 0 String pattern = entry.getKey();
+ 884 0 if (!shouldSkipPattern(pattern)) {
+ 885 0 newroots.put(entry.getValue(), pattern);
+ 886
+ }
+ 887 0 }
+ 888
+
+ 889 1 if (newroots.containsKey(TokenizedPath.EMPTY_PATH)
+ 890
+ && basedir != null ) {
+ 891
+
+ 892 0 scandir(basedir, "" , true );
+ 893
+ } else {
+ 894 1 File canonBase = null ;
+ 895 1 if (basedir != null ) {
+ 896
+ try {
+ 897 1 canonBase = basedir.getCanonicalFile();
+ 898 0 } catch (IOException ex) {
+ 899 0 throw new BuildException(ex);
+ 900 1 }
+ 901
+ }
+ 902
+
+ 903
+
+ 904 1 for (Map.Entry<TokenizedPath, String> entry : newroots.entrySet()) {
+ 905 1 TokenizedPath currentPath = entry.getKey();
+ 906 1 String currentelement = currentPath.toString();
+ 907 1 if (basedir == null
+ 908
+ && !FileUtils.isAbsolutePath(currentelement)) {
+ 909 0 continue ;
+ 910
+ }
+ 911 1 File myfile = new File(basedir, currentelement);
+ 912
+
+ 913 1 if (myfile.exists()) {
+ 914
+
+ 915
+
+ 916
+
+ 917
+ try {
+ 918 1 String path = (basedir == null )
+ 919
+ ? myfile.getCanonicalPath()
+ 920
+ : FILE_UTILS.removeLeadingPath(canonBase,
+ 921
+ myfile.getCanonicalFile());
+ 922 1 if (!path.equals(currentelement) || ON_VMS) {
+ 923 0 myfile = currentPath.findFile(basedir, true );
+ 924 0 if (myfile != null && basedir != null ) {
+ 925 0 currentelement = FILE_UTILS.removeLeadingPath(
+ 926
+ basedir, myfile);
+ 927 0 if (!currentPath.toString()
+ 928
+ .equals(currentelement)) {
+ 929 0 currentPath
+ 930
+ = new TokenizedPath(currentelement);
+ 931
+ }
+ 932
+ }
+ 933
+ }
+ 934 0 } catch (IOException ex) {
+ 935 0 throw new BuildException(ex);
+ 936 1 }
+ 937
+ }
+ 938
+
+ 939 1 if ((myfile == null || !myfile.exists()) && !isCaseSensitive()) {
+ 940 0 File f = currentPath.findFile(basedir, false );
+ 941 0 if (f != null && f.exists()) {
+ 942
+
+ 943
+
+ 944 0 currentelement = (basedir == null )
+ 945
+ ? f.getAbsolutePath()
+ 946
+ : FILE_UTILS.removeLeadingPath(basedir, f);
+ 947 0 myfile = f;
+ 948 0 currentPath = new TokenizedPath(currentelement);
+ 949
+ }
+ 950
+ }
+ 951
+
+ 952 1 if (myfile != null && myfile.exists()) {
+ 953 1 if (!followSymlinks && currentPath.isSymlink(basedir)) {
+ 954 0 accountForNotFollowedSymlink(currentPath, myfile);
+ 955 0 continue ;
+ 956
+ }
+ 957 1 if (myfile.isDirectory()) {
+ 958 1 if (isIncluded(currentPath)
+ 959
+ && currentelement.length() > 0) {
+ 960 1 accountForIncludedDir(currentPath, myfile, true );
+ 961
+ } else {
+ 962 0 scandir(myfile, currentPath, true );
+ 963
+ }
+ 964 0 } else if (myfile.isFile()) {
+ 965 0 String originalpattern = (String) entry.getValue();
+ 966 0 boolean included = isCaseSensitive()
+ 967
+ ? originalpattern.equals(currentelement)
+ 968
+ : originalpattern.equalsIgnoreCase(currentelement);
+ 969 0 if (included) {
+ 970 0 accountForIncludedFile(currentPath, myfile);
+ 971
+ }
+ 972
+ }
+ 973
+ }
+ 974 1 }
+ 975
+ }
+ 976 1 }
+ 977
+
+ 978
+
+ 979
+
+ 980
+
+ 981
+
+ 982
+
+ 983
+ private boolean shouldSkipPattern(String pattern) {
+ 984 1 if (FileUtils.isAbsolutePath(pattern)) {
+ 985
+
+ 986 0 if (basedir != null
+ 987
+ && !SelectorUtils.matchPatternStart(pattern,
+ 988
+ basedir.getAbsolutePath(),
+ 989
+ isCaseSensitive())) {
+ 990 0 return true ;
+ 991
+ }
+ 992 1 } else if (basedir == null ) {
+ 993
+
+ 994 0 return true ;
+ 995
+ }
+ 996 1 return false ;
+ 997
+ }
+ 998
+
+ 999
+
+ 1000
+
+ 1001
+
+ 1002
+ protected synchronized void clearResults() {
+ 1003 1 filesIncluded = new VectorSet<String>();
+ 1004 1 filesNotIncluded = new VectorSet<String>();
+ 1005 1 filesExcluded = new VectorSet<String>();
+ 1006 1 filesDeselected = new VectorSet<String>();
+ 1007 1 dirsIncluded = new VectorSet<String>();
+ 1008 1 dirsNotIncluded = new VectorSet<String>();
+ 1009 1 dirsExcluded = new VectorSet<String>();
+ 1010 1 dirsDeselected = new VectorSet<String>();
+ 1011 1 everythingIncluded = (basedir != null );
+ 1012 1 scannedDirs.clear();
+ 1013 1 notFollowedSymlinks.clear();
+ 1014 1 }
+ 1015
+
+ 1016
+
+ 1017
+
+ 1018
+
+ 1019
+
+ 1020
+
+ 1021
+
+ 1022
+
+ 1023
+ protected void slowScan() {
+ 1024 0 synchronized (slowScanLock) {
+ 1025 0 if (haveSlowResults) {
+ 1026 0 return ;
+ 1027
+ }
+ 1028 0 if (slowScanning) {
+ 1029 0 while (slowScanning) {
+ 1030
+ try {
+ 1031 0 slowScanLock.wait();
+ 1032 0 } catch (InterruptedException e) {
+ 1033
+
+ 1034 0 }
+ 1035
+ }
+ 1036 0 return ;
+ 1037
+ }
+ 1038 0 slowScanning = true ;
+ 1039 0 }
+ 1040
+ try {
+ 1041 0 synchronized (this ) {
+ 1042
+
+ 1043
+
+ 1044 0 boolean nullIncludes = (includes == null );
+ 1045 0 includes = nullIncludes
+ 1046
+ ? new String[]{SelectorUtils.DEEP_TREE_MATCH} : includes;
+ 1047 0 boolean nullExcludes = (excludes == null );
+ 1048 0 excludes = nullExcludes ? new String[0] : excludes;
+ 1049
+
+ 1050 0 String[] excl = new String[dirsExcluded.size()];
+ 1051 0 dirsExcluded.copyInto(excl);
+ 1052
+
+ 1053 0 String[] notIncl = new String[dirsNotIncluded.size()];
+ 1054 0 dirsNotIncluded.copyInto(notIncl);
+ 1055
+
+ 1056 0 ensureNonPatternSetsReady();
+ 1057
+
+ 1058 0 processSlowScan(excl);
+ 1059 0 processSlowScan(notIncl);
+ 1060 0 clearCaches();
+ 1061 0 includes = nullIncludes ? null : includes;
+ 1062 0 excludes = nullExcludes ? null : excludes;
+ 1063 0 }
+ 1064
+ } finally {
+ 1065 0 synchronized (slowScanLock) {
+ 1066 0 haveSlowResults = true ;
+ 1067 0 slowScanning = false ;
+ 1068 0 slowScanLock.notifyAll();
+ 1069 0 }
+ 1070 0 }
+ 1071 0 }
+ 1072
+
+ 1073
+ private void processSlowScan(String[] arr) {
+ 1074 0 for (int i = 0; i < arr.length; i++) {
+ 1075 0 TokenizedPath path = new TokenizedPath(arr[i]);
+ 1076 0 if (!couldHoldIncluded(path) || contentsExcluded(path)) {
+ 1077 0 scandir(new File(basedir, arr[i]), path, false );
+ 1078
+ }
+ 1079
+ }
+ 1080 0 }
+ 1081
+
+ 1082
+
+ 1083
+
+ 1084
+
+ 1085
+
+ 1086
+
+ 1087
+
+ 1088
+
+ 1089
+
+ 1090
+
+ 1091
+
+ 1092
+
+ 1093
+
+ 1094
+
+ 1095
+
+ 1096
+
+ 1097
+
+ 1098
+
+ 1099
+
+ 1100
+ protected void scandir(File dir, String vpath, boolean fast) {
+ 1101 0 scandir(dir, new TokenizedPath(vpath), fast);
+ 1102 0 }
+ 1103
+
+ 1104
+
+ 1105
+
+ 1106
+
+ 1107
+
+ 1108
+
+ 1109
+
+ 1110
+
+ 1111
+
+ 1112
+
+ 1113
+
+ 1114
+
+ 1115
+
+ 1116
+
+ 1117
+
+ 1118
+
+ 1119
+
+ 1120
+
+ 1121
+
+ 1122
+ private void scandir(File dir, TokenizedPath path, boolean fast) {
+ 1123 1 if (dir == null ) {
+ 1124 0 throw new BuildException("dir must not be null." );
+ 1125
+ }
+ 1126 1 String[] newfiles = dir.list();
+ 1127 1 if (newfiles == null ) {
+ 1128 0 if (!dir.exists()) {
+ 1129 0 throw new BuildException(dir + DOES_NOT_EXIST_POSTFIX);
+ 1130 0 } else if (!dir.isDirectory()) {
+ 1131 0 throw new BuildException(dir + " is not a directory." );
+ 1132
+ } else {
+ 1133 0 throw new BuildException("IO error scanning directory '"
+ 1134
+ + dir.getAbsolutePath() + "'" );
+ 1135
+ }
+ 1136
+ }
+ 1137 1 scandir(dir, path, fast, newfiles, new LinkedList<String>());
+ 1138 1 }
+ 1139
+
+ 1140
+ private void scandir(File dir, TokenizedPath path, boolean fast,
+ 1141
+ String[] newfiles, LinkedList<String> directoryNamesFollowed) {
+ 1142 9 String vpath = path.toString();
+ 1143 9 if (vpath.length() > 0 && !vpath.endsWith(File.separator)) {
+ 1144 9 vpath += File.separator;
+ 1145
+ }
+ 1146
+
+ 1147
+
+ 1148 9 if (fast && hasBeenScanned(vpath)) {
+ 1149 0 return ;
+ 1150
+ }
+ 1151 9 if (!followSymlinks) {
+ 1152 0 ArrayList<String> noLinks = new ArrayList<String>();
+ 1153 0 for (int i = 0; i < newfiles.length; i++) {
+ 1154
+ try {
+ 1155 0 if (SYMLINK_UTILS.isSymbolicLink(dir, newfiles[i])) {
+ 1156 0 String name = vpath + newfiles[i];
+ 1157 0 File file = new File(dir, newfiles[i]);
+ 1158 0 if (file.isDirectory()) {
+ 1159 0 dirsExcluded.addElement(name);
+ 1160 0 } else if (file.isFile()) {
+ 1161 0 filesExcluded.addElement(name);
+ 1162
+ }
+ 1163 0 accountForNotFollowedSymlink(name, file);
+ 1164 0 } else {
+ 1165 0 noLinks.add(newfiles[i]);
+ 1166
+ }
+ 1167 0 } catch (IOException ioe) {
+ 1168 0 String msg = "IOException caught while checking "
+ 1169
+ + "for links, couldn't get canonical path!" ;
+ 1170
+
+ 1171 0 System.err.println(msg);
+ 1172 0 noLinks.add(newfiles[i]);
+ 1173 0 }
+ 1174
+ }
+ 1175 0 newfiles = (String[]) (noLinks.toArray(new String[noLinks.size()]));
+ 1176 0 } else {
+ 1177 9 directoryNamesFollowed.addFirst(dir.getName());
+ 1178
+ }
+ 1179
+
+ 1180 27 for (int i = 0; i < newfiles.length; i++) {
+ 1181 18 String name = vpath + newfiles[i];
+ 1182 18 TokenizedPath newPath = new TokenizedPath(path, newfiles[i]);
+ 1183 18 File file = new File(dir, newfiles[i]);
+ 1184 18 String[] children = file.list();
+ 1185 18 if (children == null || (children.length == 0 && file.isFile())) {
+ 1186 10 if (isIncluded(newPath)) {
+ 1187 10 accountForIncludedFile(newPath, file);
+ 1188
+ } else {
+ 1189 0 everythingIncluded = false ;
+ 1190 0 filesNotIncluded.addElement(name);
+ 1191
+ }
+ 1192 8 } else if (file.isDirectory()) {
+ 1193
+
+ 1194 8 if (followSymlinks
+ 1195
+ && causesIllegalSymlinkLoop(newfiles[i], dir,
+ 1196
+ directoryNamesFollowed)) {
+ 1197
+
+ 1198 0 System.err.println("skipping symbolic link "
+ 1199
+ + file.getAbsolutePath()
+ 1200
+ + " -- too many levels of symbolic"
+ 1201
+ + " links." );
+ 1202 0 notFollowedSymlinks.add(file.getAbsolutePath());
+ 1203 0 continue ;
+ 1204
+ }
+ 1205
+
+ 1206 8 if (isIncluded(newPath)) {
+ 1207 8 accountForIncludedDir(newPath, file, fast, children,
+ 1208
+ directoryNamesFollowed);
+ 1209
+ } else {
+ 1210 0 everythingIncluded = false ;
+ 1211 0 dirsNotIncluded.addElement(name);
+ 1212 0 if (fast && couldHoldIncluded(newPath)
+ 1213
+ && !contentsExcluded(newPath)) {
+ 1214 0 scandir(file, newPath, fast, children,
+ 1215
+ directoryNamesFollowed);
+ 1216
+ }
+ 1217
+ }
+ 1218 8 if (!fast) {
+ 1219 0 scandir(file, newPath, fast, children, directoryNamesFollowed);
+ 1220
+ }
+ 1221
+ }
+ 1222
+ }
+ 1223
+
+ 1224 9 if (followSymlinks) {
+ 1225 9 directoryNamesFollowed.removeFirst();
+ 1226
+ }
+ 1227 9 }
+ 1228
+
+ 1229
+
+ 1230
+
+ 1231
+
+ 1232
+
+ 1233
+
+ 1234
+
+ 1235
+ private void accountForIncludedFile(TokenizedPath name, File file) {
+ 1236 10 processIncluded(name, file, filesIncluded, filesExcluded,
+ 1237
+ filesDeselected);
+ 1238 10 }
+ 1239
+
+ 1240
+
+ 1241
+
+ 1242
+
+ 1243
+
+ 1244
+
+ 1245
+
+ 1246
+
+ 1247
+ private void accountForIncludedDir(TokenizedPath name, File file,
+ 1248
+ boolean fast) {
+ 1249 1 processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
+ 1250 1 if (fast && couldHoldIncluded(name) && !contentsExcluded(name)) {
+ 1251 1 scandir(file, name, fast);
+ 1252
+ }
+ 1253 1 }
+ 1254
+
+ 1255
+ private void accountForIncludedDir(TokenizedPath name,
+ 1256
+ File file, boolean fast,
+ 1257
+ String[] children,
+ 1258
+ LinkedList<String> directoryNamesFollowed) {
+ 1259 8 processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
+ 1260 8 if (fast && couldHoldIncluded(name) && !contentsExcluded(name)) {
+ 1261 8 scandir(file, name, fast, children, directoryNamesFollowed);
+ 1262
+ }
+ 1263 8 }
+ 1264
+
+ 1265
+ private void accountForNotFollowedSymlink(String name, File file) {
+ 1266 0 accountForNotFollowedSymlink(new TokenizedPath(name), file);
+ 1267 0 }
+ 1268
+
+ 1269
+ private void accountForNotFollowedSymlink(TokenizedPath name, File file) {
+ 1270 0 if (!isExcluded(name)
+ 1271
+ && (isIncluded(name)
+ 1272
+ || (file.isDirectory() && couldHoldIncluded(name)
+ 1273
+ && !contentsExcluded(name)))) {
+ 1274 0 notFollowedSymlinks.add(file.getAbsolutePath());
+ 1275
+ }
+ 1276 0 }
+ 1277
+
+ 1278
+ private void processIncluded(TokenizedPath path,
+ 1279
+ File file, Vector<String> inc, Vector<String> exc,
+ 1280
+ Vector<String> des) {
+ 1281 19 String name = path.toString();
+ 1282 19 if (inc.contains(name) || exc.contains(name) || des.contains(name)) {
+ 1283 0 return ;
+ 1284
+ }
+ 1285
+
+ 1286 19 boolean included = false ;
+ 1287 19 if (isExcluded(path)) {
+ 1288 0 exc.add(name);
+ 1289 19 } else if (isSelected(name, file)) {
+ 1290 19 included = true ;
+ 1291 19 inc.add(name);
+ 1292
+ } else {
+ 1293 0 des.add(name);
+ 1294
+ }
+ 1295 19 everythingIncluded &= included;
+ 1296 19 }
+ 1297
+
+ 1298
+
+ 1299
+
+ 1300
+
+ 1301
+
+ 1302
+
+ 1303
+
+ 1304
+
+ 1305
+ protected boolean isIncluded(String name) {
+ 1306 0 return isIncluded(new TokenizedPath(name));
+ 1307
+ }
+ 1308
+
+ 1309
+
+ 1310
+
+ 1311
+
+ 1312
+
+ 1313
+
+ 1314
+
+ 1315
+
+ 1316
+ private boolean isIncluded(TokenizedPath path) {
+ 1317 20 ensureNonPatternSetsReady();
+ 1318
+
+ 1319 20 if (isCaseSensitive()
+ 1320
+ ? includeNonPatterns.containsKey(path.toString())
+ 1321
+ : includeNonPatterns.containsKey(path.toString().toUpperCase())) {
+ 1322 0 return true ;
+ 1323
+ }
+ 1324 21 for (int i = 0; i < includePatterns.length; i++) {
+ 1325 20 if (includePatterns[i].matchPath(path, isCaseSensitive())) {
+ 1326 19 return true ;
+ 1327
+ }
+ 1328
+ }
+ 1329 1 return false ;
+ 1330
+ }
+ 1331
+
+ 1332
+
+ 1333
+
+ 1334
+
+ 1335
+
+ 1336
+
+ 1337
+
+ 1338
+
+ 1339
+ protected boolean couldHoldIncluded(String name) {
+ 1340 0 return couldHoldIncluded(new TokenizedPath(name));
+ 1341
+ }
+ 1342
+
+ 1343
+
+ 1344
+
+ 1345
+
+ 1346
+
+ 1347
+
+ 1348
+
+ 1349
+
+ 1350
+ private boolean couldHoldIncluded(TokenizedPath tokenizedName) {
+ 1351 9 for (int i = 0; i < includePatterns.length; i++) {
+ 1352 9 if (couldHoldIncluded(tokenizedName, includePatterns[i])) {
+ 1353 9 return true ;
+ 1354
+ }
+ 1355
+ }
+ 1356 0 for (Iterator<TokenizedPath> iter = includeNonPatterns.values().iterator();
+ 1357 0 iter.hasNext();) {
+ 1358 0 if (couldHoldIncluded(tokenizedName,
+ 1359
+ iter.next().toPattern())) {
+ 1360 0 return true ;
+ 1361
+ }
+ 1362
+ }
+ 1363 0 return false ;
+ 1364
+ }
+ 1365
+
+ 1366
+
+ 1367
+
+ 1368
+
+ 1369
+
+ 1370
+
+ 1371
+
+ 1372
+
+ 1373
+ private boolean couldHoldIncluded(TokenizedPath tokenizedName,
+ 1374
+ TokenizedPattern tokenizedInclude) {
+ 1375 9 return tokenizedInclude.matchStartOf(tokenizedName, isCaseSensitive())
+ 1376
+ && isMorePowerfulThanExcludes(tokenizedName.toString())
+ 1377
+ && isDeeper(tokenizedInclude, tokenizedName);
+ 1378
+ }
+ 1379
+
+ 1380
+
+ 1381
+
+ 1382
+
+ 1383
+
+ 1384
+
+ 1385
+
+ 1386
+
+ 1387
+
+ 1388
+ private boolean isDeeper(TokenizedPattern pattern, TokenizedPath name) {
+ 1389 9 return pattern.containsPattern(SelectorUtils.DEEP_TREE_MATCH)
+ 1390
+ || pattern.depth() > name.depth();
+ 1391
+ }
+ 1392
+
+ 1393
+
+ 1394
+
+ 1395
+
+ 1396
+
+ 1397
+
+ 1398
+
+ 1399
+
+ 1400
+
+ 1401
+
+ 1402
+
+ 1403
+
+ 1404
+
+ 1405
+ private boolean isMorePowerfulThanExcludes(String name) {
+ 1406 9 final String soughtexclude
+ 1407
+ = name + File.separatorChar + SelectorUtils.DEEP_TREE_MATCH;
+ 1408 9 for (int counter = 0; counter < excludePatterns.length; counter++) {
+ 1409 0 if (excludePatterns[counter].toString().equals(soughtexclude)) {
+ 1410 0 return false ;
+ 1411
+ }
+ 1412
+ }
+ 1413 9 return true ;
+ 1414
+ }
+ 1415
+
+ 1416
+
+ 1417
+
+ 1418
+
+ 1419
+
+ 1420
+
+ 1421
+
+ 1422
+ boolean contentsExcluded(TokenizedPath path) {
+ 1423 9 for (int i = 0; i < excludePatterns.length; i++) {
+ 1424 0 if (excludePatterns[i].endsWith(SelectorUtils.DEEP_TREE_MATCH)
+ 1425
+ && excludePatterns[i].withoutLastToken()
+ 1426
+ .matchPath(path, isCaseSensitive())) {
+ 1427 0 return true ;
+ 1428
+ }
+ 1429
+ }
+ 1430 9 return false ;
+ 1431
+ }
+ 1432
+
+ 1433
+
+ 1434
+
+ 1435
+
+ 1436
+
+ 1437
+
+ 1438
+
+ 1439
+
+ 1440
+ protected boolean isExcluded(String name) {
+ 1441 0 return isExcluded(new TokenizedPath(name));
+ 1442
+ }
+ 1443
+
+ 1444
+
+ 1445
+
+ 1446
+
+ 1447
+
+ 1448
+
+ 1449
+
+ 1450
+
+ 1451
+ private boolean isExcluded(TokenizedPath name) {
+ 1452 19 ensureNonPatternSetsReady();
+ 1453
+
+ 1454 19 if (isCaseSensitive()
+ 1455
+ ? excludeNonPatterns.containsKey(name.toString())
+ 1456
+ : excludeNonPatterns.containsKey(name.toString().toUpperCase())) {
+ 1457 0 return true ;
+ 1458
+ }
+ 1459 19 for (int i = 0; i < excludePatterns.length; i++) {
+ 1460 0 if (excludePatterns[i].matchPath(name, isCaseSensitive())) {
+ 1461 0 return true ;
+ 1462
+ }
+ 1463
+ }
+ 1464 19 return false ;
+ 1465
+ }
+ 1466
+
+ 1467
+
+ 1468
+
+ 1469
+
+ 1470
+
+ 1471
+
+ 1472
+
+ 1473
+
+ 1474
+
+ 1475
+ protected boolean isSelected(String name, File file) {
+ 1476 19 if (selectors != null ) {
+ 1477 0 for (int i = 0; i < selectors.length; i++) {
+ 1478 0 if (!selectors[i].isSelected(basedir, name, file)) {
+ 1479 0 return false ;
+ 1480
+ }
+ 1481
+ }
+ 1482
+ }
+ 1483 19 return true ;
+ 1484
+ }
+ 1485
+
+ 1486
+
+ 1487
+
+ 1488
+
+ 1489
+
+ 1490
+
+ 1491
+
+ 1492
+
+ 1493
+ public String[] getIncludedFiles() {
+ 1494
+ String[] files;
+ 1495 1 synchronized (this ) {
+ 1496 1 if (filesIncluded == null ) {
+ 1497 0 throw new IllegalStateException("Must call scan() first" );
+ 1498
+ }
+ 1499 1 files = new String[filesIncluded.size()];
+ 1500 1 filesIncluded.copyInto(files);
+ 1501 1 }
+ 1502 1 Arrays.sort(files);
+ 1503 1 return files;
+ 1504
+ }
+ 1505
+
+ 1506
+
+ 1507
+
+ 1508
+
+ 1509
+
+ 1510
+
+ 1511
+
+ 1512
+ public synchronized int getIncludedFilesCount() {
+ 1513 0 if (filesIncluded == null ) {
+ 1514 0 throw new IllegalStateException("Must call scan() first" );
+ 1515
+ }
+ 1516 0 return filesIncluded.size();
+ 1517
+ }
+ 1518
+
+ 1519
+
+ 1520
+
+ 1521
+
+ 1522
+
+ 1523
+
+ 1524
+
+ 1525
+
+ 1526
+
+ 1527
+ public synchronized String[] getNotIncludedFiles() {
+ 1528 0 slowScan();
+ 1529 0 String[] files = new String[filesNotIncluded.size()];
+ 1530 0 filesNotIncluded.copyInto(files);
+ 1531 0 return files;
+ 1532
+ }
+ 1533
+
+ 1534
+
+ 1535
+
+ 1536
+
+ 1537
+
+ 1538
+
+ 1539
+
+ 1540
+
+ 1541
+
+ 1542
+
+ 1543
+
+ 1544
+ public synchronized String[] getExcludedFiles() {
+ 1545 0 slowScan();
+ 1546 0 String[] files = new String[filesExcluded.size()];
+ 1547 0 filesExcluded.copyInto(files);
+ 1548 0 return files;
+ 1549
+ }
+ 1550
+
+ 1551
+
+ 1552
+
+ 1553
+
+ 1554
+
+ 1555
+
+ 1556
+
+ 1557
+
+ 1558
+
+ 1559
+
+ 1560
+
+ 1561
+
+ 1562
+
+ 1563
+ public synchronized String[] getDeselectedFiles() {
+ 1564 0 slowScan();
+ 1565 0 String[] files = new String[filesDeselected.size()];
+ 1566 0 filesDeselected.copyInto(files);
+ 1567 0 return files;
+ 1568
+ }
+ 1569
+
+ 1570
+
+ 1571
+
+ 1572
+
+ 1573
+
+ 1574
+
+ 1575
+
+ 1576
+
+ 1577
+ public String[] getIncludedDirectories() {
+ 1578
+ String[] directories;
+ 1579 0 synchronized (this ) {
+ 1580 0 if (dirsIncluded == null ) {
+ 1581 0 throw new IllegalStateException("Must call scan() first" );
+ 1582
+ }
+ 1583 0 directories = new String[dirsIncluded.size()];
+ 1584 0 dirsIncluded.copyInto(directories);
+ 1585 0 }
+ 1586 0 Arrays.sort(directories);
+ 1587 0 return directories;
+ 1588
+ }
+ 1589
+
+ 1590
+
+ 1591
+
+ 1592
+
+ 1593
+
+ 1594
+
+ 1595
+
+ 1596
+ public synchronized int getIncludedDirsCount() {
+ 1597 0 if (dirsIncluded == null ) {
+ 1598 0 throw new IllegalStateException("Must call scan() first" );
+ 1599
+ }
+ 1600 0 return dirsIncluded.size();
+ 1601
+ }
+ 1602
+
+ 1603
+
+ 1604
+
+ 1605
+
+ 1606
+
+ 1607
+
+ 1608
+
+ 1609
+
+ 1610
+
+ 1611
+ public synchronized String[] getNotIncludedDirectories() {
+ 1612 0 slowScan();
+ 1613 0 String[] directories = new String[dirsNotIncluded.size()];
+ 1614 0 dirsNotIncluded.copyInto(directories);
+ 1615 0 return directories;
+ 1616
+ }
+ 1617
+
+ 1618
+
+ 1619
+
+ 1620
+
+ 1621
+
+ 1622
+
+ 1623
+
+ 1624
+
+ 1625
+
+ 1626
+
+ 1627
+
+ 1628
+ public synchronized String[] getExcludedDirectories() {
+ 1629 0 slowScan();
+ 1630 0 String[] directories = new String[dirsExcluded.size()];
+ 1631 0 dirsExcluded.copyInto(directories);
+ 1632 0 return directories;
+ 1633
+ }
+ 1634
+
+ 1635
+
+ 1636
+
+ 1637
+
+ 1638
+
+ 1639
+
+ 1640
+
+ 1641
+
+ 1642
+
+ 1643
+
+ 1644
+
+ 1645
+
+ 1646
+
+ 1647
+ public synchronized String[] getDeselectedDirectories() {
+ 1648 0 slowScan();
+ 1649 0 String[] directories = new String[dirsDeselected.size()];
+ 1650 0 dirsDeselected.copyInto(directories);
+ 1651 0 return directories;
+ 1652
+ }
+ 1653
+
+ 1654
+
+ 1655
+
+ 1656
+
+ 1657
+
+ 1658
+
+ 1659
+
+ 1660
+
+ 1661
+
+ 1662
+ public synchronized String[] getNotFollowedSymlinks() {
+ 1663
+ String[] links;
+ 1664 0 synchronized (this ) {
+ 1665 0 links = (String[]) notFollowedSymlinks
+ 1666
+ .toArray(new String[notFollowedSymlinks.size()]);
+ 1667 0 }
+ 1668 0 Arrays.sort(links);
+ 1669 0 return links;
+ 1670
+ }
+ 1671
+
+ 1672
+
+ 1673
+
+ 1674
+
+ 1675
+ public synchronized void addDefaultExcludes() {
+ 1676 0 int excludesLength = excludes == null ? 0 : excludes.length;
+ 1677
+ String[] newExcludes;
+ 1678 0 String[] defaultExcludesTemp = getDefaultExcludes();
+ 1679 0 newExcludes = new String[excludesLength + defaultExcludesTemp.length];
+ 1680 0 if (excludesLength > 0) {
+ 1681 0 System.arraycopy(excludes, 0, newExcludes, 0, excludesLength);
+ 1682
+ }
+ 1683 0 for (int i = 0; i < defaultExcludesTemp.length; i++) {
+ 1684 0 newExcludes[i + excludesLength]
+ 1685
+ = defaultExcludesTemp[i].replace('/' , File.separatorChar)
+ 1686
+ .replace('\\' , File.separatorChar);
+ 1687
+ }
+ 1688 0 excludes = newExcludes;
+ 1689 0 }
+ 1690
+
+ 1691
+
+ 1692
+
+ 1693
+
+ 1694
+
+ 1695
+
+ 1696
+
+ 1697
+
+ 1698
+
+ 1699
+ public synchronized Resource getResource(String name) {
+ 1700 0 return new FileResource(basedir, name);
+ 1701
+ }
+ 1702
+
+ 1703
+
+ 1704
+
+ 1705
+
+ 1706
+
+ 1707
+
+ 1708
+
+ 1709
+
+ 1710
+
+ 1711
+ private boolean hasBeenScanned(String vpath) {
+ 1712 9 return !scannedDirs.add(vpath);
+ 1713
+ }
+ 1714
+
+ 1715
+
+ 1716
+
+ 1717
+
+ 1718
+
+ 1719
+
+ 1720
+ Set<String> getScannedDirs() {
+ 1721
+ return scannedDirs;
+ 1722
+ }
+ 1723
+
+ 1724
+
+ 1725
+
+ 1726
+
+ 1727
+
+ 1728
+
+ 1729
+ private synchronized void clearCaches() {
+ 1730 1 includeNonPatterns.clear();
+ 1731 1 excludeNonPatterns.clear();
+ 1732 1 includePatterns = null ;
+ 1733 1 excludePatterns = null ;
+ 1734 1 areNonPatternSetsReady = false ;
+ 1735 1 }
+ 1736
+
+ 1737
+
+ 1738
+
+ 1739
+
+ 1740
+
+ 1741
+
+ 1742
+ synchronized void ensureNonPatternSetsReady() {
+ 1743 40 if (!areNonPatternSetsReady) {
+ 1744 1 includePatterns = fillNonPatternSet(includeNonPatterns, includes);
+ 1745 1 excludePatterns = fillNonPatternSet(excludeNonPatterns, excludes);
+ 1746 1 areNonPatternSetsReady = true ;
+ 1747
+ }
+ 1748 40 }
+ 1749
+
+ 1750
+
+ 1751
+
+ 1752
+
+ 1753
+
+ 1754
+
+ 1755
+
+ 1756
+
+ 1757
+ private TokenizedPattern[] fillNonPatternSet(Map<String, TokenizedPath> map, String[] patterns) {
+ 1758 2 ArrayList<TokenizedPattern> al = new ArrayList<TokenizedPattern>(patterns.length);
+ 1759 3 for (int i = 0; i < patterns.length; i++) {
+ 1760 1 if (!SelectorUtils.hasWildcards(patterns[i])) {
+ 1761 0 String s = isCaseSensitive()
+ 1762
+ ? patterns[i] : patterns[i].toUpperCase();
+ 1763 0 map.put(s, new TokenizedPath(s));
+ 1764 0 } else {
+ 1765 1 al.add(new TokenizedPattern(patterns[i]));
+ 1766
+ }
+ 1767
+ }
+ 1768 2 return (TokenizedPattern[]) al.toArray(new TokenizedPattern[al.size()]);
+ 1769
+ }
+ 1770
+
+ 1771
+
+ 1772
+
+ 1773
+
+ 1774
+
+ 1775
+
+ 1776
+
+ 1777
+
+ 1778
+
+ 1779
+
+ 1780
+
+ 1781
+ private boolean causesIllegalSymlinkLoop(String dirName, File parent,
+ 1782
+ LinkedList<String> directoryNamesFollowed) {
+ 1783
+ try {
+ 1784 8 if (directoryNamesFollowed.size() >= maxLevelsOfSymlinks
+ 1785
+ && CollectionUtils.frequency(directoryNamesFollowed, dirName)
+ 1786
+ >= maxLevelsOfSymlinks
+ 1787
+ && SYMLINK_UTILS.isSymbolicLink(parent, dirName)) {
+ 1788
+
+ 1789 0 ArrayList<String> files = new ArrayList<String>();
+ 1790 0 File f = FILE_UTILS.resolveFile(parent, dirName);
+ 1791 0 String target = f.getCanonicalPath();
+ 1792 0 files.add(target);
+ 1793
+
+ 1794 0 String relPath = "" ;
+ 1795 0 for (String dir : directoryNamesFollowed) {
+ 1796 0 relPath += "../" ;
+ 1797 0 if (dirName.equals(dir)) {
+ 1798 0 f = FILE_UTILS.resolveFile(parent, relPath + dir);
+ 1799 0 files.add(f.getCanonicalPath());
+ 1800 0 if (files.size() > maxLevelsOfSymlinks
+ 1801
+ && CollectionUtils.frequency(files, target)
+ 1802
+ > maxLevelsOfSymlinks) {
+ 1803 0 return true ;
+ 1804
+ }
+ 1805
+ }
+ 1806 0 }
+ 1807
+
+ 1808
+ }
+ 1809 8 return false ;
+ 1810 0 } catch (IOException ex) {
+ 1811 0 throw new BuildException("Caught error while checking for"
+ 1812
+ + " symbolic links" , ex);
+ 1813
+ }
+ 1814
+ }
+ 1815
+
+ 1816
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.FileScanner.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.FileScanner.html
new file mode 100644
index 000000000..459eb7a5b
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.FileScanner.html
@@ -0,0 +1,340 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.FileScanner
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+ public interface FileScanner {
+ 28
+
+ 29
+
+ 30
+
+ 31
+ void addDefaultExcludes();
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+ File getBasedir();
+ 40
+
+ 41
+
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+ String[] getExcludedDirectories();
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+ String[] getExcludedFiles();
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+ String[] getIncludedDirectories();
+ 71
+
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+ String[] getIncludedFiles();
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+ String[] getNotIncludedDirectories();
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+ String[] getNotIncludedFiles();
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+ void scan() throws IllegalStateException;
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+ void setBasedir(String basedir);
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+ void setBasedir(File basedir);
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+ void setExcludes(String[] excludes);
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148
+
+ 149
+ void setIncludes(String[] includes);
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+ void setCaseSensitive(boolean isCaseSensitive);
+ 158
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.Location.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.Location.html
new file mode 100644
index 000000000..e8c88c764
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.Location.html
@@ -0,0 +1,349 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.Location
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant;
+ 20
+
+ 21
+ import java.io.Serializable;
+ 22
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+ 23
+ import org.xml.sax.Locator;
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+ public class Location implements Serializable {
+ 32
+ private static final long serialVersionUID = 1L;
+ 33
+
+ 34
+
+ 35
+ private final String fileName;
+ 36
+
+ 37
+ private final int lineNumber;
+ 38
+
+ 39
+ private final int columnNumber;
+ 40
+
+ 41
+
+ 42 0 public static final Location UNKNOWN_LOCATION = new Location();
+ 43
+
+ 44 0 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+ private Location() {
+ 50 0 this (null , 0, 0);
+ 51 0 }
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+ public Location(String fileName) {
+ 62 0 this (fileName, 0, 0);
+ 63 0 }
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+ public Location(Locator loc) {
+ 74 0 this (loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber());
+ 75 0 }
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89 0 public Location(String fileName, int lineNumber, int columnNumber) {
+ 90 0 if (fileName != null && fileName.startsWith("file:" )) {
+ 91 0 this .fileName = FILE_UTILS.fromURI(fileName);
+ 92
+ } else {
+ 93 0 this .fileName = fileName;
+ 94
+ }
+ 95 0 this .lineNumber = lineNumber;
+ 96 0 this .columnNumber = columnNumber;
+ 97 0 }
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+ public String getFileName() {
+ 104
+ return fileName;
+ 105
+ }
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+ public int getLineNumber() {
+ 112
+ return lineNumber;
+ 113
+ }
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+ public int getColumnNumber() {
+ 120
+ return columnNumber;
+ 121
+ }
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+ public String toString() {
+ 134 0 StringBuffer buf = new StringBuffer();
+ 135
+
+ 136 0 if (fileName != null ) {
+ 137 0 buf.append(fileName);
+ 138
+
+ 139 0 if (lineNumber != 0) {
+ 140 0 buf.append(":" );
+ 141 0 buf.append(lineNumber);
+ 142
+ }
+ 143
+
+ 144 0 buf.append(": " );
+ 145
+ }
+ 146
+
+ 147 0 return buf.toString();
+ 148
+ }
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+ public boolean equals(Object other) {
+ 158 0 if (this == other) {
+ 159 0 return true ;
+ 160
+ }
+ 161 0 if (other == null ) {
+ 162 0 return false ;
+ 163
+ }
+ 164 0 if (!(other.getClass() == getClass())) {
+ 165 0 return false ;
+ 166
+ }
+ 167 0 return toString().equals(other.toString());
+ 168
+ }
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+ public int hashCode() {
+ 176 0 return toString().hashCode();
+ 177
+ }
+ 178
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer.html
new file mode 100644
index 000000000..090ad47b9
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer.html
@@ -0,0 +1,316 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+ import java.util.NoSuchElementException;
+ 22
+ import java.util.StringTokenizer;
+ 23
+ import org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os;
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+ public class PathTokenizer {
+ 34
+
+ 35
+
+ 36
+
+ 37
+ private StringTokenizer tokenizer;
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43 0 private String lookahead = null ;
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50 0 private boolean onNetWare = Os.isFamily("netware" );
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+ private boolean dosStyleFilesystem;
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63 0 public PathTokenizer(String path) {
+ 64 0 if (onNetWare) {
+ 65
+
+ 66
+
+ 67 0 tokenizer = new StringTokenizer(path, ":;" , true );
+ 68
+ } else {
+ 69
+
+ 70
+
+ 71 0 tokenizer = new StringTokenizer(path, ":;" , false );
+ 72
+ }
+ 73 0 dosStyleFilesystem = File.pathSeparatorChar == ';' ;
+ 74 0 }
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+ public boolean hasMoreTokens() {
+ 85 0 if (lookahead != null ) {
+ 86 0 return true ;
+ 87
+ }
+ 88
+
+ 89 0 return tokenizer.hasMoreTokens();
+ 90
+ }
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+ public String nextToken() throws NoSuchElementException {
+ 101 0 String token = null ;
+ 102 0 if (lookahead != null ) {
+ 103 0 token = lookahead;
+ 104 0 lookahead = null ;
+ 105
+ } else {
+ 106 0 token = tokenizer.nextToken().trim();
+ 107
+ }
+ 108
+
+ 109 0 if (!onNetWare) {
+ 110 0 if (token.length() == 1 && Character.isLetter(token.charAt(0))
+ 111
+ && dosStyleFilesystem
+ 112
+ && tokenizer.hasMoreTokens()) {
+ 113
+
+ 114
+
+ 115 0 String nextToken = tokenizer.nextToken().trim();
+ 116 0 if (nextToken.startsWith("\\" ) || nextToken.startsWith("/" )) {
+ 117
+
+ 118
+
+ 119
+
+ 120 0 token += ":" + nextToken;
+ 121
+ } else {
+ 122
+
+ 123 0 lookahead = nextToken;
+ 124
+ }
+ 125 0 }
+ 126
+ } else {
+ 127
+
+ 128
+
+ 129 0 if (token.equals(File.pathSeparator) || token.equals(":" )) {
+ 130
+
+ 131 0 token = tokenizer.nextToken().trim();
+ 132
+ }
+ 133
+
+ 134 0 if (tokenizer.hasMoreTokens()) {
+ 135
+
+ 136 0 String nextToken = tokenizer.nextToken().trim();
+ 137
+
+ 138
+
+ 139 0 if (!nextToken.equals(File.pathSeparator)) {
+ 140 0 if (nextToken.equals(":" )) {
+ 141 0 if (!token.startsWith("/" ) && !token.startsWith("\\" )
+ 142
+ && !token.startsWith("." )
+ 143
+ && !token.startsWith(".." )) {
+ 144
+
+ 145 0 String oneMore = tokenizer.nextToken().trim();
+ 146 0 if (!oneMore.equals(File.pathSeparator)) {
+ 147 0 token += ":" + oneMore;
+ 148
+ } else {
+ 149 0 token += ":" ;
+ 150 0 lookahead = oneMore;
+ 151
+ }
+ 152 0 }
+ 153
+
+ 154
+
+ 155
+ } else {
+ 156
+
+ 157 0 lookahead = nextToken;
+ 158
+ }
+ 159
+ }
+ 160
+ }
+ 161
+ }
+ 162 0 return token;
+ 163
+ }
+ 164
+ }
+ 165
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent.html
new file mode 100644
index 000000000..6c6556283
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent.html
@@ -0,0 +1,338 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant;
+ 19
+
+ 20
+
+ 21
+
+ 22
+
+ 23
+
+ 24
+ public abstract class ProjectComponent implements Cloneable {
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41 0 protected Location location = Location.UNKNOWN_LOCATION;
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+ protected String description;
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54 0 public ProjectComponent() {
+ 55 0 }
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+ public Location getLocation() {
+ 87
+ return location;
+ 88
+ }
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+ public void setLocation(Location location) {
+ 99
+ this .location = location;
+ 100
+ }
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+ public void setDescription(String desc) {
+ 110
+ description = desc;
+ 111
+ }
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+ public String getDescription() {
+ 119
+ return description;
+ 120
+ }
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+ public void log(String msg) {
+ 128
+
+ 129 0 }
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+ public void log(String msg, int msgLevel) {
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148 0 }
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+ public Object clone() throws CloneNotSupportedException {
+ 156 0 ProjectComponent pc = (ProjectComponent) super .clone();
+ 157 0 pc.setLocation(getLocation());
+ 158
+
+ 159 0 return pc;
+ 160
+ }
+ 161
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator.html
new file mode 100644
index 000000000..e3bd1ed2a
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator.html
@@ -0,0 +1,914 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.launch;
+ 19
+
+ 20
+ import java.net.MalformedURLException;
+ 21
+ import java.net.URL;
+ 22
+ import java.io.File;
+ 23
+ import java.io.FilenameFilter;
+ 24
+ import java.io.ByteArrayOutputStream;
+ 25
+ import java.io.UnsupportedEncodingException;
+ 26
+ import java.text.CharacterIterator;
+ 27
+ import java.text.StringCharacterIterator;
+ 28
+ import java.util.Locale;
+ 29
+
+ 30
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+ public final class Locator {
+ 51
+
+ 52
+ private static final int NIBBLE = 4;
+ 53
+ private static final int NIBBLE_MASK = 0xF;
+ 54
+
+ 55
+ private static final int ASCII_SIZE = 128;
+ 56
+
+ 57
+ private static final int BYTE_SIZE = 256;
+ 58
+
+ 59
+ private static final int WORD = 16;
+ 60
+
+ 61
+ private static final int SPACE = 0x20;
+ 62
+ private static final int DEL = 0x7F;
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+ public static final String URI_ENCODING = "UTF-8" ;
+ 68
+
+ 69
+
+ 70
+
+ 71 0 private static boolean [] gNeedEscaping = new boolean [ASCII_SIZE];
+ 72
+
+ 73 0 private static char [] gAfterEscaping1 = new char [ASCII_SIZE];
+ 74
+
+ 75 0 private static char [] gAfterEscaping2 = new char [ASCII_SIZE];
+ 76 0 private static char [] gHexChs = {'0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' ,
+ 77
+ '8' , '9' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' };
+ 78
+
+ 79
+ public static final String ERROR_NOT_FILE_URI
+ 80
+ = "Can only handle valid file: URIs, not " ;
+ 81
+
+ 82
+
+ 83
+ static {
+ 84 0 for (int i = 0; i < SPACE; i++) {
+ 85 0 gNeedEscaping[i] = true ;
+ 86 0 gAfterEscaping1[i] = gHexChs[i >> NIBBLE];
+ 87 0 gAfterEscaping2[i] = gHexChs[i & NIBBLE_MASK];
+ 88
+ }
+ 89 0 gNeedEscaping[DEL] = true ;
+ 90 0 gAfterEscaping1[DEL] = '7' ;
+ 91 0 gAfterEscaping2[DEL] = 'F' ;
+ 92 0 char [] escChs = {' ' , '<' , '>' , '#' , '%' , '"' , '{' , '}' ,
+ 93
+ '|' , '\\' , '^' , '~' , '[' , ']' , '`' };
+ 94 0 int len = escChs.length;
+ 95
+ char ch;
+ 96 0 for (int i = 0; i < len; i++) {
+ 97 0 ch = escChs[i];
+ 98 0 gNeedEscaping[ch] = true ;
+ 99 0 gAfterEscaping1[ch] = gHexChs[ch >> NIBBLE];
+ 100 0 gAfterEscaping2[ch] = gHexChs[ch & NIBBLE_MASK];
+ 101
+ }
+ 102 0 }
+ 103
+
+ 104
+
+ 105
+
+ 106
+ private Locator() {
+ 107
+ }
+ 108
+
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+ public static File getClassSource(Class<?> c) {
+ 119 0 String classResource = c.getName().replace('.' , '/' ) + ".class" ;
+ 120 0 return getResourceSource(c.getClassLoader(), classResource);
+ 121
+ }
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+ public static File getResourceSource(ClassLoader c, String resource) {
+ 135 0 if (c == null ) {
+ 136 0 c = Locator.class .getClassLoader();
+ 137
+ }
+ 138 0 URL url = null ;
+ 139 0 if (c == null ) {
+ 140 0 url = ClassLoader.getSystemResource(resource);
+ 141
+ } else {
+ 142 0 url = c.getResource(resource);
+ 143
+ }
+ 144 0 if (url != null ) {
+ 145 0 String u = url.toString();
+ 146
+ try {
+ 147 0 if (u.startsWith("jar:file:" )) {
+ 148 0 return new File(fromJarURI(u));
+ 149 0 } else if (u.startsWith("file:" )) {
+ 150 0 int tail = u.indexOf(resource);
+ 151 0 String dirName = u.substring(0, tail);
+ 152 0 return new File(fromURI(dirName));
+ 153
+ }
+ 154 0 } catch (IllegalArgumentException e) {
+ 155
+
+ 156 0 return null ;
+ 157 0 }
+ 158
+ }
+ 159 0 return null ;
+ 160
+ }
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+ public static String fromURI(String uri) {
+ 182 0 return fromURIJava13(uri);
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+ }
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229
+
+ 230
+ private static String fromURIJava13(String uri) {
+ 231
+
+ 232
+
+ 233 0 URL url = null ;
+ 234
+ try {
+ 235 0 url = new URL(uri);
+ 236 0 } catch (MalformedURLException emYouEarlEx) {
+ 237
+
+ 238 0 }
+ 239 0 if (url == null || !("file" .equals(url.getProtocol()))) {
+ 240 0 throw new IllegalArgumentException(ERROR_NOT_FILE_URI + uri);
+ 241
+ }
+ 242 0 StringBuffer buf = new StringBuffer(url.getHost());
+ 243 0 if (buf.length() > 0) {
+ 244 0 buf.insert(0, File.separatorChar).insert(0, File.separatorChar);
+ 245
+ }
+ 246 0 String file = url.getFile();
+ 247 0 int queryPos = file.indexOf('?' );
+ 248 0 buf.append((queryPos < 0) ? file : file.substring(0, queryPos));
+ 249
+
+ 250 0 uri = buf.toString().replace('/' , File.separatorChar);
+ 251
+
+ 252 0 if (File.pathSeparatorChar == ';' && uri.startsWith("\\" ) && uri.length() > 2
+ 253
+ && Character.isLetter(uri.charAt(1)) && uri.lastIndexOf(':' ) > -1) {
+ 254 0 uri = uri.substring(1);
+ 255
+ }
+ 256 0 String path = null ;
+ 257
+ try {
+ 258 0 path = decodeUri(uri);
+ 259
+
+ 260
+
+ 261 0 String cwd = System.getProperty("user.dir" );
+ 262 0 int posi = cwd.indexOf(':' );
+ 263 0 boolean pathStartsWithFileSeparator = path.startsWith(File.separator);
+ 264 0 boolean pathStartsWithUNC = path.startsWith("" + File.separator + File.separator);
+ 265 0 if ((posi > 0) && pathStartsWithFileSeparator && !pathStartsWithUNC) {
+ 266 0 path = cwd.substring(0, posi + 1) + path;
+ 267
+ }
+ 268 0 } catch (UnsupportedEncodingException exc) {
+ 269
+
+ 270
+
+ 271 0 throw new IllegalStateException(
+ 272
+ "Could not convert URI " + uri + " to path: "
+ 273
+ + exc.getMessage());
+ 274 0 }
+ 275 0 return path;
+ 276
+ }
+ 277
+
+ 278
+
+ 279
+
+ 280
+
+ 281
+
+ 282
+
+ 283
+
+ 284
+
+ 285
+ public static String fromJarURI(String uri) {
+ 286 0 int pling = uri.indexOf("!/" );
+ 287 0 String jarName = uri.substring("jar:" .length(), pling);
+ 288 0 return fromURI(jarName);
+ 289
+ }
+ 290
+
+ 291
+
+ 292
+
+ 293
+
+ 294
+
+ 295
+
+ 296
+
+ 297
+
+ 298
+
+ 299
+ public static String decodeUri(String uri) throws UnsupportedEncodingException {
+ 300 0 if (uri.indexOf('%' ) == -1) {
+ 301 0 return uri;
+ 302
+ }
+ 303 0 ByteArrayOutputStream sb = new ByteArrayOutputStream(uri.length());
+ 304 0 CharacterIterator iter = new StringCharacterIterator(uri);
+ 305 0 for (char c = iter.first(); c != CharacterIterator.DONE;
+ 306 0 c = iter.next()) {
+ 307 0 if (c == '%' ) {
+ 308 0 char c1 = iter.next();
+ 309 0 if (c1 != CharacterIterator.DONE) {
+ 310 0 int i1 = Character.digit(c1, WORD);
+ 311 0 char c2 = iter.next();
+ 312 0 if (c2 != CharacterIterator.DONE) {
+ 313 0 int i2 = Character.digit(c2, WORD);
+ 314 0 sb.write((char ) ((i1 << NIBBLE) + i2));
+ 315
+ }
+ 316
+ }
+ 317 0 } else if (c >= 0x0000 && c < 0x0080) {
+ 318 0 sb.write(c);
+ 319
+ } else {
+ 320 0 byte [] bytes = String.valueOf(c).getBytes(URI_ENCODING);
+ 321 0 sb.write(bytes, 0, bytes.length);
+ 322
+ }
+ 323
+ }
+ 324 0 return sb.toString(URI_ENCODING);
+ 325
+ }
+ 326
+
+ 327
+
+ 328
+
+ 329
+
+ 330
+
+ 331
+
+ 332
+
+ 333
+
+ 334
+
+ 335
+ public static String encodeURI(String path) throws UnsupportedEncodingException {
+ 336 0 int i = 0;
+ 337 0 int len = path.length();
+ 338 0 int ch = 0;
+ 339 0 StringBuffer sb = null ;
+ 340 0 for (; i < len; i++) {
+ 341 0 ch = path.charAt(i);
+ 342
+
+ 343 0 if (ch >= ASCII_SIZE) {
+ 344 0 break ;
+ 345
+ }
+ 346 0 if (gNeedEscaping[ch]) {
+ 347 0 if (sb == null ) {
+ 348 0 sb = new StringBuffer(path.substring(0, i));
+ 349
+ }
+ 350 0 sb.append('%' );
+ 351 0 sb.append(gAfterEscaping1[ch]);
+ 352 0 sb.append(gAfterEscaping2[ch]);
+ 353
+
+ 354 0 } else if (sb != null ) {
+ 355 0 sb.append((char ) ch);
+ 356
+ }
+ 357
+ }
+ 358
+
+ 359
+
+ 360 0 if (i < len) {
+ 361 0 if (sb == null ) {
+ 362 0 sb = new StringBuffer(path.substring(0, i));
+ 363
+ }
+ 364
+
+ 365 0 byte [] bytes = null ;
+ 366
+ byte b;
+ 367 0 bytes = path.substring(i).getBytes(URI_ENCODING);
+ 368 0 len = bytes.length;
+ 369
+
+ 370
+
+ 371 0 for (i = 0; i < len; i++) {
+ 372 0 b = bytes[i];
+ 373
+
+ 374 0 if (b < 0) {
+ 375 0 ch = b + BYTE_SIZE;
+ 376 0 sb.append('%' );
+ 377 0 sb.append(gHexChs[ch >> NIBBLE]);
+ 378 0 sb.append(gHexChs[ch & NIBBLE_MASK]);
+ 379 0 } else if (gNeedEscaping[b]) {
+ 380 0 sb.append('%' );
+ 381 0 sb.append(gAfterEscaping1[b]);
+ 382 0 sb.append(gAfterEscaping2[b]);
+ 383
+ } else {
+ 384 0 sb.append((char ) b);
+ 385
+ }
+ 386
+ }
+ 387
+ }
+ 388 0 return sb == null ? path : sb.toString();
+ 389
+ }
+ 390
+
+ 391
+
+ 392
+
+ 393
+
+ 394
+
+ 395
+
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400
+
+ 401
+
+ 402
+
+ 403
+
+ 404
+
+ 405
+ @Deprecated
+ 406
+ public static URL fileToURL(File file)
+ 407
+ throws MalformedURLException {
+ 408 0 return new URL(file.toURI().toASCIIString());
+ 409
+ }
+ 410
+
+ 411
+
+ 412
+
+ 413
+
+ 414
+
+ 415
+
+ 416
+
+ 417
+
+ 418
+
+ 419
+ public static File getToolsJar() {
+ 420
+
+ 421 0 boolean toolsJarAvailable = false ;
+ 422
+ try {
+ 423
+
+ 424 0 Class.forName("com.sun.tools.javac.Main" );
+ 425 0 toolsJarAvailable = true ;
+ 426 0 } catch (Exception e) {
+ 427
+ try {
+ 428 0 Class.forName("sun.tools.javac.Main" );
+ 429 0 toolsJarAvailable = true ;
+ 430 0 } catch (Exception e2) {
+ 431
+
+ 432 0 }
+ 433 0 }
+ 434 0 if (toolsJarAvailable) {
+ 435 0 return null ;
+ 436
+ }
+ 437
+
+ 438
+
+ 439 0 String libToolsJar
+ 440
+ = File.separator + "lib" + File.separator + "tools.jar" ;
+ 441 0 String javaHome = System.getProperty("java.home" );
+ 442 0 File toolsJar = new File(javaHome + libToolsJar);
+ 443 0 if (toolsJar.exists()) {
+ 444
+
+ 445 0 return toolsJar;
+ 446
+ }
+ 447 0 if (javaHome.toLowerCase(Locale.ENGLISH).endsWith(File.separator + "jre" )) {
+ 448 0 javaHome = javaHome.substring(
+ 449
+ 0, javaHome.length() - "/jre" .length());
+ 450 0 toolsJar = new File(javaHome + libToolsJar);
+ 451
+ }
+ 452 0 if (!toolsJar.exists()) {
+ 453 0 System.out.println("Unable to locate tools.jar. "
+ 454
+ + "Expected to find it in " + toolsJar.getPath());
+ 455 0 return null ;
+ 456
+ }
+ 457 0 return toolsJar;
+ 458
+ }
+ 459
+
+ 460
+
+ 461
+
+ 462
+
+ 463
+
+ 464
+
+ 465
+
+ 466
+
+ 467
+
+ 468
+
+ 469
+
+ 470
+
+ 471
+
+ 472
+
+ 473
+ public static URL[] getLocationURLs(File location)
+ 474
+ throws MalformedURLException {
+ 475 0 return getLocationURLs(location, new String[]{".jar" });
+ 476
+ }
+ 477
+
+ 478
+
+ 479
+
+ 480
+
+ 481
+
+ 482
+
+ 483
+
+ 484
+
+ 485
+
+ 486
+
+ 487
+
+ 488
+
+ 489
+
+ 490
+
+ 491
+
+ 492
+ public static URL[] getLocationURLs(File location,
+ 493
+ final String[] extensions)
+ 494
+ throws MalformedURLException {
+ 495 0 URL[] urls = new URL[0];
+ 496
+
+ 497 0 if (!location.exists()) {
+ 498 0 return urls;
+ 499
+ }
+ 500 0 if (!location.isDirectory()) {
+ 501 0 urls = new URL[1];
+ 502 0 String path = location.getPath();
+ 503 0 String littlePath = path.toLowerCase(Locale.ENGLISH);
+ 504 0 for (int i = 0; i < extensions.length; ++i) {
+ 505 0 if (littlePath.endsWith(extensions[i])) {
+ 506 0 urls[0] = fileToURL(location);
+ 507 0 break ;
+ 508
+ }
+ 509
+ }
+ 510 0 return urls;
+ 511
+ }
+ 512 0 File[] matches = location.listFiles(
+ 513
+ new FilenameFilter() {
+ 514
+ public boolean accept(File dir, String name) {
+ 515 0 String littleName = name.toLowerCase(Locale.ENGLISH);
+ 516 0 for (int i = 0; i < extensions.length; ++i) {
+ 517 0 if (littleName.endsWith(extensions[i])) {
+ 518 0 return true ;
+ 519
+ }
+ 520
+ }
+ 521 0 return false ;
+ 522
+ }
+ 523
+ });
+ 524 0 urls = new URL[matches.length];
+ 525 0 for (int i = 0; i < matches.length; ++i) {
+ 526 0 urls[i] = fileToURL(matches[i]);
+ 527
+ }
+ 528 0 return urls;
+ 529
+ }
+ 530
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition.html
new file mode 100644
index 000000000..6fe363ffd
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition.html
@@ -0,0 +1,94 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Condition
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition;
+ 20
+
+ 21
+ import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+ public interface Condition {
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+ boolean eval() throws BuildException;
+ 34
+ }
+ 35
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os.html
new file mode 100644
index 000000000..a7fc96d4c
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os.html
@@ -0,0 +1,600 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition;
+ 20
+
+ 21
+ import java.util.Locale;
+ 22
+
+ 23
+ import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+ public class Os implements Condition {
+ 31 1 private static final String OS_NAME =
+ 32
+ System.getProperty("os.name" ).toLowerCase(Locale.ENGLISH);
+ 33 1 private static final String OS_ARCH =
+ 34
+ System.getProperty("os.arch" ).toLowerCase(Locale.ENGLISH);
+ 35 1 private static final String OS_VERSION =
+ 36
+ System.getProperty("os.version" ).toLowerCase(Locale.ENGLISH);
+ 37 1 private static final String PATH_SEP =
+ 38
+ System.getProperty("path.separator" );
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43
+ private String family;
+ 44
+
+ 45
+
+ 46
+
+ 47
+ private String name;
+ 48
+
+ 49
+
+ 50
+
+ 51
+ private String version;
+ 52
+
+ 53
+
+ 54
+
+ 55
+ private String arch;
+ 56
+
+ 57
+
+ 58
+
+ 59
+ public static final String FAMILY_WINDOWS = "windows" ;
+ 60
+
+ 61
+
+ 62
+
+ 63
+ public static final String FAMILY_9X = "win9x" ;
+ 64
+
+ 65
+
+ 66
+
+ 67
+ public static final String FAMILY_NT = "winnt" ;
+ 68
+
+ 69
+
+ 70
+
+ 71
+ public static final String FAMILY_OS2 = "os/2" ;
+ 72
+
+ 73
+
+ 74
+
+ 75
+ public static final String FAMILY_NETWARE = "netware" ;
+ 76
+
+ 77
+
+ 78
+
+ 79
+ public static final String FAMILY_DOS = "dos" ;
+ 80
+
+ 81
+
+ 82
+
+ 83
+ public static final String FAMILY_MAC = "mac" ;
+ 84
+
+ 85
+
+ 86
+
+ 87
+ public static final String FAMILY_TANDEM = "tandem" ;
+ 88
+
+ 89
+
+ 90
+
+ 91
+ public static final String FAMILY_UNIX = "unix" ;
+ 92
+
+ 93
+
+ 94
+
+ 95
+ public static final String FAMILY_VMS = "openvms" ;
+ 96
+
+ 97
+
+ 98
+
+ 99
+ public static final String FAMILY_ZOS = "z/os" ;
+ 100
+
+ 101
+ public static final String FAMILY_OS400 = "os/400" ;
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+ private static final String DARWIN = "darwin" ;
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+ public Os() {
+ 115
+
+ 116
+ }
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122 0 public Os(String family) {
+ 123 0 setFamily(family);
+ 124 0 }
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+ public void setFamily(String f) {
+ 145 0 family = f.toLowerCase(Locale.ENGLISH);
+ 146 0 }
+ 147
+
+ 148
+
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+ public void setName(String name) {
+ 154 0 this .name = name.toLowerCase(Locale.ENGLISH);
+ 155 0 }
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162
+ public void setArch(String arch) {
+ 163 0 this .arch = arch.toLowerCase(Locale.ENGLISH);
+ 164 0 }
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+
+ 170
+
+ 171
+ public void setVersion(String version) {
+ 172 0 this .version = version.toLowerCase(Locale.ENGLISH);
+ 173 0 }
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+
+ 182
+ public boolean eval() throws BuildException {
+ 183 0 return isOs(family, name, arch, version);
+ 184
+ }
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+ public static boolean isFamily(String family) {
+ 194 6 return isOs(family, null , null , null );
+ 195
+ }
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+ public static boolean isName(String name) {
+ 206 0 return isOs(null , name, null , null );
+ 207
+ }
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+ public static boolean isArch(String arch) {
+ 218 0 return isOs(null , null , arch, null );
+ 219
+ }
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229
+ public static boolean isVersion(String version) {
+ 230 0 return isOs(null , null , null , version);
+ 231
+ }
+ 232
+
+ 233
+
+ 234
+
+ 235
+
+ 236
+
+ 237
+
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+ public static boolean isOs(String family, String name, String arch,
+ 245
+ String version) {
+ 246 6 boolean retValue = false ;
+ 247
+
+ 248 6 if (family != null || name != null || arch != null
+ 249
+ || version != null ) {
+ 250
+
+ 251 6 boolean isFamily = true ;
+ 252 6 boolean isName = true ;
+ 253 6 boolean isArch = true ;
+ 254 6 boolean isVersion = true ;
+ 255
+
+ 256 6 if (family != null ) {
+ 257
+
+ 258
+
+ 259
+
+ 260 6 boolean isWindows = OS_NAME.indexOf(FAMILY_WINDOWS) > -1;
+ 261 6 boolean is9x = false ;
+ 262 6 boolean isNT = false ;
+ 263 6 if (isWindows) {
+ 264
+
+ 265 6 is9x = (OS_NAME.indexOf("95" ) >= 0
+ 266
+ || OS_NAME.indexOf("98" ) >= 0
+ 267
+ || OS_NAME.indexOf("me" ) >= 0
+ 268
+
+ 269
+
+ 270
+ || OS_NAME.indexOf("ce" ) >= 0);
+ 271 6 isNT = !is9x;
+ 272
+ }
+ 273 6 if (family.equals(FAMILY_WINDOWS)) {
+ 274 1 isFamily = isWindows;
+ 275 5 } else if (family.equals(FAMILY_9X)) {
+ 276 1 isFamily = isWindows && is9x;
+ 277 4 } else if (family.equals(FAMILY_NT)) {
+ 278 0 isFamily = isWindows && isNT;
+ 279 4 } else if (family.equals(FAMILY_OS2)) {
+ 280 0 isFamily = OS_NAME.indexOf(FAMILY_OS2) > -1;
+ 281 4 } else if (family.equals(FAMILY_NETWARE)) {
+ 282 2 isFamily = OS_NAME.indexOf(FAMILY_NETWARE) > -1;
+ 283 2 } else if (family.equals(FAMILY_DOS)) {
+ 284 1 isFamily = PATH_SEP.equals(";" ) && !isFamily(FAMILY_NETWARE);
+ 285 1 } else if (family.equals(FAMILY_MAC)) {
+ 286 0 isFamily = OS_NAME.indexOf(FAMILY_MAC) > -1
+ 287
+ || OS_NAME.indexOf(DARWIN) > -1;
+ 288 1 } else if (family.equals(FAMILY_TANDEM)) {
+ 289 0 isFamily = OS_NAME.indexOf("nonstop_kernel" ) > -1;
+ 290 1 } else if (family.equals(FAMILY_UNIX)) {
+ 291 0 isFamily = PATH_SEP.equals(":" )
+ 292
+ && !isFamily(FAMILY_VMS)
+ 293
+ && (!isFamily(FAMILY_MAC) || OS_NAME.endsWith("x" )
+ 294
+ || OS_NAME.indexOf(DARWIN) > -1);
+ 295 1 } else if (family.equals(FAMILY_ZOS)) {
+ 296 0 isFamily = OS_NAME.indexOf(FAMILY_ZOS) > -1
+ 297
+ || OS_NAME.indexOf("os/390" ) > -1;
+ 298 1 } else if (family.equals(FAMILY_OS400)) {
+ 299 0 isFamily = OS_NAME.indexOf(FAMILY_OS400) > -1;
+ 300 1 } else if (family.equals(FAMILY_VMS)) {
+ 301 1 isFamily = OS_NAME.indexOf(FAMILY_VMS) > -1;
+ 302
+ } else {
+ 303 0 throw new BuildException(
+ 304
+ "Don\'t know how to detect os family \""
+ 305
+ + family + "\"" );
+ 306
+ }
+ 307
+ }
+ 308 6 if (name != null ) {
+ 309 0 isName = name.equals(OS_NAME);
+ 310
+ }
+ 311 6 if (arch != null ) {
+ 312 0 isArch = arch.equals(OS_ARCH);
+ 313
+ }
+ 314 6 if (version != null ) {
+ 315 0 isVersion = version.equals(OS_VERSION);
+ 316
+ }
+ 317 6 retValue = isFamily && isName && isArch && isVersion;
+ 318
+ }
+ 319 6 return retValue;
+ 320
+ }
+ 321
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.DataType.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.DataType.html
new file mode 100644
index 000000000..6537a3380
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.DataType.html
@@ -0,0 +1,712 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.DataType
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types;
+ 19
+
+ 20
+ import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+ 21
+ import org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+ public abstract class DataType extends ProjectComponent implements Cloneable {
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+ protected Reference ref;
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+ protected boolean checked = true ;
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+ public boolean isReference() {
+ 62 0 return ref != null ;
+ 63
+ }
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+
+ 74
+ public void setRefid(final Reference ref) {
+ 75
+ this .ref = ref;
+ 76
+ checked = false ;
+ 77
+ }
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148
+
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229
+
+ 230
+
+ 231
+
+ 232
+
+ 233
+
+ 234
+
+ 235
+
+ 236
+
+ 237
+
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+
+ 251
+ protected BuildException tooManyAttributes() {
+ 252 0 return new BuildException("You must not specify more than one "
+ 253
+ + "attribute when using refid" );
+ 254
+ }
+ 255
+
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+ protected BuildException noChildrenAllowed() {
+ 263 0 return new BuildException("You must not specify nested elements "
+ 264
+ + "when using refid" );
+ 265
+ }
+ 266
+
+ 267
+
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272
+ protected BuildException circularReference() {
+ 273 0 return new BuildException("This data type contains a circular "
+ 274
+ + "reference." );
+ 275
+ }
+ 276
+
+ 277
+
+ 278
+
+ 279
+
+ 280
+
+ 281
+
+ 282
+ protected boolean isChecked() {
+ 283
+ return checked;
+ 284
+ }
+ 285
+
+ 286
+
+ 287
+
+ 288
+
+ 289
+
+ 290
+
+ 291
+ protected void setChecked(final boolean checked) {
+ 292
+ this .checked = checked;
+ 293
+ }
+ 294
+
+ 295
+
+ 296
+
+ 297
+
+ 298
+
+ 299
+
+ 300
+ public Reference getRefid() {
+ 301
+ return ref;
+ 302
+ }
+ 303
+
+ 304
+
+ 305
+
+ 306
+
+ 307
+
+ 308
+
+ 309
+
+ 310
+ protected void checkAttributesAllowed() {
+ 311 0 if (isReference()) {
+ 312 0 throw tooManyAttributes();
+ 313
+ }
+ 314 0 }
+ 315
+
+ 316
+
+ 317
+
+ 318
+
+ 319
+
+ 320
+
+ 321
+
+ 322
+ protected void checkChildrenAllowed() {
+ 323 0 if (isReference()) {
+ 324 0 throw noChildrenAllowed();
+ 325
+ }
+ 326 0 }
+ 327
+
+ 328
+
+ 329
+
+ 330
+
+ 331
+
+ 332
+
+ 333
+ public String toString() {
+ 334 0 String d = getDescription();
+ 335
+
+ 336 0 return d == null ? "DataType" : d;
+ 337
+ }
+ 338
+
+ 339
+
+ 340
+
+ 341
+
+ 342
+
+ 343
+
+ 344
+ public Object clone() throws CloneNotSupportedException {
+ 345 0 DataType dt = (DataType) super .clone();
+ 346 0 dt.setDescription(getDescription());
+ 347 0 if (getRefid() != null ) {
+ 348 0 dt.setRefid(getRefid());
+ 349
+ }
+ 350 0 dt.setChecked(isChecked());
+ 351 0 return dt;
+ 352
+ }
+ 353
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.Reference.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.Reference.html
new file mode 100644
index 000000000..69345bce2
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.Reference.html
@@ -0,0 +1,273 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.Reference
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types;
+ 19
+
+ 20
+
+ 21
+
+ 22
+
+ 23
+
+ 24
+ public class Reference {
+ 25
+
+ 26
+ private String refid;
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+ public Reference() {
+ 35
+ }
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43 0 public Reference(String id) {
+ 44 0 setRefId(id);
+ 45 0 }
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+ public void setRefId(String id) {
+ 64
+ refid = id;
+ 65
+ }
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+ public String getRefId() {
+ 73
+ return refid;
+ 74
+ }
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.Resource.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.Resource.html
new file mode 100644
index 000000000..b742af7ba
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.Resource.html
@@ -0,0 +1,878 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.Resource
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types;
+ 19
+
+ 20
+ import java.io.IOException;
+ 21
+ import java.io.InputStream;
+ 22
+ import java.io.OutputStream;
+ 23
+ import java.math.BigInteger;
+ 24
+ import java.util.Iterator;
+ 25
+ import java.util.NoSuchElementException;
+ 26
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider;
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37 0 public class Resource extends DataType implements Comparable<Resource>, ResourceCollection {
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+ public static final long UNKNOWN_SIZE = -1;
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+ public static final long UNKNOWN_DATETIME = 0L;
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52 0 protected static final int MAGIC = getMagicNumber("Resource" .getBytes());
+ 53
+
+ 54 0 private static final int NULL_NAME = getMagicNumber("null name" .getBytes());
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+ protected static int getMagicNumber(byte [] seed) {
+ 63 0 return new BigInteger(seed).intValue();
+ 64
+ }
+ 65
+
+ 66 0 private String name = null ;
+ 67 0 private Boolean exists = null ;
+ 68 0 private Long lastmodified = null ;
+ 69 0 private Boolean directory = null ;
+ 70 0 private Long size = null ;
+ 71
+
+ 72
+
+ 73
+
+ 74
+
+ 75
+ public Resource() {
+ 76
+ }
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+ public Resource(String name) {
+ 87 0 this (name, false , 0, false );
+ 88 0 }
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+ public Resource(String name, boolean exists, long lastmodified) {
+ 98 0 this (name, exists, lastmodified, false );
+ 99 0 }
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+ public Resource(String name, boolean exists, long lastmodified, boolean directory) {
+ 110 0 this (name, exists, lastmodified, directory, UNKNOWN_SIZE);
+ 111 0 }
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122 0 public Resource(String name, boolean exists, long lastmodified, boolean directory, long size) {
+ 123 0 this .name = name;
+ 124 0 setName(name);
+ 125 0 setExists(exists);
+ 126 0 setLastModified(lastmodified);
+ 127 0 setDirectory(directory);
+ 128 0 setSize(size);
+ 129 0 }
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+ public String getName() {
+ 145
+
+ 146
+ return name;
+ 147
+ }
+ 148
+
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+ public void setName(String name) {
+ 155 0 checkAttributesAllowed();
+ 156 0 this .name = name;
+ 157 0 }
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+
+ 164
+ public boolean isExists() {
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169 0 return exists == null || exists.booleanValue();
+ 170
+ }
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+ public void setExists(boolean exists) {
+ 178 0 checkAttributesAllowed();
+ 179 0 this .exists = exists ? Boolean.TRUE : Boolean.FALSE;
+ 180 0 }
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+ public long getLastModified() {
+ 190
+
+ 191
+
+ 192
+
+ 193 0 if (!isExists() || lastmodified == null ) {
+ 194 0 return UNKNOWN_DATETIME;
+ 195
+ }
+ 196 0 long result = lastmodified.longValue();
+ 197 0 return result < UNKNOWN_DATETIME ? UNKNOWN_DATETIME : result;
+ 198
+ }
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+ public void setLastModified(long lastmodified) {
+ 206 0 checkAttributesAllowed();
+ 207 0 this .lastmodified = new Long(lastmodified);
+ 208 0 }
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+ public boolean isDirectory() {
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220 0 return directory != null && directory.booleanValue();
+ 221
+ }
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+ public void setDirectory(boolean directory) {
+ 229 0 checkAttributesAllowed();
+ 230 0 this .directory = directory ? Boolean.TRUE : Boolean.FALSE;
+ 231 0 }
+ 232
+
+ 233
+
+ 234
+
+ 235
+
+ 236
+
+ 237
+
+ 238
+
+ 239
+ public void setSize(long size) {
+ 240 0 checkAttributesAllowed();
+ 241 0 this .size = new Long(size > UNKNOWN_SIZE ? size : UNKNOWN_SIZE);
+ 242 0 }
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+
+ 251
+ public long getSize() {
+ 252
+
+ 253
+
+ 254
+
+ 255 0 return isExists()
+ 256
+ ? (size != null ? size.longValue() : UNKNOWN_SIZE)
+ 257
+ : 0L;
+ 258
+ }
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+ public Object clone() {
+ 266
+ try {
+ 267 0 return super .clone();
+ 268 0 } catch (CloneNotSupportedException e) {
+ 269 0 throw new UnsupportedOperationException(
+ 270
+ "CloneNotSupportedException for a Resource caught. "
+ 271
+ + "Derived classes must support cloning." );
+ 272
+ }
+ 273
+ }
+ 274
+
+ 275
+
+ 276
+
+ 277
+
+ 278
+
+ 279
+
+ 280
+
+ 281
+
+ 282
+
+ 283
+ public int compareTo(Resource other) {
+ 284
+
+ 285
+
+ 286
+
+ 287 0 return toString().compareTo(other.toString());
+ 288
+ }
+ 289
+
+ 290
+
+ 291
+
+ 292
+
+ 293
+
+ 294
+
+ 295
+
+ 296
+
+ 297
+ public boolean equals(Object other) {
+ 298
+
+ 299
+
+ 300
+
+ 301 0 return other != null && other.getClass().equals(getClass())
+ 302
+ && compareTo((Resource) other) == 0;
+ 303
+ }
+ 304
+
+ 305
+
+ 306
+
+ 307
+
+ 308
+
+ 309
+
+ 310
+
+ 311
+ public int hashCode() {
+ 312
+
+ 313
+
+ 314
+
+ 315 0 String name = getName();
+ 316 0 return MAGIC * (name == null ? NULL_NAME : name.hashCode());
+ 317
+ }
+ 318
+
+ 319
+
+ 320
+
+ 321
+
+ 322
+
+ 323
+
+ 324
+
+ 325
+
+ 326
+
+ 327
+ public InputStream getInputStream() throws IOException {
+ 328
+
+ 329
+
+ 330
+
+ 331 0 throw new UnsupportedOperationException();
+ 332
+ }
+ 333
+
+ 334
+
+ 335
+
+ 336
+
+ 337
+
+ 338
+
+ 339
+
+ 340
+
+ 341
+
+ 342
+ public OutputStream getOutputStream() throws IOException {
+ 343
+
+ 344
+
+ 345
+
+ 346 0 throw new UnsupportedOperationException();
+ 347
+ }
+ 348
+
+ 349
+
+ 350
+
+ 351
+
+ 352
+
+ 353
+
+ 354
+
+ 355
+ public Iterator<Resource> iterator() {
+ 356
+
+ 357
+
+ 358 0 return new Iterator<Resource>() {
+ 359
+ private boolean done = false ;
+ 360
+
+ 361
+ public boolean hasNext() {
+ 362 0 return !done;
+ 363
+ }
+ 364
+
+ 365
+ public Resource next() {
+ 366 0 if (done) {
+ 367 0 throw new NoSuchElementException();
+ 368
+ }
+ 369 0 done = true ;
+ 370 0 return Resource.this ;
+ 371
+ }
+ 372
+
+ 373
+ public void remove() {
+ 374 0 throw new UnsupportedOperationException();
+ 375
+ }
+ 376
+ };
+ 377
+ }
+ 378
+
+ 379
+
+ 380
+
+ 381
+
+ 382
+
+ 383
+
+ 384
+
+ 385
+ public int size() {
+ 386
+
+ 387 0 return 1;
+ 388
+ }
+ 389
+
+ 390
+
+ 391
+
+ 392
+
+ 393
+
+ 394
+
+ 395
+
+ 396
+ public boolean isFilesystemOnly() {
+ 397
+
+ 398
+
+ 399 0 return this .as(FileProvider.class ) != null ;
+ 400
+ }
+ 401
+
+ 402
+
+ 403
+
+ 404
+
+ 405
+
+ 406
+
+ 407
+
+ 408
+ public String toString() {
+ 409
+
+ 410
+
+ 411
+
+ 412 0 String n = getName();
+ 413 0 return n == null ? "(anonymous)" : n;
+ 414
+ }
+ 415
+
+ 416
+
+ 417
+
+ 418
+
+ 419
+
+ 420
+
+ 421
+
+ 422
+
+ 423
+ public final String toLongString() {
+ 424
+
+ 425
+
+ 426 0 return toString();
+ 427
+ }
+ 428
+
+ 429
+
+ 430
+
+ 431
+
+ 432
+
+ 433
+
+ 434
+ public void setRefid(Reference r) {
+ 435 0 if (name != null
+ 436
+ || exists != null
+ 437
+ || lastmodified != null
+ 438
+ || directory != null
+ 439
+ || size != null ) {
+ 440 0 throw tooManyAttributes();
+ 441
+ }
+ 442 0 super .setRefid(r);
+ 443 0 }
+ 444
+
+ 445
+
+ 446
+
+ 447
+
+ 448
+
+ 449
+
+ 450
+
+ 451
+
+ 452
+
+ 453
+
+ 454
+
+ 455
+
+ 456
+
+ 457
+
+ 458
+
+ 459
+ public <T> T as(Class<T> clazz) {
+ 460 0 return clazz.isAssignableFrom(getClass()) ? clazz.cast(this ) : null ;
+ 461
+ }
+ 462
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection.html
new file mode 100644
index 000000000..fa54e2bc6
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection.html
@@ -0,0 +1,124 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceCollection
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types;
+ 19
+
+ 20
+ import java.util.Iterator;
+ 21
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+ public interface ResourceCollection extends Iterable<Resource> {
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+ Iterator<Resource> iterator();
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+ int size();
+ 40
+
+ 41
+
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+ boolean isFilesystemOnly();
+ 49
+
+ 50
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory.html
new file mode 100644
index 000000000..bd55a24dc
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory.html
@@ -0,0 +1,100 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types;
+ 19
+
+ 20
+
+ 21
+
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+ public interface ResourceFactory {
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+ Resource getResource(String name);
+ 38
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable.html
new file mode 100644
index 000000000..bcdf36a6a
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable.html
@@ -0,0 +1,94 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Appendable
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+ 19
+
+ 20
+ import java.io.IOException;
+ 21
+ import java.io.OutputStream;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+ public interface Appendable {
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+ OutputStream getAppendOutputStream() throws IOException;
+ 35
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider.html
new file mode 100644
index 000000000..3b3b63096
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider.html
@@ -0,0 +1,96 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+ 20
+
+ 21
+ import java.io.File;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+ public interface FileProvider {
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+ File getFile();
+ 36
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource.html
new file mode 100644
index 000000000..cf67f82c8
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource.html
@@ -0,0 +1,772 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+ import java.io.FileInputStream;
+ 22
+ import java.io.FileOutputStream;
+ 23
+ import java.io.IOException;
+ 24
+ import java.io.InputStream;
+ 25
+ import java.io.OutputStream;
+ 26
+ import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+ 27
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.Reference;
+ 28
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.Resource;
+ 29
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory;
+ 30
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37 0 public class FileResource extends Resource implements Touchable, FileProvider,
+ 38
+ ResourceFactory, Appendable {
+ 39
+
+ 40 0 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+ 41 0 private static final int NULL_FILE
+ 42
+ = Resource.getMagicNumber("null file" .getBytes());
+ 43
+
+ 44
+ private File file;
+ 45
+ private File baseDir;
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+ public FileResource() {
+ 51
+ }
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59 0 public FileResource(File b, String name) {
+ 60 0 this .baseDir = b;
+ 61 0 this .file = FILE_UTILS.resolveFile(b, name);
+ 62 0 }
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69 0 public FileResource(File f) {
+ 70 0 setFile(f);
+ 71 0 }
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+ public void setFile(File f) {
+ 99 0 checkAttributesAllowed();
+ 100 0 file = f;
+ 101 0 if (f != null && (getBaseDir() == null || !FILE_UTILS.isLeadingPath(getBaseDir(), f))) {
+ 102 0 setBaseDir(f.getParentFile());
+ 103
+ }
+ 104 0 }
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+ public File getFile() {
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116 0 synchronized (this ) {
+ 117 0 if (file == null ) {
+ 118
+
+ 119 0 File d = getBaseDir();
+ 120 0 String n = super .getName();
+ 121 0 if (n != null ) {
+ 122 0 setFile(FILE_UTILS.resolveFile(d, n));
+ 123
+ }
+ 124
+ }
+ 125 0 }
+ 126 0 return file;
+ 127
+ }
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+ public void setBaseDir(File b) {
+ 135 0 checkAttributesAllowed();
+ 136 0 baseDir = b;
+ 137 0 }
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+ public File getBaseDir() {
+ 145
+
+ 146
+
+ 147
+
+ 148
+
+ 149
+ return baseDir;
+ 150
+ }
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+ public void setRefid(Reference r) {
+ 158 0 if (file != null || baseDir != null ) {
+ 159 0 throw tooManyAttributes();
+ 160
+ }
+ 161 0 super .setRefid(r);
+ 162 0 }
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+
+ 170
+ public String getName() {
+ 171
+
+ 172
+
+ 173
+
+ 174 0 File b = getBaseDir();
+ 175 0 return b == null ? getNotNullFile().getName()
+ 176
+ : FILE_UTILS.removeLeadingPath(b, getNotNullFile());
+ 177
+ }
+ 178
+
+ 179
+
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184
+ public boolean isExists() {
+ 185
+
+ 186
+
+ 187 0 return getNotNullFile().exists();
+ 188
+ }
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+ public long getLastModified() {
+ 196
+
+ 197
+
+ 198
+
+ 199 0 return getNotNullFile().lastModified();
+ 200
+ }
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+ public boolean isDirectory() {
+ 208
+
+ 209
+
+ 210 0 return getNotNullFile().isDirectory();
+ 211
+ }
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+ public long getSize() {
+ 219
+
+ 220
+
+ 221 0 return getNotNullFile().length();
+ 222
+ }
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229
+
+ 230
+ public InputStream getInputStream() throws IOException {
+ 231
+
+ 232
+
+ 233
+
+ 234 0 return new FileInputStream(getNotNullFile());
+ 235
+ }
+ 236
+
+ 237
+
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+ public OutputStream getOutputStream() throws IOException {
+ 245
+
+ 246
+
+ 247
+
+ 248 0 return getOutputStream(false );
+ 249
+ }
+ 250
+
+ 251
+
+ 252
+
+ 253
+
+ 254
+ public OutputStream getAppendOutputStream() throws IOException {
+ 255
+
+ 256
+
+ 257
+
+ 258 0 return getOutputStream(true );
+ 259
+ }
+ 260
+
+ 261
+ private OutputStream getOutputStream(boolean append) throws IOException {
+ 262 0 File f = getNotNullFile();
+ 263 0 if (f.exists()) {
+ 264 0 if (f.isFile() && !append) {
+ 265 0 f.delete();
+ 266
+ }
+ 267
+ } else {
+ 268 0 File p = f.getParentFile();
+ 269 0 if (p != null && !(p.exists())) {
+ 270 0 p.mkdirs();
+ 271
+ }
+ 272
+ }
+ 273 0 return append ? new FileOutputStream(f.getAbsolutePath(), true ) : new FileOutputStream(f);
+ 274
+ }
+ 275
+
+ 276
+
+ 277
+
+ 278
+
+ 279
+
+ 280
+
+ 281
+
+ 282
+
+ 283
+ public int compareTo(Resource another) {
+ 284
+
+ 285
+
+ 286
+
+ 287 0 if (this .equals(another)) {
+ 288 0 return 0;
+ 289
+ }
+ 290 0 FileProvider otherFP = another.as(FileProvider.class );
+ 291 0 if (otherFP != null ) {
+ 292 0 File f = getFile();
+ 293 0 if (f == null ) {
+ 294 0 return -1;
+ 295
+ }
+ 296 0 File of = otherFP.getFile();
+ 297 0 if (of == null ) {
+ 298 0 return 1;
+ 299
+ }
+ 300 0 return f.compareTo(of);
+ 301
+ }
+ 302 0 return super .compareTo(another);
+ 303
+ }
+ 304
+
+ 305
+
+ 306
+
+ 307
+
+ 308
+
+ 309
+
+ 310
+
+ 311
+ public boolean equals(Object another) {
+ 312 0 if (this == another) {
+ 313 0 return true ;
+ 314
+ }
+ 315
+
+ 316
+
+ 317
+
+ 318 0 if (another == null || !(another.getClass().equals(getClass()))) {
+ 319 0 return false ;
+ 320
+ }
+ 321 0 FileResource otherfr = (FileResource) another;
+ 322 0 return getFile() == null
+ 323
+ ? otherfr.getFile() == null
+ 324
+ : getFile().equals(otherfr.getFile());
+ 325
+ }
+ 326
+
+ 327
+
+ 328
+
+ 329
+
+ 330
+
+ 331
+
+ 332
+ public int hashCode() {
+ 333
+
+ 334
+
+ 335
+
+ 336 0 return MAGIC * (getFile() == null ? NULL_FILE : getFile().hashCode());
+ 337
+ }
+ 338
+
+ 339
+
+ 340
+
+ 341
+
+ 342
+
+ 343
+
+ 344
+ public String toString() {
+ 345
+
+ 346
+
+ 347
+
+ 348 0 if (file == null ) {
+ 349 0 return "(unbound file resource)" ;
+ 350
+ }
+ 351 0 String absolutePath = file.getAbsolutePath();
+ 352 0 return FILE_UTILS.normalize(absolutePath).getAbsolutePath();
+ 353
+ }
+ 354
+
+ 355
+
+ 356
+
+ 357
+
+ 358
+
+ 359
+
+ 360
+ public boolean isFilesystemOnly() {
+ 361
+
+ 362
+
+ 363
+
+ 364
+
+ 365
+ return true ;
+ 366
+ }
+ 367
+
+ 368
+
+ 369
+
+ 370
+
+ 371
+
+ 372
+
+ 373
+ public void touch(long modTime) {
+ 374
+
+ 375
+
+ 376
+
+ 377
+
+ 378 0 if (!getNotNullFile().setLastModified(modTime)) {
+ 379
+
+ 380
+ }
+ 381 0 }
+ 382
+
+ 383
+
+ 384
+
+ 385
+
+ 386
+
+ 387
+
+ 388
+
+ 389
+ protected File getNotNullFile() {
+ 390 0 if (getFile() == null ) {
+ 391 0 throw new BuildException("file attribute is null!" );
+ 392
+ }
+ 393
+
+ 394 0 return getFile();
+ 395
+ }
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400
+
+ 401
+
+ 402
+
+ 403
+
+ 404
+
+ 405
+
+ 406
+ public Resource getResource(String path) {
+ 407 0 File newfile = FILE_UTILS.resolveFile(getFile(), path);
+ 408 0 FileResource fileResource = new FileResource(newfile);
+ 409 0 if (FILE_UTILS.isLeadingPath(getBaseDir(), newfile)) {
+ 410 0 fileResource.setBaseDir(getBaseDir());
+ 411
+ }
+ 412 0 return fileResource;
+ 413
+ }
+ 414
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable.html
new file mode 100644
index 000000000..08f0bb94a
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable.html
@@ -0,0 +1,88 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.resources.Touchable
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+ 19
+
+ 20
+
+ 21
+
+ 22
+
+ 23
+
+ 24
+
+ 25
+ public interface Touchable {
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+ void touch(long modTime);
+ 32
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector.html
new file mode 100644
index 000000000..be7f9b19d
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector.html
@@ -0,0 +1,120 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+ 20
+
+ 21
+ import java.io.File;
+ 22
+
+ 23
+ import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+ public interface FileSelector {
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43
+
+ 44
+ boolean isSelected(File basedir, String filename, File file)
+ 45
+ throws BuildException;
+ 46
+
+ 47
+ }
+ 48
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner.html
new file mode 100644
index 000000000..484f8ec54
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner.html
@@ -0,0 +1,122 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+ 19
+
+ 20
+
+ 21
+
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+ public interface SelectorScanner {
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+ void setSelectors(FileSelector[] selectors);
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+ String[] getDeselectedDirectories();
+ 40
+
+ 41
+
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+ String[] getDeselectedFiles();
+ 47
+
+ 48
+
+ 49
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils.html
new file mode 100644
index 000000000..52aae7b76
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils.html
@@ -0,0 +1,1185 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+ 20
+
+ 21
+ import java.io.File;
+ 22
+ import java.util.StringTokenizer;
+ 23
+ import java.util.Vector;
+ 24
+
+ 25
+ import org.owasp.dependencycheck.org.apache.tools.ant.types.Resource;
+ 26
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+ public final class SelectorUtils {
+ 39
+
+ 40
+
+ 41
+
+ 42
+
+ 43
+
+ 44
+ public static final String DEEP_TREE_MATCH = "**" ;
+ 45
+
+ 46 1 private static final SelectorUtils instance = new SelectorUtils();
+ 47 1 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+ private SelectorUtils() {
+ 53
+ }
+ 54
+
+ 55
+
+ 56
+
+ 57
+
+ 58
+
+ 59
+ public static SelectorUtils getInstance() {
+ 60 0 return instance;
+ 61
+ }
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+ public static boolean matchPatternStart(String pattern, String str) {
+ 80 1 return matchPatternStart(pattern, str, true );
+ 81
+ }
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+ public static boolean matchPatternStart(String pattern, String str,
+ 102
+ boolean isCaseSensitive) {
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107 3 if (str.startsWith(File.separator)
+ 108
+ != pattern.startsWith(File.separator)) {
+ 109 0 return false ;
+ 110
+ }
+ 111
+
+ 112 3 String[] patDirs = tokenizePathAsArray(pattern);
+ 113 3 String[] strDirs = tokenizePathAsArray(str);
+ 114 3 return matchPatternStart(patDirs, strDirs, isCaseSensitive);
+ 115
+ }
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+ static boolean matchPatternStart(String[] patDirs, String[] strDirs,
+ 137
+ boolean isCaseSensitive) {
+ 138 12 int patIdxStart = 0;
+ 139 12 int patIdxEnd = patDirs.length - 1;
+ 140 12 int strIdxStart = 0;
+ 141 12 int strIdxEnd = strDirs.length - 1;
+ 142
+
+ 143
+
+ 144 23 while (patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd) {
+ 145 20 String patDir = patDirs[patIdxStart];
+ 146 20 if (patDir.equals(DEEP_TREE_MATCH)) {
+ 147 8 break ;
+ 148
+ }
+ 149 12 if (!match(patDir, strDirs[strIdxStart], isCaseSensitive)) {
+ 150 1 return false ;
+ 151
+ }
+ 152 11 patIdxStart++;
+ 153 11 strIdxStart++;
+ 154 11 }
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159 11 if (strIdxStart > strIdxEnd) {
+ 160
+
+ 161 3 return true ;
+ 162 8 } else if (patIdxStart > patIdxEnd) {
+ 163
+
+ 164 0 return false ;
+ 165
+ } else {
+ 166
+
+ 167
+
+ 168 8 return true ;
+ 169
+ }
+ 170
+ }
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+ public static boolean matchPath(String pattern, String str) {
+ 189 1 String[] patDirs = tokenizePathAsArray(pattern);
+ 190 1 return matchPath(patDirs, tokenizePathAsArray(str), true );
+ 191
+ }
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+ public static boolean matchPath(String pattern, String str,
+ 212
+ boolean isCaseSensitive) {
+ 213 0 String[] patDirs = tokenizePathAsArray(pattern);
+ 214 0 return matchPath(patDirs, tokenizePathAsArray(str), isCaseSensitive);
+ 215
+ }
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+ static boolean matchPath(String[] tokenizedPattern, String[] strDirs,
+ 222
+ boolean isCaseSensitive) {
+ 223 21 int patIdxStart = 0;
+ 224 21 int patIdxEnd = tokenizedPattern.length - 1;
+ 225 21 int strIdxStart = 0;
+ 226 21 int strIdxEnd = strDirs.length - 1;
+ 227
+
+ 228
+
+ 229 41 while (patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd) {
+ 230 38 String patDir = tokenizedPattern[patIdxStart];
+ 231 38 if (patDir.equals(DEEP_TREE_MATCH)) {
+ 232 18 break ;
+ 233
+ }
+ 234 20 if (!match(patDir, strDirs[strIdxStart], isCaseSensitive)) {
+ 235 0 return false ;
+ 236
+ }
+ 237 20 patIdxStart++;
+ 238 20 strIdxStart++;
+ 239 20 }
+ 240 21 if (strIdxStart > strIdxEnd) {
+ 241
+
+ 242 4 for (int i = patIdxStart; i <= patIdxEnd; i++) {
+ 243 2 if (!tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+ 244 1 return false ;
+ 245
+ }
+ 246
+ }
+ 247 2 return true ;
+ 248
+ } else {
+ 249 18 if (patIdxStart > patIdxEnd) {
+ 250
+
+ 251 0 return false ;
+ 252
+ }
+ 253
+ }
+ 254
+
+ 255
+
+ 256 18 while (patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd) {
+ 257 18 String patDir = tokenizedPattern[patIdxEnd];
+ 258 18 if (patDir.equals(DEEP_TREE_MATCH)) {
+ 259 18 break ;
+ 260
+ }
+ 261 0 if (!match(patDir, strDirs[strIdxEnd], isCaseSensitive)) {
+ 262 0 return false ;
+ 263
+ }
+ 264 0 patIdxEnd--;
+ 265 0 strIdxEnd--;
+ 266 0 }
+ 267 18 if (strIdxStart > strIdxEnd) {
+ 268
+
+ 269 0 for (int i = patIdxStart; i <= patIdxEnd; i++) {
+ 270 0 if (!tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+ 271 0 return false ;
+ 272
+ }
+ 273
+ }
+ 274 0 return true ;
+ 275
+ }
+ 276
+
+ 277 18 while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {
+ 278 0 int patIdxTmp = -1;
+ 279 0 for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {
+ 280 0 if (tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+ 281 0 patIdxTmp = i;
+ 282 0 break ;
+ 283
+ }
+ 284
+ }
+ 285 0 if (patIdxTmp == patIdxStart + 1) {
+ 286
+
+ 287 0 patIdxStart++;
+ 288 0 continue ;
+ 289
+ }
+ 290
+
+ 291
+
+ 292 0 int patLength = (patIdxTmp - patIdxStart - 1);
+ 293 0 int strLength = (strIdxEnd - strIdxStart + 1);
+ 294 0 int foundIdx = -1;
+ 295
+ strLoop:
+ 296 0 for (int i = 0; i <= strLength - patLength; i++) {
+ 297 0 for (int j = 0; j < patLength; j++) {
+ 298 0 String subPat = tokenizedPattern[patIdxStart + j + 1];
+ 299 0 String subStr = strDirs[strIdxStart + i + j];
+ 300 0 if (!match(subPat, subStr, isCaseSensitive)) {
+ 301 0 continue strLoop;
+ 302
+ }
+ 303
+ }
+ 304
+
+ 305 0 foundIdx = strIdxStart + i;
+ 306 0 break ;
+ 307
+ }
+ 308
+
+ 309 0 if (foundIdx == -1) {
+ 310 0 return false ;
+ 311
+ }
+ 312
+
+ 313 0 patIdxStart = patIdxTmp;
+ 314 0 strIdxStart = foundIdx + patLength;
+ 315 0 }
+ 316
+
+ 317 36 for (int i = patIdxStart; i <= patIdxEnd; i++) {
+ 318 18 if (!tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+ 319 0 return false ;
+ 320
+ }
+ 321
+ }
+ 322
+
+ 323 18 return true ;
+ 324
+ }
+ 325
+
+ 326
+
+ 327
+
+ 328
+
+ 329
+
+ 330
+
+ 331
+
+ 332
+
+ 333
+
+ 334
+
+ 335
+
+ 336
+
+ 337
+
+ 338
+
+ 339
+
+ 340
+ public static boolean match(String pattern, String str) {
+ 341 0 return match(pattern, str, true );
+ 342
+ }
+ 343
+
+ 344
+
+ 345
+
+ 346
+
+ 347
+
+ 348
+
+ 349
+
+ 350
+
+ 351
+
+ 352
+
+ 353
+
+ 354
+
+ 355
+
+ 356
+
+ 357
+
+ 358
+
+ 359
+
+ 360
+
+ 361
+ public static boolean match(String pattern, String str,
+ 362
+ boolean caseSensitive) {
+ 363 32 char [] patArr = pattern.toCharArray();
+ 364 32 char [] strArr = str.toCharArray();
+ 365 32 int patIdxStart = 0;
+ 366 32 int patIdxEnd = patArr.length - 1;
+ 367 32 int strIdxStart = 0;
+ 368 32 int strIdxEnd = strArr.length - 1;
+ 369
+ char ch;
+ 370
+
+ 371 32 boolean containsStar = false ;
+ 372 412 for (int i = 0; i < patArr.length; i++) {
+ 373 384 if (patArr[i] == '*' ) {
+ 374 4 containsStar = true ;
+ 375 4 break ;
+ 376
+ }
+ 377
+ }
+ 378
+
+ 379 32 if (!containsStar) {
+ 380
+
+ 381 28 if (patIdxEnd != strIdxEnd) {
+ 382 0 return false ;
+ 383
+ }
+ 384 364 for (int i = 0; i <= patIdxEnd; i++) {
+ 385 336 ch = patArr[i];
+ 386 336 if (ch != '?' ) {
+ 387 336 if (different(caseSensitive, ch, strArr[i])) {
+ 388 0 return false ;
+ 389
+ }
+ 390
+ }
+ 391
+ }
+ 392 28 return true ;
+ 393
+ }
+ 394
+
+ 395 4 if (patIdxEnd == 0) {
+ 396 0 return true ;
+ 397
+ }
+ 398
+
+ 399
+
+ 400
+ while (true ) {
+ 401 37 ch = patArr[patIdxStart];
+ 402 37 if (ch == '*' || strIdxStart > strIdxEnd) {
+ 403 0 break ;
+ 404
+ }
+ 405 34 if (ch != '?' ) {
+ 406 31 if (different(caseSensitive, ch, strArr[strIdxStart])) {
+ 407 1 return false ;
+ 408
+ }
+ 409
+ }
+ 410 33 patIdxStart++;
+ 411 33 strIdxStart++;
+ 412
+ }
+ 413 3 if (strIdxStart > strIdxEnd) {
+ 414
+
+ 415
+
+ 416 0 return allStars(patArr, patIdxStart, patIdxEnd);
+ 417
+ }
+ 418
+
+ 419
+
+ 420
+ while (true ) {
+ 421 3 ch = patArr[patIdxEnd];
+ 422 3 if (ch == '*' || strIdxStart > strIdxEnd) {
+ 423 0 break ;
+ 424
+ }
+ 425 0 if (ch != '?' ) {
+ 426 0 if (different(caseSensitive, ch, strArr[strIdxEnd])) {
+ 427 0 return false ;
+ 428
+ }
+ 429
+ }
+ 430 0 patIdxEnd--;
+ 431 0 strIdxEnd--;
+ 432
+ }
+ 433 3 if (strIdxStart > strIdxEnd) {
+ 434
+
+ 435
+
+ 436 0 return allStars(patArr, patIdxStart, patIdxEnd);
+ 437
+ }
+ 438
+
+ 439
+
+ 440
+
+ 441 6 while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {
+ 442 3 int patIdxTmp = -1;
+ 443 3 for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {
+ 444 3 if (patArr[i] == '*' ) {
+ 445 3 patIdxTmp = i;
+ 446 3 break ;
+ 447
+ }
+ 448
+ }
+ 449 3 if (patIdxTmp == patIdxStart + 1) {
+ 450
+
+ 451 3 patIdxStart++;
+ 452 3 continue ;
+ 453
+ }
+ 454
+
+ 455
+
+ 456 0 int patLength = (patIdxTmp - patIdxStart - 1);
+ 457 0 int strLength = (strIdxEnd - strIdxStart + 1);
+ 458 0 int foundIdx = -1;
+ 459
+ strLoop:
+ 460 0 for (int i = 0; i <= strLength - patLength; i++) {
+ 461 0 for (int j = 0; j < patLength; j++) {
+ 462 0 ch = patArr[patIdxStart + j + 1];
+ 463 0 if (ch != '?' ) {
+ 464 0 if (different(caseSensitive, ch,
+ 465
+ strArr[strIdxStart + i + j])) {
+ 466 0 continue strLoop;
+ 467
+ }
+ 468
+ }
+ 469
+ }
+ 470
+
+ 471 0 foundIdx = strIdxStart + i;
+ 472 0 break ;
+ 473
+ }
+ 474
+
+ 475 0 if (foundIdx == -1) {
+ 476 0 return false ;
+ 477
+ }
+ 478
+
+ 479 0 patIdxStart = patIdxTmp;
+ 480 0 strIdxStart = foundIdx + patLength;
+ 481 0 }
+ 482
+
+ 483
+
+ 484
+
+ 485 3 return allStars(patArr, patIdxStart, patIdxEnd);
+ 486
+ }
+ 487
+
+ 488
+ private static boolean allStars(char [] chars, int start, int end) {
+ 489 6 for (int i = start; i <= end; ++i) {
+ 490 3 if (chars[i] != '*' ) {
+ 491 0 return false ;
+ 492
+ }
+ 493
+ }
+ 494 3 return true ;
+ 495
+ }
+ 496
+
+ 497
+ private static boolean different(
+ 498
+ boolean caseSensitive, char ch, char other) {
+ 499 367 return caseSensitive
+ 500
+ ? ch != other
+ 501
+ : Character.toUpperCase(ch) != Character.toUpperCase(other);
+ 502
+ }
+ 503
+
+ 504
+
+ 505
+
+ 506
+
+ 507
+
+ 508
+
+ 509
+
+ 510
+
+ 511
+
+ 512
+ public static Vector<String> tokenizePath(String path) {
+ 513 0 return tokenizePath(path, File.separator);
+ 514
+ }
+ 515
+
+ 516
+
+ 517
+
+ 518
+
+ 519
+
+ 520
+
+ 521
+
+ 522
+
+ 523
+
+ 524
+
+ 525
+ public static Vector<String> tokenizePath(String path, String separator) {
+ 526 0 Vector<String> ret = new Vector<String>();
+ 527 0 if (FileUtils.isAbsolutePath(path)) {
+ 528 0 String[] s = FILE_UTILS.dissect(path);
+ 529 0 ret.add(s[0]);
+ 530 0 path = s[1];
+ 531
+ }
+ 532 0 StringTokenizer st = new StringTokenizer(path, separator);
+ 533 0 while (st.hasMoreTokens()) {
+ 534 0 ret.addElement(st.nextToken());
+ 535
+ }
+ 536 0 return ret;
+ 537
+ }
+ 538
+
+ 539
+
+ 540
+
+ 541
+
+ 542
+ static String[] tokenizePathAsArray(String path) {
+ 543 9 String root = null ;
+ 544 9 if (FileUtils.isAbsolutePath(path)) {
+ 545 0 String[] s = FILE_UTILS.dissect(path);
+ 546 0 root = s[0];
+ 547 0 path = s[1];
+ 548
+ }
+ 549 9 char sep = File.separatorChar;
+ 550 9 int start = 0;
+ 551 9 int len = path.length();
+ 552 9 int count = 0;
+ 553 145 for (int pos = 0; pos < len; pos++) {
+ 554 136 if (path.charAt(pos) == sep) {
+ 555 2 if (pos != start) {
+ 556 1 count++;
+ 557
+ }
+ 558 2 start = pos + 1;
+ 559
+ }
+ 560
+ }
+ 561 9 if (len != start) {
+ 562 9 count++;
+ 563
+ }
+ 564 9 String[] l = new String[count + ((root == null ) ? 0 : 1)];
+ 565
+
+ 566 9 if (root != null ) {
+ 567 0 l[0] = root;
+ 568 0 count = 1;
+ 569
+ } else {
+ 570 9 count = 0;
+ 571
+ }
+ 572 9 start = 0;
+ 573 145 for (int pos = 0; pos < len; pos++) {
+ 574 136 if (path.charAt(pos) == sep) {
+ 575 2 if (pos != start) {
+ 576 1 String tok = path.substring(start, pos);
+ 577 1 l[count++] = tok;
+ 578
+ }
+ 579 2 start = pos + 1;
+ 580
+ }
+ 581
+ }
+ 582 9 if (len != start) {
+ 583 9 String tok = path.substring(start);
+ 584 9 l[count] = tok;
+ 585
+ }
+ 586 9 return l;
+ 587
+ }
+ 588
+
+ 589
+
+ 590
+
+ 591
+
+ 592
+
+ 593
+
+ 594
+
+ 595
+
+ 596
+
+ 597
+
+ 598
+
+ 599
+
+ 600
+
+ 601
+
+ 602
+
+ 603
+ public static boolean isOutOfDate(File src, File target, int granularity) {
+ 604 0 if (!src.exists()) {
+ 605 0 return false ;
+ 606
+ }
+ 607 0 if (!target.exists()) {
+ 608 0 return true ;
+ 609
+ }
+ 610 0 if ((src.lastModified() - granularity) > target.lastModified()) {
+ 611 0 return true ;
+ 612
+ }
+ 613 0 return false ;
+ 614
+ }
+ 615
+
+ 616
+
+ 617
+
+ 618
+
+ 619
+
+ 620
+
+ 621
+
+ 622
+
+ 623
+
+ 624
+
+ 625
+
+ 626
+
+ 627
+
+ 628
+
+ 629
+
+ 630
+ public static boolean isOutOfDate(Resource src, Resource target,
+ 631
+ int granularity) {
+ 632 0 return isOutOfDate(src, target, (long ) granularity);
+ 633
+ }
+ 634
+
+ 635
+
+ 636
+
+ 637
+
+ 638
+
+ 639
+
+ 640
+
+ 641
+
+ 642
+
+ 643
+
+ 644
+
+ 645
+
+ 646
+
+ 647
+
+ 648
+
+ 649
+ public static boolean isOutOfDate(Resource src, Resource target, long granularity) {
+ 650 0 long sourceLastModified = src.getLastModified();
+ 651 0 long targetLastModified = target.getLastModified();
+ 652 0 return src.isExists()
+ 653
+ && (sourceLastModified == Resource.UNKNOWN_DATETIME
+ 654
+ || targetLastModified == Resource.UNKNOWN_DATETIME
+ 655
+ || (sourceLastModified - granularity) > targetLastModified);
+ 656
+ }
+ 657
+
+ 658
+
+ 659
+
+ 660
+
+ 661
+
+ 662
+
+ 663
+
+ 664
+
+ 665
+
+ 666
+ public static String removeWhitespace(String input) {
+ 667 0 StringBuffer result = new StringBuffer();
+ 668 0 if (input != null ) {
+ 669 0 StringTokenizer st = new StringTokenizer(input);
+ 670 0 while (st.hasMoreTokens()) {
+ 671 0 result.append(st.nextToken());
+ 672
+ }
+ 673
+ }
+ 674 0 return result.toString();
+ 675
+ }
+ 676
+
+ 677
+
+ 678
+
+ 679
+
+ 680
+
+ 681
+
+ 682
+ public static boolean hasWildcards(String input) {
+ 683 3 return (input.indexOf('*' ) != -1 || input.indexOf('?' ) != -1);
+ 684
+ }
+ 685
+
+ 686
+
+ 687
+
+ 688
+
+ 689
+
+ 690
+
+ 691
+ public static String rtrimWildcardTokens(String input) {
+ 692 0 return new TokenizedPattern(input).rtrimWildcardTokens().toString();
+ 693
+ }
+ 694
+ }
+ 695
+
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath.html
new file mode 100644
index 000000000..dd41e056a
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath.html
@@ -0,0 +1,404 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+ 20
+
+ 21
+ import java.io.File;
+ 22
+
+ 23
+ import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+ 24
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+ 25
+ import org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils;
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+ public class TokenizedPath {
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36 1 public static final TokenizedPath EMPTY_PATH =
+ 37
+ new TokenizedPath("" , new String[0]);
+ 38
+
+ 39
+
+ 40 1 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+ 41
+
+ 42 1 private static final SymbolicLinkUtils SYMLINK_UTILS =
+ 43
+ SymbolicLinkUtils.getSymbolicLinkUtils();
+ 44
+
+ 45 1 private static final boolean [] CS_SCAN_ONLY = new boolean [] {true };
+ 46
+
+ 47 1 private static final boolean [] CS_THEN_NON_CS = new boolean [] {true , false };
+ 48
+
+ 49
+ private final String path;
+ 50
+ private final String[] tokenizedPath;
+ 51
+
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+
+ 57
+ public TokenizedPath(String path) {
+ 58 0 this (path, SelectorUtils.tokenizePathAsArray(path));
+ 59 0 }
+ 60
+
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67 18 public TokenizedPath(TokenizedPath parent, String child) {
+ 68 18 if (parent.path.length() > 0
+ 69
+ && parent.path.charAt(parent.path.length() - 1)
+ 70
+ != File.separatorChar) {
+ 71 18 path = parent.path + File.separatorChar + child;
+ 72
+ } else {
+ 73 0 path = parent.path + child;
+ 74
+ }
+ 75 18 tokenizedPath = new String[parent.tokenizedPath.length + 1];
+ 76 18 System.arraycopy(parent.tokenizedPath, 0, tokenizedPath, 0,
+ 77
+ parent.tokenizedPath.length);
+ 78 18 tokenizedPath[parent.tokenizedPath.length] = child;
+ 79 18 }
+ 80
+
+ 81
+ TokenizedPath(String path, String[] tokens) {
+ 82
+ this .path = path;
+ 83
+ this .tokenizedPath = tokens;
+ 84
+ }
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+ public String toString() {
+ 90 77 return path;
+ 91
+ }
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+ public int depth() {
+ 97 0 return tokenizedPath.length;
+ 98
+ }
+ 99
+
+ 100
+ String[] getTokens() {
+ 101
+ return tokenizedPath;
+ 102
+ }
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+
+ 112
+ public File findFile(File base, final boolean cs) {
+ 113 0 String[] tokens = tokenizedPath;
+ 114 0 if (FileUtils.isAbsolutePath(path)) {
+ 115 0 if (base == null ) {
+ 116 0 String[] s = FILE_UTILS.dissect(path);
+ 117 0 base = new File(s[0]);
+ 118 0 tokens = SelectorUtils.tokenizePathAsArray(s[1]);
+ 119 0 } else {
+ 120 0 File f = FILE_UTILS.normalize(path);
+ 121 0 String s = FILE_UTILS.removeLeadingPath(base, f);
+ 122 0 if (s.equals(f.getAbsolutePath())) {
+ 123
+
+ 124
+
+ 125 0 return null ;
+ 126
+ }
+ 127 0 tokens = SelectorUtils.tokenizePathAsArray(s);
+ 128
+ }
+ 129
+ }
+ 130 0 return findFile(base, tokens, cs);
+ 131
+ }
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+ public boolean isSymlink(File base) {
+ 139 0 for (int i = 0; i < tokenizedPath.length; i++) {
+ 140
+ try {
+ 141 0 if ((base != null
+ 142
+ && SYMLINK_UTILS.isSymbolicLink(base, tokenizedPath[i]))
+ 143
+ ||
+ 144
+ (base == null
+ 145
+ && SYMLINK_UTILS.isSymbolicLink(tokenizedPath[i]))
+ 146
+ ) {
+ 147 0 return true ;
+ 148
+ }
+ 149 0 base = new File(base, tokenizedPath[i]);
+ 150 0 } catch (java.io.IOException ioe) {
+ 151 0 String msg = "IOException caught while checking "
+ 152
+ + "for links, couldn't get canonical path!" ;
+ 153
+
+ 154 0 System.err.println(msg);
+ 155 0 }
+ 156
+ }
+ 157 0 return false ;
+ 158
+ }
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+ public boolean equals(Object o) {
+ 164 0 return o instanceof TokenizedPath
+ 165
+ && path.equals(((TokenizedPath) o).path);
+ 166
+ }
+ 167
+
+ 168
+ public int hashCode() {
+ 169 2 return path.hashCode();
+ 170
+ }
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+ private static File findFile(File base, final String[] pathElements,
+ 182
+ final boolean cs) {
+ 183 0 for (int current = 0; current < pathElements.length; current++) {
+ 184 0 if (!base.isDirectory()) {
+ 185 0 return null ;
+ 186
+ }
+ 187 0 String[] files = base.list();
+ 188 0 if (files == null ) {
+ 189 0 throw new BuildException("IO error scanning directory "
+ 190
+ + base.getAbsolutePath());
+ 191
+ }
+ 192 0 boolean found = false ;
+ 193 0 boolean [] matchCase = cs ? CS_SCAN_ONLY : CS_THEN_NON_CS;
+ 194 0 for (int i = 0; !found && i < matchCase.length; i++) {
+ 195 0 for (int j = 0; !found && j < files.length; j++) {
+ 196 0 if (matchCase[i]
+ 197
+ ? files[j].equals(pathElements[current])
+ 198
+ : files[j].equalsIgnoreCase(pathElements[current])) {
+ 199 0 base = new File(base, files[j]);
+ 200 0 found = true ;
+ 201
+ }
+ 202
+ }
+ 203
+ }
+ 204 0 if (!found) {
+ 205 0 return null ;
+ 206
+ }
+ 207
+ }
+ 208 0 return pathElements.length == 0 && !base.isDirectory() ? null : base;
+ 209
+ }
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+ public TokenizedPattern toPattern() {
+ 216 0 return new TokenizedPattern(path, tokenizedPath);
+ 217
+ }
+ 218
+
+ 219
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern.html
new file mode 100644
index 000000000..610a9be30
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern.html
@@ -0,0 +1,342 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+
+ 19
+ package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+ 20
+
+ 21
+ import java.io.File;
+ 22
+
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+ public class TokenizedPattern {
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37 1 public static final TokenizedPattern EMPTY_PATTERN =
+ 38
+ new TokenizedPattern("" , new String[0]);
+ 39
+
+ 40
+ private final String pattern;
+ 41
+ private final String[] tokenizedPattern;
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+
+ 48
+ public TokenizedPattern(String pattern) {
+ 49 1 this (pattern, SelectorUtils.tokenizePathAsArray(pattern));
+ 50 1 }
+ 51
+
+ 52
+ TokenizedPattern(String pattern, String[] tokens) {
+ 53
+ this .pattern = pattern;
+ 54
+ this .tokenizedPattern = tokens;
+ 55
+ }
+ 56
+
+ 57
+
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+ public boolean matchPath(TokenizedPath path, boolean isCaseSensitive) {
+ 69 20 return SelectorUtils.matchPath(tokenizedPattern, path.getTokens(),
+ 70
+ isCaseSensitive);
+ 71
+ }
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+ public boolean matchStartOf(TokenizedPath path,
+ 78
+ boolean caseSensitive) {
+ 79 9 return SelectorUtils.matchPatternStart(tokenizedPattern,
+ 80
+ path.getTokens(), caseSensitive);
+ 81
+ }
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+ public String toString() {
+ 87 1 return pattern;
+ 88
+ }
+ 89
+
+ 90
+ public String getPattern() {
+ 91
+ return pattern;
+ 92
+ }
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+ public boolean equals(Object o) {
+ 98 0 return o instanceof TokenizedPattern
+ 99
+ && pattern.equals(((TokenizedPattern) o).pattern);
+ 100
+ }
+ 101
+
+ 102
+ public int hashCode() {
+ 103 0 return pattern.hashCode();
+ 104
+ }
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+ public int depth() {
+ 110 0 return tokenizedPattern.length;
+ 111
+ }
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+ public boolean containsPattern(String pat) {
+ 117 18 for (int i = 0; i < tokenizedPattern.length; i++) {
+ 118 18 if (tokenizedPattern[i].equals(pat)) {
+ 119 9 return true ;
+ 120
+ }
+ 121
+ }
+ 122 0 return false ;
+ 123
+ }
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+ public TokenizedPath rtrimWildcardTokens() {
+ 131 1 StringBuilder sb = new StringBuilder();
+ 132 1 int newLen = 0;
+ 133 3 for (; newLen < tokenizedPattern.length; newLen++) {
+ 134 2 if (SelectorUtils.hasWildcards(tokenizedPattern[newLen])) {
+ 135 1 break ;
+ 136
+ }
+ 137 1 if (newLen > 0
+ 138
+ && sb.charAt(sb.length() - 1) != File.separatorChar) {
+ 139 0 sb.append(File.separator);
+ 140
+ }
+ 141 1 sb.append(tokenizedPattern[newLen]);
+ 142
+ }
+ 143 1 if (newLen == 0) {
+ 144 0 return TokenizedPath.EMPTY_PATH;
+ 145
+ }
+ 146 1 String[] newPats = new String[newLen];
+ 147 1 System.arraycopy(tokenizedPattern, 0, newPats, 0, newLen);
+ 148 1 return new TokenizedPath(sb.toString(), newPats);
+ 149
+ }
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+ public boolean endsWith(String s) {
+ 155 0 return tokenizedPattern.length > 0
+ 156
+ && tokenizedPattern[tokenizedPattern.length - 1].equals(s);
+ 157
+ }
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162
+ public TokenizedPattern withoutLastToken() {
+ 163 0 if (tokenizedPattern.length == 0) {
+ 164 0 throw new IllegalStateException("cant strip a token from nothing" );
+ 165 0 } else if (tokenizedPattern.length == 1) {
+ 166 0 return EMPTY_PATTERN;
+ 167
+ } else {
+ 168 0 String toStrip = tokenizedPattern[tokenizedPattern.length - 1];
+ 169 0 int index = pattern.lastIndexOf(toStrip);
+ 170 0 String[] tokens = new String[tokenizedPattern.length - 1];
+ 171 0 System.arraycopy(tokenizedPattern, 0, tokens, 0,
+ 172
+ tokenizedPattern.length - 1);
+ 173 0 return new TokenizedPattern(pattern.substring(0, index), tokens);
+ 174
+ }
+ 175
+ }
+ 176
+
+ 177
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.html
new file mode 100644
index 000000000..23d51dfbb
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils.html
@@ -0,0 +1,500 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.util;
+ 19
+
+ 20
+ import java.util.ArrayList;
+ 21
+ import java.util.Collection;
+ 22
+ import java.util.Collections;
+ 23
+ import java.util.Dictionary;
+ 24
+ import java.util.Enumeration;
+ 25
+ import java.util.Iterator;
+ 26
+ import java.util.List;
+ 27
+ import java.util.NoSuchElementException;
+ 28
+ import java.util.Vector;
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+ public class CollectionUtils {
+ 38
+
+ 39
+
+ 40
+
+ 41
+
+ 42
+ @SuppressWarnings("rawtypes" )
+ 43
+ @Deprecated
+ 44 1 public static final List EMPTY_LIST = Collections.EMPTY_LIST;
+ 45
+
+ 46
+
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+
+ 54
+ public static boolean equals(Vector<?> v1, Vector<?> v2) {
+ 55 0 if (v1 == v2) {
+ 56 0 return true ;
+ 57
+ }
+ 58
+
+ 59 0 if (v1 == null || v2 == null ) {
+ 60 0 return false ;
+ 61
+ }
+ 62
+
+ 63 0 return v1.equals(v2);
+ 64
+ }
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+
+ 74
+
+ 75
+
+ 76
+
+ 77
+ public static boolean equals(Dictionary<?, ?> d1, Dictionary<?, ?> d2) {
+ 78 0 if (d1 == d2) {
+ 79 0 return true ;
+ 80
+ }
+ 81
+
+ 82 0 if (d1 == null || d2 == null ) {
+ 83 0 return false ;
+ 84
+ }
+ 85
+
+ 86 0 if (d1.size() != d2.size()) {
+ 87 0 return false ;
+ 88
+ }
+ 89
+
+ 90 0 Enumeration<?> e1 = d1.keys();
+ 91 0 while (e1.hasMoreElements()) {
+ 92 0 Object key = e1.nextElement();
+ 93 0 Object value1 = d1.get(key);
+ 94 0 Object value2 = d2.get(key);
+ 95 0 if (value2 == null || !value1.equals(value2)) {
+ 96 0 return false ;
+ 97
+ }
+ 98 0 }
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103 0 return true ;
+ 104
+ }
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+
+ 111
+
+ 112
+ public static String flattenToString(Collection<?> c) {
+ 113 0 final StringBuilder sb = new StringBuilder();
+ 114 0 for (Object o : c) {
+ 115 0 if (sb.length() != 0) {
+ 116 0 sb.append("," );
+ 117
+ }
+ 118 0 sb.append(o);
+ 119 0 }
+ 120 0 return sb.toString();
+ 121
+ }
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+
+ 129
+
+ 130
+ public static <K, V> void putAll(Dictionary<? super K, ? super V> m1, Dictionary<? extends K, ? extends V> m2) {
+ 131 0 for (Enumeration<? extends K> it = m2.keys(); it.hasMoreElements();) {
+ 132 0 K key = it.nextElement();
+ 133 0 m1.put(key, m2.get(key));
+ 134 0 }
+ 135 0 }
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+ public static final class EmptyEnumeration<E> implements Enumeration<E> {
+ 142
+
+ 143
+ public EmptyEnumeration() {
+ 144
+ }
+ 145
+
+ 146
+
+ 147
+
+ 148
+
+ 149
+ public boolean hasMoreElements() {
+ 150
+ return false ;
+ 151
+ }
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+ public E nextElement() throws NoSuchElementException {
+ 158 0 throw new NoSuchElementException();
+ 159
+ }
+ 160
+ }
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+
+ 170
+ public static <E> Enumeration<E> append(Enumeration<E> e1, Enumeration<E> e2) {
+ 171 0 return new CompoundEnumeration<E>(e1, e2);
+ 172
+ }
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+ public static <E> Enumeration<E> asEnumeration(final Iterator<E> iter) {
+ 180 0 return new Enumeration<E>() {
+ 181
+ public boolean hasMoreElements() {
+ 182 0 return iter.hasNext();
+ 183
+ }
+ 184
+ public E nextElement() {
+ 185 0 return iter.next();
+ 186
+ }
+ 187
+ };
+ 188
+ }
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+ public static <E> Iterator<E> asIterator(final Enumeration<E> e) {
+ 196 0 return new Iterator<E>() {
+ 197
+ public boolean hasNext() {
+ 198 0 return e.hasMoreElements();
+ 199
+ }
+ 200
+ public E next() {
+ 201 0 return e.nextElement();
+ 202
+ }
+ 203
+ public void remove() {
+ 204 0 throw new UnsupportedOperationException();
+ 205
+ }
+ 206
+ };
+ 207
+ }
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+ public static <T> Collection<T> asCollection(final Iterator<? extends T> iter) {
+ 215 0 List<T> l = new ArrayList<T>();
+ 216 0 while (iter.hasNext()) {
+ 217 0 l.add(iter.next());
+ 218
+ }
+ 219 0 return l;
+ 220
+ }
+ 221
+
+ 222
+ private static final class CompoundEnumeration<E> implements Enumeration<E> {
+ 223
+
+ 224
+ private final Enumeration<E> e1, e2;
+ 225
+
+ 226
+ public CompoundEnumeration(Enumeration<E> e1, Enumeration<E> e2) {
+ 227
+ this .e1 = e1;
+ 228
+ this .e2 = e2;
+ 229
+ }
+ 230
+
+ 231
+ public boolean hasMoreElements() {
+ 232 0 return e1.hasMoreElements() || e2.hasMoreElements();
+ 233
+ }
+ 234
+
+ 235
+ public E nextElement() throws NoSuchElementException {
+ 236 0 if (e1.hasMoreElements()) {
+ 237 0 return e1.nextElement();
+ 238
+ } else {
+ 239 0 return e2.nextElement();
+ 240
+ }
+ 241
+ }
+ 242
+
+ 243
+ }
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+
+ 251
+ public static int frequency(Collection<?> c, Object o) {
+ 252
+
+ 253 3 int freq = 0;
+ 254 3 if (c != null ) {
+ 255 3 for (Iterator<?> i = c.iterator(); i.hasNext(); ) {
+ 256 18 Object test = i.next();
+ 257 18 if (o == null ? test == null : o.equals(test)) {
+ 258 0 freq++;
+ 259
+ }
+ 260 18 }
+ 261
+ }
+ 262 3 return freq;
+ 263
+ }
+ 264
+
+ 265
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.html
new file mode 100644
index 000000000..39e643ccf
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils.html
@@ -0,0 +1,3047 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.util;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+ import java.io.FilenameFilter;
+ 22
+ import java.io.IOException;
+ 23
+ import java.io.InputStream;
+ 24
+ import java.io.InputStreamReader;
+ 25
+ import java.io.OutputStream;
+ 26
+ import java.io.Reader;
+ 27
+ import java.io.Writer;
+ 28
+ import java.net.HttpURLConnection;
+ 29
+ import java.net.JarURLConnection;
+ 30
+ import java.net.MalformedURLException;
+ 31
+ import java.net.URL;
+ 32
+ import java.net.URLConnection;
+ 33
+ import java.nio.channels.Channel;
+ 34
+ import java.text.DecimalFormat;
+ 35
+ import java.util.ArrayList;
+ 36
+ import java.util.Arrays;
+ 37
+ import java.util.Iterator;
+ 38
+ import java.util.List;
+ 39
+ import java.util.Random;
+ 40
+ import java.util.Stack;
+ 41
+ import java.util.StringTokenizer;
+ 42
+ import java.util.jar.JarFile;
+ 43
+ import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+ 44
+ import org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer;
+ 45
+ import org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator;
+ 46
+ import org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os;
+ 47
+
+ 48
+
+ 49
+
+ 50
+
+ 51
+
+ 52
+
+ 53
+ public class FileUtils {
+ 54
+
+ 55
+ private static final int DELETE_RETRY_SLEEP_MILLIS = 10;
+ 56
+ private static final int EXPAND_SPACE = 50;
+ 57 1 private static final FileUtils PRIMARY_INSTANCE = new FileUtils();
+ 58
+
+ 59
+
+ 60 1 private static Random rand = new Random(System.currentTimeMillis()
+ 61
+ + Runtime.getRuntime().freeMemory());
+ 62
+
+ 63 1 private static final boolean ON_NETWARE = Os.isFamily("netware" );
+ 64 1 private static final boolean ON_DOS = Os.isFamily("dos" );
+ 65 1 private static final boolean ON_WIN9X = Os.isFamily("win9x" );
+ 66 1 private static final boolean ON_WINDOWS = Os.isFamily("windows" );
+ 67
+
+ 68
+ static final int BUF_SIZE = 8192;
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+ public static final long FAT_FILE_TIMESTAMP_GRANULARITY = 2000;
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+ public static final long UNIX_FILE_TIMESTAMP_GRANULARITY = 1000;
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+ public static final long NTFS_FILE_TIMESTAMP_GRANULARITY = 1;
+ 85
+
+ 86
+
+ 87
+
+ 88
+
+ 89
+
+ 90 1 private Object cacheFromUriLock = new Object();
+ 91 1 private String cacheFromUriRequest = null ;
+ 92 1 private String cacheFromUriResponse = null ;
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+ public static FileUtils newFileUtils() {
+ 101 0 return new FileUtils();
+ 102
+ }
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+
+ 109
+
+ 110
+ public static FileUtils getFileUtils() {
+ 111 4 return PRIMARY_INSTANCE;
+ 112
+ }
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117 1 protected FileUtils() {
+ 118 1 }
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+ public URL getFileURL(File file) throws MalformedURLException {
+ 128 0 return new URL(file.toURI().toASCIIString());
+ 129
+ }
+ 130
+
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148
+
+ 149
+
+ 150
+
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+
+ 170
+
+ 171
+
+ 172
+
+ 173
+
+ 174
+
+ 175
+
+ 176
+
+ 177
+
+ 178
+
+ 179
+
+ 180
+
+ 181
+
+ 182
+
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229
+
+ 230
+
+ 231
+
+ 232
+
+ 233
+
+ 234
+
+ 235
+
+ 236
+
+ 237
+
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+
+ 251
+
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+
+ 266
+
+ 267
+
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272
+
+ 273
+
+ 274
+
+ 275
+
+ 276
+
+ 277
+
+ 278
+
+ 279
+
+ 280
+
+ 281
+
+ 282
+
+ 283
+
+ 284
+
+ 285
+
+ 286
+
+ 287
+
+ 288
+
+ 289
+
+ 290
+
+ 291
+
+ 292
+
+ 293
+
+ 294
+
+ 295
+
+ 296
+
+ 297
+
+ 298
+
+ 299
+
+ 300
+
+ 301
+
+ 302
+
+ 303
+
+ 304
+
+ 305
+
+ 306
+
+ 307
+
+ 308
+
+ 309
+
+ 310
+
+ 311
+
+ 312
+
+ 313
+
+ 314
+
+ 315
+
+ 316
+
+ 317
+
+ 318
+
+ 319
+
+ 320
+
+ 321
+
+ 322
+
+ 323
+
+ 324
+
+ 325
+
+ 326
+
+ 327
+
+ 328
+
+ 329
+
+ 330
+
+ 331
+
+ 332
+
+ 333
+
+ 334
+
+ 335
+
+ 336
+
+ 337
+
+ 338
+
+ 339
+
+ 340
+
+ 341
+
+ 342
+
+ 343
+
+ 344
+
+ 345
+
+ 346
+
+ 347
+
+ 348
+
+ 349
+
+ 350
+
+ 351
+
+ 352
+
+ 353
+
+ 354
+
+ 355
+
+ 356
+
+ 357
+
+ 358
+
+ 359
+
+ 360
+
+ 361
+
+ 362
+
+ 363
+
+ 364
+
+ 365
+
+ 366
+
+ 367
+
+ 368
+
+ 369
+
+ 370
+
+ 371
+
+ 372
+
+ 373
+
+ 374
+
+ 375
+
+ 376
+
+ 377
+
+ 378
+
+ 379
+
+ 380
+
+ 381
+
+ 382
+
+ 383
+
+ 384
+
+ 385
+
+ 386
+
+ 387
+
+ 388
+
+ 389
+
+ 390
+
+ 391
+
+ 392
+
+ 393
+
+ 394
+
+ 395
+
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400
+
+ 401
+
+ 402
+
+ 403
+
+ 404
+
+ 405
+
+ 406
+
+ 407
+
+ 408
+
+ 409
+
+ 410
+
+ 411
+
+ 412
+
+ 413
+
+ 414
+
+ 415
+
+ 416
+
+ 417
+
+ 418
+
+ 419
+
+ 420
+
+ 421
+
+ 422
+
+ 423
+
+ 424
+
+ 425
+
+ 426
+
+ 427
+
+ 428
+
+ 429
+
+ 430
+
+ 431
+
+ 432
+
+ 433
+
+ 434
+
+ 435
+
+ 436
+
+ 437
+
+ 438
+
+ 439
+
+ 440
+
+ 441
+
+ 442
+
+ 443
+
+ 444
+
+ 445
+
+ 446
+
+ 447
+
+ 448
+
+ 449
+
+ 450
+
+ 451
+
+ 452
+
+ 453
+
+ 454
+
+ 455
+
+ 456
+
+ 457
+
+ 458
+
+ 459
+
+ 460
+
+ 461
+
+ 462
+
+ 463
+
+ 464
+
+ 465
+
+ 466
+
+ 467
+
+ 468
+
+ 469
+
+ 470
+
+ 471
+
+ 472
+
+ 473
+
+ 474
+
+ 475
+
+ 476
+
+ 477
+
+ 478
+
+ 479
+
+ 480
+
+ 481
+
+ 482
+
+ 483
+
+ 484
+
+ 485
+
+ 486
+
+ 487
+
+ 488
+
+ 489
+
+ 490
+
+ 491
+
+ 492
+
+ 493
+
+ 494
+
+ 495
+
+ 496
+
+ 497
+
+ 498
+
+ 499
+
+ 500
+
+ 501
+
+ 502
+
+ 503
+
+ 504
+
+ 505
+
+ 506
+
+ 507
+
+ 508
+
+ 509
+
+ 510
+
+ 511
+
+ 512
+
+ 513
+
+ 514
+
+ 515
+
+ 516
+
+ 517
+
+ 518
+
+ 519
+
+ 520
+
+ 521
+
+ 522
+
+ 523
+
+ 524
+
+ 525
+
+ 526
+
+ 527
+
+ 528
+
+ 529
+
+ 530
+
+ 531
+
+ 532
+
+ 533
+
+ 534
+
+ 535
+
+ 536
+
+ 537
+
+ 538
+
+ 539
+
+ 540
+
+ 541
+
+ 542
+
+ 543
+
+ 544
+
+ 545
+
+ 546
+
+ 547
+
+ 548
+
+ 549
+
+ 550
+
+ 551
+
+ 552
+
+ 553
+
+ 554
+
+ 555
+
+ 556
+
+ 557
+
+ 558
+
+ 559
+
+ 560
+
+ 561
+
+ 562
+
+ 563
+
+ 564
+
+ 565
+
+ 566
+
+ 567
+
+ 568
+
+ 569
+
+ 570
+
+ 571
+
+ 572
+
+ 573
+
+ 574
+
+ 575
+
+ 576
+
+ 577
+
+ 578
+
+ 579
+
+ 580
+ public File resolveFile(File file, String filename) {
+ 581 0 if (!isAbsolutePath(filename)) {
+ 582 0 char sep = File.separatorChar;
+ 583 0 filename = filename.replace('/' , sep).replace('\\' , sep);
+ 584 0 if (isContextRelativePath(filename)) {
+ 585 0 file = null ;
+ 586
+
+ 587
+
+ 588 0 String udir = System.getProperty("user.dir" );
+ 589 0 if (filename.charAt(0) == sep && udir.charAt(0) == sep) {
+ 590 0 filename = dissect(udir)[0] + filename.substring(1);
+ 591
+ }
+ 592
+ }
+ 593 0 filename = new File(file, filename).getAbsolutePath();
+ 594
+ }
+ 595 0 return normalize(filename);
+ 596
+ }
+ 597
+
+ 598
+
+ 599
+
+ 600
+
+ 601
+
+ 602
+
+ 603
+
+ 604
+
+ 605
+
+ 606
+
+ 607
+
+ 608
+ public static boolean isContextRelativePath(String filename) {
+ 609 0 if (!(ON_DOS || ON_NETWARE) || filename.length() == 0) {
+ 610 0 return false ;
+ 611
+ }
+ 612 0 char sep = File.separatorChar;
+ 613 0 filename = filename.replace('/' , sep).replace('\\' , sep);
+ 614 0 char c = filename.charAt(0);
+ 615 0 int len = filename.length();
+ 616 0 return (c == sep && (len == 1 || filename.charAt(1) != sep))
+ 617
+ || (Character.isLetter(c) && len > 1
+ 618
+ && filename.charAt(1) == ':'
+ 619
+ && (len == 2 || filename.charAt(2) != sep));
+ 620
+ }
+ 621
+
+ 622
+
+ 623
+
+ 624
+
+ 625
+
+ 626
+
+ 627
+
+ 628
+
+ 629
+
+ 630
+
+ 631
+
+ 632
+ public static boolean isAbsolutePath(String filename) {
+ 633 12 int len = filename.length();
+ 634 12 if (len == 0) {
+ 635 0 return false ;
+ 636
+ }
+ 637 12 char sep = File.separatorChar;
+ 638 12 filename = filename.replace('/' , sep).replace('\\' , sep);
+ 639 12 char c = filename.charAt(0);
+ 640 12 if (!(ON_DOS || ON_NETWARE)) {
+ 641 0 return (c == sep);
+ 642
+ }
+ 643 12 if (c == sep) {
+ 644
+
+ 645 2 if (!(ON_DOS && len > 4 && filename.charAt(1) == sep)) {
+ 646 2 return false ;
+ 647
+ }
+ 648
+
+ 649 0 int nextsep = filename.indexOf(sep, 2);
+ 650 0 return nextsep > 2 && nextsep + 1 < len;
+ 651
+ }
+ 652 10 int colon = filename.indexOf(':' );
+ 653 10 return (Character.isLetter(c) && colon == 1
+ 654
+ && filename.length() > 2 && filename.charAt(2) == sep)
+ 655
+ || (ON_NETWARE && colon > 0);
+ 656
+ }
+ 657
+
+ 658
+
+ 659
+
+ 660
+
+ 661
+
+ 662
+
+ 663
+
+ 664
+
+ 665
+
+ 666
+
+ 667
+
+ 668
+
+ 669
+
+ 670
+
+ 671
+ public static String translatePath(String toProcess) {
+ 672 0 if (toProcess == null || toProcess.length() == 0) {
+ 673 0 return "" ;
+ 674
+ }
+ 675 0 StringBuffer path = new StringBuffer(toProcess.length() + EXPAND_SPACE);
+ 676 0 PathTokenizer tokenizer = new PathTokenizer(toProcess);
+ 677 0 while (tokenizer.hasMoreTokens()) {
+ 678 0 String pathComponent = tokenizer.nextToken();
+ 679 0 pathComponent = pathComponent.replace('/' , File.separatorChar);
+ 680 0 pathComponent = pathComponent.replace('\\' , File.separatorChar);
+ 681 0 if (path.length() != 0) {
+ 682 0 path.append(File.pathSeparatorChar);
+ 683
+ }
+ 684 0 path.append(pathComponent);
+ 685 0 }
+ 686 0 return path.toString();
+ 687
+ }
+ 688
+
+ 689
+
+ 690
+
+ 691
+
+ 692
+
+ 693
+
+ 694
+
+ 695
+
+ 696
+
+ 697
+
+ 698
+
+ 699
+
+ 700
+
+ 701
+
+ 702
+
+ 703
+
+ 704
+
+ 705
+
+ 706
+
+ 707
+ public File normalize(final String path) {
+ 708 2 Stack s = new Stack();
+ 709 2 String[] dissect = dissect(path);
+ 710 2 s.push(dissect[0]);
+ 711
+
+ 712 2 StringTokenizer tok = new StringTokenizer(dissect[1], File.separator);
+ 713 17 while (tok.hasMoreTokens()) {
+ 714 15 String thisToken = tok.nextToken();
+ 715 15 if ("." .equals(thisToken)) {
+ 716 0 continue ;
+ 717
+ }
+ 718 15 if (".." .equals(thisToken)) {
+ 719 0 if (s.size() < 2) {
+ 720
+
+ 721 0 return new File(path);
+ 722
+ }
+ 723 0 s.pop();
+ 724
+ } else {
+ 725 15 s.push(thisToken);
+ 726
+ }
+ 727 15 }
+ 728 2 StringBuffer sb = new StringBuffer();
+ 729 2 final int size = s.size();
+ 730 19 for (int i = 0; i < size; i++) {
+ 731 17 if (i > 1) {
+ 732
+
+ 733
+
+ 734 13 sb.append(File.separatorChar);
+ 735
+ }
+ 736 17 sb.append(s.elementAt(i));
+ 737
+ }
+ 738 2 return new File(sb.toString());
+ 739
+ }
+ 740
+
+ 741
+
+ 742
+
+ 743
+
+ 744
+
+ 745
+
+ 746
+
+ 747
+
+ 748
+
+ 749
+ public String[] dissect(String path) {
+ 750 2 char sep = File.separatorChar;
+ 751 2 path = path.replace('/' , sep).replace('\\' , sep);
+ 752
+
+ 753
+
+ 754 2 if (!isAbsolutePath(path)) {
+ 755 0 throw new BuildException(path + " is not an absolute path" );
+ 756
+ }
+ 757 2 String root = null ;
+ 758 2 int colon = path.indexOf(':' );
+ 759 2 if (colon > 0 && (ON_DOS || ON_NETWARE)) {
+ 760
+
+ 761 2 int next = colon + 1;
+ 762 2 root = path.substring(0, next);
+ 763 2 char [] ca = path.toCharArray();
+ 764 2 root += sep;
+ 765
+
+ 766 2 next = (ca[next] == sep) ? next + 1 : next;
+ 767
+
+ 768 2 StringBuffer sbPath = new StringBuffer();
+ 769
+
+ 770 185 for (int i = next; i < ca.length; i++) {
+ 771 183 if (ca[i] != sep || ca[i - 1] != sep) {
+ 772 183 sbPath.append(ca[i]);
+ 773
+ }
+ 774
+ }
+ 775 2 path = sbPath.toString();
+ 776 2 } else if (path.length() > 1 && path.charAt(1) == sep) {
+ 777
+
+ 778 0 int nextsep = path.indexOf(sep, 2);
+ 779 0 nextsep = path.indexOf(sep, nextsep + 1);
+ 780 0 root = (nextsep > 2) ? path.substring(0, nextsep + 1) : path;
+ 781 0 path = path.substring(root.length());
+ 782 0 } else {
+ 783 0 root = File.separator;
+ 784 0 path = path.substring(1);
+ 785
+ }
+ 786 2 return new String[]{root, path};
+ 787
+ }
+ 788
+
+ 789
+
+ 790
+
+ 791
+
+ 792
+
+ 793
+
+ 794
+
+ 795
+
+ 796
+ public String toVMSPath(File f) {
+ 797
+
+ 798
+ String osPath;
+ 799 0 String path = normalize(f.getAbsolutePath()).getPath();
+ 800 0 String name = f.getName();
+ 801 0 boolean isAbsolute = path.charAt(0) == File.separatorChar;
+ 802
+
+ 803
+
+ 804 0 boolean isDirectory = f.isDirectory()
+ 805
+ && !name.regionMatches(true , name.length() - 4, ".DIR" , 0, 4);
+ 806
+
+ 807 0 String device = null ;
+ 808 0 StringBuffer directory = null ;
+ 809 0 String file = null ;
+ 810
+
+ 811 0 int index = 0;
+ 812
+
+ 813 0 if (isAbsolute) {
+ 814 0 index = path.indexOf(File.separatorChar, 1);
+ 815 0 if (index == -1) {
+ 816 0 return path.substring(1) + ":[000000]" ;
+ 817
+ }
+ 818 0 device = path.substring(1, index++);
+ 819
+ }
+ 820 0 if (isDirectory) {
+ 821 0 directory = new StringBuffer(path.substring(index).replace(File.separatorChar, '.' ));
+ 822
+ } else {
+ 823 0 int dirEnd = path.lastIndexOf(File.separatorChar, path.length());
+ 824 0 if (dirEnd == -1 || dirEnd < index) {
+ 825 0 file = path.substring(index);
+ 826
+ } else {
+ 827 0 directory = new StringBuffer(path.substring(index, dirEnd).
+ 828
+ replace(File.separatorChar, '.' ));
+ 829 0 index = dirEnd + 1;
+ 830 0 if (path.length() > index) {
+ 831 0 file = path.substring(index);
+ 832
+ }
+ 833
+ }
+ 834
+ }
+ 835 0 if (!isAbsolute && directory != null ) {
+ 836 0 directory.insert(0, '.' );
+ 837
+ }
+ 838 0 osPath = ((device != null ) ? device + ":" : "" )
+ 839
+ + ((directory != null ) ? "[" + directory + "]" : "" )
+ 840
+ + ((file != null ) ? file : "" );
+ 841 0 return osPath;
+ 842
+ }
+ 843
+
+ 844
+
+ 845
+
+ 846
+
+ 847
+
+ 848
+
+ 849
+
+ 850
+
+ 851
+
+ 852
+
+ 853
+
+ 854
+
+ 855
+
+ 856
+
+ 857
+
+ 858
+
+ 859
+
+ 860
+
+ 861
+
+ 862
+ public File createTempFile(String prefix, String suffix, File parentDir) {
+ 863 0 return createTempFile(prefix, suffix, parentDir, false , false );
+ 864
+ }
+ 865
+
+ 866
+ private static final String NULL_PLACEHOLDER = "null" ;
+ 867
+
+ 868
+
+ 869
+
+ 870
+
+ 871
+
+ 872
+
+ 873
+
+ 874
+
+ 875
+
+ 876
+
+ 877
+
+ 878
+
+ 879
+
+ 880
+
+ 881
+
+ 882
+
+ 883
+
+ 884
+
+ 885
+
+ 886
+ public File createTempFile(String prefix, String suffix, File parentDir,
+ 887
+ boolean deleteOnExit, boolean createFile) {
+ 888 0 File result = null ;
+ 889 0 String parent = (parentDir == null )
+ 890
+ ? System.getProperty("java.io.tmpdir" )
+ 891
+ : parentDir.getPath();
+ 892 0 if (prefix == null ) {
+ 893 0 prefix = NULL_PLACEHOLDER;
+ 894
+ }
+ 895 0 if (suffix == null ) {
+ 896 0 suffix = NULL_PLACEHOLDER;
+ 897
+ }
+ 898
+
+ 899 0 if (createFile) {
+ 900
+ try {
+ 901 0 result = File.createTempFile(prefix, suffix, new File(parent));
+ 902 0 } catch (IOException e) {
+ 903 0 throw new BuildException("Could not create tempfile in "
+ 904
+ + parent, e);
+ 905 0 }
+ 906
+ } else {
+ 907 0 DecimalFormat fmt = new DecimalFormat("#####" );
+ 908 0 synchronized (rand) {
+ 909
+ do {
+ 910 0 result = new File(parent, prefix
+ 911
+ + fmt.format(rand.nextInt(Integer.MAX_VALUE)) + suffix);
+ 912 0 } while (result.exists());
+ 913 0 }
+ 914
+ }
+ 915
+
+ 916 0 if (deleteOnExit) {
+ 917 0 result.deleteOnExit();
+ 918
+ }
+ 919 0 return result;
+ 920
+ }
+ 921
+
+ 922
+
+ 923
+
+ 924
+
+ 925
+
+ 926
+
+ 927
+
+ 928
+
+ 929
+
+ 930
+
+ 931
+
+ 932
+
+ 933
+
+ 934
+
+ 935
+
+ 936
+
+ 937
+
+ 938
+
+ 939
+
+ 940
+
+ 941
+ public File createTempFile(String prefix, String suffix,
+ 942
+ File parentDir, boolean deleteOnExit) {
+ 943 0 return createTempFile(prefix, suffix, parentDir, deleteOnExit, false );
+ 944
+ }
+ 945
+
+ 946
+
+ 947
+
+ 948
+
+ 949
+
+ 950
+
+ 951
+
+ 952
+
+ 953
+
+ 954
+
+ 955
+
+ 956
+
+ 957
+
+ 958
+
+ 959
+
+ 960
+
+ 961
+
+ 962
+
+ 963
+
+ 964
+
+ 965
+
+ 966
+
+ 967
+
+ 968
+
+ 969
+
+ 970
+
+ 971
+
+ 972
+
+ 973
+
+ 974
+
+ 975
+
+ 976
+
+ 977
+
+ 978
+
+ 979
+
+ 980
+
+ 981
+
+ 982
+
+ 983
+
+ 984
+
+ 985
+ public File getParentFile(File f) {
+ 986 0 return (f == null ) ? null : f.getParentFile();
+ 987
+ }
+ 988
+
+ 989
+
+ 990
+
+ 991
+
+ 992
+
+ 993
+
+ 994
+
+ 995
+
+ 996
+
+ 997
+ public static String readFully(Reader rdr) throws IOException {
+ 998 0 return readFully(rdr, BUF_SIZE);
+ 999
+ }
+ 1000
+
+ 1001
+
+ 1002
+
+ 1003
+
+ 1004
+
+ 1005
+
+ 1006
+
+ 1007
+
+ 1008
+
+ 1009
+
+ 1010
+
+ 1011
+ public static String readFully(Reader rdr, int bufferSize)
+ 1012
+ throws IOException {
+ 1013 0 if (bufferSize <= 0) {
+ 1014 0 throw new IllegalArgumentException("Buffer size must be greater "
+ 1015
+ + "than 0" );
+ 1016
+ }
+ 1017 0 final char [] buffer = new char [bufferSize];
+ 1018 0 int bufferLength = 0;
+ 1019 0 StringBuffer textBuffer = null ;
+ 1020 0 while (bufferLength != -1) {
+ 1021 0 bufferLength = rdr.read(buffer);
+ 1022 0 if (bufferLength > 0) {
+ 1023 0 textBuffer = (textBuffer == null ) ? new StringBuffer() : textBuffer;
+ 1024 0 textBuffer.append(new String(buffer, 0, bufferLength));
+ 1025
+ }
+ 1026
+ }
+ 1027 0 return (textBuffer == null ) ? null : textBuffer.toString();
+ 1028
+ }
+ 1029
+
+ 1030
+
+ 1031
+
+ 1032
+
+ 1033
+
+ 1034
+
+ 1035
+
+ 1036
+
+ 1037
+
+ 1038
+ public static String safeReadFully(Reader reader) throws IOException {
+ 1039 0 String ret = readFully(reader);
+ 1040 0 return ret == null ? "" : ret;
+ 1041
+ }
+ 1042
+
+ 1043
+
+ 1044
+
+ 1045
+
+ 1046
+
+ 1047
+
+ 1048
+
+ 1049
+
+ 1050
+
+ 1051
+
+ 1052
+
+ 1053
+
+ 1054
+
+ 1055
+
+ 1056
+ public boolean createNewFile(File f) throws IOException {
+ 1057 0 return f.createNewFile();
+ 1058
+ }
+ 1059
+
+ 1060
+
+ 1061
+
+ 1062
+
+ 1063
+
+ 1064
+
+ 1065
+
+ 1066
+
+ 1067
+
+ 1068
+
+ 1069
+ public boolean createNewFile(File f, boolean mkdirs) throws IOException {
+ 1070 0 File parent = f.getParentFile();
+ 1071 0 if (mkdirs && !(parent.exists())) {
+ 1072 0 parent.mkdirs();
+ 1073
+ }
+ 1074 0 return f.createNewFile();
+ 1075
+ }
+ 1076
+
+ 1077
+
+ 1078
+
+ 1079
+
+ 1080
+
+ 1081
+
+ 1082
+
+ 1083
+
+ 1084
+
+ 1085
+
+ 1086
+
+ 1087
+
+ 1088
+
+ 1089
+
+ 1090
+
+ 1091
+
+ 1092
+ public boolean isSymbolicLink(File parent, String name)
+ 1093
+ throws IOException {
+ 1094 0 SymbolicLinkUtils u = SymbolicLinkUtils.getSymbolicLinkUtils();
+ 1095 0 if (parent == null ) {
+ 1096 0 return u.isSymbolicLink(name);
+ 1097
+ }
+ 1098 0 return u.isSymbolicLink(parent, name);
+ 1099
+ }
+ 1100
+
+ 1101
+
+ 1102
+
+ 1103
+
+ 1104
+
+ 1105
+
+ 1106
+
+ 1107
+
+ 1108
+
+ 1109
+
+ 1110
+
+ 1111
+
+ 1112
+ public String removeLeadingPath(File leading, File path) {
+ 1113 1 String l = normalize(leading.getAbsolutePath()).getAbsolutePath();
+ 1114 1 String p = normalize(path.getAbsolutePath()).getAbsolutePath();
+ 1115 1 if (l.equals(p)) {
+ 1116 0 return "" ;
+ 1117
+ }
+ 1118
+
+ 1119
+
+ 1120 1 if (!l.endsWith(File.separator)) {
+ 1121 1 l += File.separator;
+ 1122
+ }
+ 1123 1 return (p.startsWith(l)) ? p.substring(l.length()) : p;
+ 1124
+ }
+ 1125
+
+ 1126
+
+ 1127
+
+ 1128
+
+ 1129
+
+ 1130
+
+ 1131
+
+ 1132
+
+ 1133
+
+ 1134
+ public boolean isLeadingPath(File leading, File path) {
+ 1135 0 String l = normalize(leading.getAbsolutePath()).getAbsolutePath();
+ 1136 0 String p = normalize(path.getAbsolutePath()).getAbsolutePath();
+ 1137 0 if (l.equals(p)) {
+ 1138 0 return true ;
+ 1139
+ }
+ 1140
+
+ 1141
+
+ 1142 0 if (!l.endsWith(File.separator)) {
+ 1143 0 l += File.separator;
+ 1144
+ }
+ 1145 0 return p.startsWith(l);
+ 1146
+ }
+ 1147
+
+ 1148
+
+ 1149
+
+ 1150
+
+ 1151
+
+ 1152
+
+ 1153
+
+ 1154
+
+ 1155
+
+ 1156
+
+ 1157
+
+ 1158
+
+ 1159
+
+ 1160
+
+ 1161
+
+ 1162
+
+ 1163
+
+ 1164
+
+ 1165
+
+ 1166
+
+ 1167
+ public String toURI(String path) {
+ 1168 0 return new File(path).toURI().toASCIIString();
+ 1169
+ }
+ 1170
+
+ 1171
+
+ 1172
+
+ 1173
+
+ 1174
+
+ 1175
+
+ 1176
+
+ 1177
+
+ 1178
+
+ 1179
+
+ 1180
+
+ 1181
+
+ 1182
+
+ 1183
+
+ 1184
+ public String fromURI(String uri) {
+ 1185 0 synchronized (cacheFromUriLock) {
+ 1186 0 if (uri.equals(cacheFromUriRequest)) {
+ 1187 0 return cacheFromUriResponse;
+ 1188
+ }
+ 1189 0 String path = Locator.fromURI(uri);
+ 1190 0 String ret = isAbsolutePath(path) ? normalize(path).getAbsolutePath() : path;
+ 1191 0 cacheFromUriRequest = uri;
+ 1192 0 cacheFromUriResponse = ret;
+ 1193 0 return ret;
+ 1194 0 }
+ 1195
+ }
+ 1196
+
+ 1197
+
+ 1198
+
+ 1199
+
+ 1200
+
+ 1201
+
+ 1202
+
+ 1203
+
+ 1204
+
+ 1205
+
+ 1206
+
+ 1207
+
+ 1208
+
+ 1209
+
+ 1210
+
+ 1211
+ public boolean fileNameEquals(File f1, File f2) {
+ 1212 0 return normalize(f1.getAbsolutePath()).getAbsolutePath().equals(
+ 1213
+ normalize(f2.getAbsolutePath()).getAbsolutePath());
+ 1214
+ }
+ 1215
+
+ 1216
+
+ 1217
+
+ 1218
+
+ 1219
+
+ 1220
+
+ 1221
+ public boolean areSame(File f1, File f2) throws IOException {
+ 1222 0 if (f1 == null && f2 == null ) {
+ 1223 0 return true ;
+ 1224
+ }
+ 1225 0 if (f1 == null || f2 == null ) {
+ 1226 0 return false ;
+ 1227
+ }
+ 1228 0 File f1Normalized = normalize(f1.getAbsolutePath());
+ 1229 0 File f2Normalized = normalize(f2.getAbsolutePath());
+ 1230 0 return f1Normalized.equals(f2Normalized)
+ 1231
+ || f1Normalized.getCanonicalFile().equals(f2Normalized
+ 1232
+ .getCanonicalFile());
+ 1233
+ }
+ 1234
+
+ 1235
+
+ 1236
+
+ 1237
+
+ 1238
+
+ 1239
+
+ 1240
+
+ 1241
+
+ 1242
+
+ 1243
+
+ 1244
+
+ 1245
+
+ 1246
+
+ 1247
+
+ 1248
+
+ 1249
+
+ 1250
+
+ 1251
+
+ 1252
+
+ 1253
+
+ 1254
+
+ 1255
+
+ 1256
+
+ 1257
+
+ 1258
+
+ 1259
+
+ 1260
+
+ 1261
+
+ 1262
+
+ 1263
+
+ 1264
+
+ 1265
+
+ 1266
+
+ 1267
+
+ 1268
+
+ 1269
+
+ 1270
+
+ 1271
+
+ 1272
+
+ 1273
+
+ 1274
+
+ 1275
+
+ 1276
+
+ 1277
+
+ 1278
+
+ 1279
+
+ 1280
+
+ 1281
+
+ 1282
+
+ 1283
+
+ 1284
+
+ 1285
+
+ 1286
+
+ 1287
+ public long getFileTimestampGranularity() {
+ 1288 0 if (ON_WIN9X) {
+ 1289 0 return FAT_FILE_TIMESTAMP_GRANULARITY;
+ 1290
+ }
+ 1291 0 if (ON_WINDOWS) {
+ 1292 0 return NTFS_FILE_TIMESTAMP_GRANULARITY;
+ 1293
+ }
+ 1294 0 if (ON_DOS) {
+ 1295 0 return FAT_FILE_TIMESTAMP_GRANULARITY;
+ 1296
+ }
+ 1297 0 return UNIX_FILE_TIMESTAMP_GRANULARITY;
+ 1298
+ }
+ 1299
+
+ 1300
+
+ 1301
+
+ 1302
+
+ 1303
+
+ 1304
+
+ 1305
+
+ 1306
+
+ 1307
+
+ 1308
+
+ 1309
+
+ 1310
+
+ 1311
+
+ 1312
+
+ 1313
+
+ 1314
+
+ 1315
+
+ 1316
+
+ 1317
+
+ 1318
+
+ 1319
+
+ 1320
+ public boolean hasErrorInCase(File localFile) {
+ 1321 0 localFile = normalize(localFile.getAbsolutePath());
+ 1322 0 if (!localFile.exists()) {
+ 1323 0 return false ;
+ 1324
+ }
+ 1325 0 final String localFileName = localFile.getName();
+ 1326 0 FilenameFilter ff = new FilenameFilter() {
+ 1327
+ public boolean accept(File dir, String name) {
+ 1328 0 return name.equalsIgnoreCase(localFileName) && (!name.equals(localFileName));
+ 1329
+ }
+ 1330
+ };
+ 1331 0 String[] names = localFile.getParentFile().list(ff);
+ 1332 0 return names != null && names.length == 1;
+ 1333
+ }
+ 1334
+
+ 1335
+
+ 1336
+
+ 1337
+
+ 1338
+
+ 1339
+
+ 1340
+
+ 1341
+
+ 1342
+
+ 1343
+
+ 1344
+
+ 1345
+ public boolean isUpToDate(File source, File dest, long granularity) {
+ 1346
+
+ 1347 0 if (!dest.exists()) {
+ 1348
+
+ 1349 0 return false ;
+ 1350
+ }
+ 1351 0 long sourceTime = source.lastModified();
+ 1352 0 long destTime = dest.lastModified();
+ 1353 0 return isUpToDate(sourceTime, destTime, granularity);
+ 1354
+ }
+ 1355
+
+ 1356
+
+ 1357
+
+ 1358
+
+ 1359
+
+ 1360
+
+ 1361
+
+ 1362
+
+ 1363
+
+ 1364
+ public boolean isUpToDate(File source, File dest) {
+ 1365 0 return isUpToDate(source, dest, getFileTimestampGranularity());
+ 1366
+ }
+ 1367
+
+ 1368
+
+ 1369
+
+ 1370
+
+ 1371
+
+ 1372
+
+ 1373
+
+ 1374
+
+ 1375
+
+ 1376
+ public boolean isUpToDate(long sourceTime, long destTime, long granularity) {
+ 1377 0 return destTime != -1 && destTime >= sourceTime + granularity;
+ 1378
+ }
+ 1379
+
+ 1380
+
+ 1381
+
+ 1382
+
+ 1383
+
+ 1384
+
+ 1385
+
+ 1386
+
+ 1387
+ public boolean isUpToDate(long sourceTime, long destTime) {
+ 1388 0 return isUpToDate(sourceTime, destTime, getFileTimestampGranularity());
+ 1389
+ }
+ 1390
+
+ 1391
+
+ 1392
+
+ 1393
+
+ 1394
+
+ 1395
+
+ 1396
+
+ 1397
+ public static void close(Writer device) {
+ 1398 0 if (null != device) {
+ 1399
+ try {
+ 1400 0 device.close();
+ 1401 0 } catch (IOException e) {
+ 1402
+
+ 1403 0 }
+ 1404
+ }
+ 1405 0 }
+ 1406
+
+ 1407
+
+ 1408
+
+ 1409
+
+ 1410
+
+ 1411
+
+ 1412
+
+ 1413
+ public static void close(Reader device) {
+ 1414 0 if (null != device) {
+ 1415
+ try {
+ 1416 0 device.close();
+ 1417 0 } catch (IOException e) {
+ 1418
+
+ 1419 0 }
+ 1420
+ }
+ 1421 0 }
+ 1422
+
+ 1423
+
+ 1424
+
+ 1425
+
+ 1426
+
+ 1427
+
+ 1428
+
+ 1429
+ public static void close(OutputStream device) {
+ 1430 0 if (null != device) {
+ 1431
+ try {
+ 1432 0 device.close();
+ 1433 0 } catch (IOException e) {
+ 1434
+
+ 1435 0 }
+ 1436
+ }
+ 1437 0 }
+ 1438
+
+ 1439
+
+ 1440
+
+ 1441
+
+ 1442
+
+ 1443
+
+ 1444
+
+ 1445
+ public static void close(InputStream device) {
+ 1446 0 if (null != device) {
+ 1447
+ try {
+ 1448 0 device.close();
+ 1449 0 } catch (IOException e) {
+ 1450
+
+ 1451 0 }
+ 1452
+ }
+ 1453 0 }
+ 1454
+
+ 1455
+
+ 1456
+
+ 1457
+
+ 1458
+
+ 1459
+
+ 1460
+
+ 1461
+
+ 1462
+ public static void close(Channel device) {
+ 1463 0 if (null != device) {
+ 1464
+ try {
+ 1465 0 device.close();
+ 1466 0 } catch (IOException e) {
+ 1467
+
+ 1468 0 }
+ 1469
+ }
+ 1470 0 }
+ 1471
+
+ 1472
+
+ 1473
+
+ 1474
+
+ 1475
+
+ 1476
+
+ 1477
+
+ 1478
+ public static void close(URLConnection conn) {
+ 1479 0 if (conn != null ) {
+ 1480
+ try {
+ 1481 0 if (conn instanceof JarURLConnection) {
+ 1482 0 JarURLConnection juc = (JarURLConnection) conn;
+ 1483 0 JarFile jf = juc.getJarFile();
+ 1484 0 jf.close();
+ 1485 0 jf = null ;
+ 1486 0 } else if (conn instanceof HttpURLConnection) {
+ 1487 0 ((HttpURLConnection) conn).disconnect();
+ 1488
+ }
+ 1489 0 } catch (IOException exc) {
+ 1490
+
+ 1491 0 }
+ 1492
+ }
+ 1493 0 }
+ 1494
+
+ 1495
+
+ 1496
+
+ 1497
+
+ 1498
+
+ 1499
+
+ 1500
+ public static void delete(File file) {
+ 1501 0 if (file != null ) {
+ 1502 0 file.delete();
+ 1503
+ }
+ 1504 0 }
+ 1505
+
+ 1506
+
+ 1507
+
+ 1508
+
+ 1509
+
+ 1510
+
+ 1511
+
+ 1512
+
+ 1513
+ public boolean tryHardToDelete(File f) {
+ 1514 0 return tryHardToDelete(f, ON_WINDOWS);
+ 1515
+ }
+ 1516
+
+ 1517
+
+ 1518
+
+ 1519
+
+ 1520
+
+ 1521
+
+ 1522
+
+ 1523
+ public boolean tryHardToDelete(File f, boolean runGC) {
+ 1524 0 if (!f.delete()) {
+ 1525 0 if (runGC) {
+ 1526 0 System.gc();
+ 1527
+ }
+ 1528
+ try {
+ 1529 0 Thread.sleep(DELETE_RETRY_SLEEP_MILLIS);
+ 1530 0 } catch (InterruptedException ex) {
+ 1531
+
+ 1532 0 }
+ 1533 0 return f.delete();
+ 1534
+ }
+ 1535 0 return true ;
+ 1536
+ }
+ 1537
+
+ 1538
+
+ 1539
+
+ 1540
+
+ 1541
+
+ 1542
+
+ 1543
+
+ 1544
+
+ 1545
+
+ 1546
+
+ 1547
+
+ 1548
+
+ 1549
+
+ 1550
+
+ 1551
+
+ 1552
+
+ 1553
+ public static String getRelativePath(File fromFile, File toFile) throws Exception {
+ 1554 0 String fromPath = fromFile.getCanonicalPath();
+ 1555 0 String toPath = toFile.getCanonicalPath();
+ 1556
+
+ 1557
+
+ 1558 0 String[] fromPathStack = getPathStack(fromPath);
+ 1559 0 String[] toPathStack = getPathStack(toPath);
+ 1560
+
+ 1561 0 if (0 < toPathStack.length && 0 < fromPathStack.length) {
+ 1562 0 if (!fromPathStack[0].equals(toPathStack[0])) {
+ 1563
+
+ 1564
+
+ 1565 0 return getPath(Arrays.asList(toPathStack));
+ 1566
+ }
+ 1567
+ } else {
+ 1568
+
+ 1569 0 return getPath(Arrays.asList(toPathStack));
+ 1570
+ }
+ 1571
+
+ 1572 0 int minLength = Math.min(fromPathStack.length, toPathStack.length);
+ 1573 0 int same = 1;
+ 1574
+
+ 1575
+
+ 1576
+ for (;
+ 1577 0 same < minLength && fromPathStack[same].equals(toPathStack[same]);
+ 1578 0 same++) {
+ 1579
+
+ 1580
+ }
+ 1581
+
+ 1582 0 List relativePathStack = new ArrayList();
+ 1583
+
+ 1584
+
+ 1585
+
+ 1586 0 for (int i = same; i < fromPathStack.length; i++) {
+ 1587 0 relativePathStack.add(".." );
+ 1588
+ }
+ 1589
+
+ 1590
+
+ 1591 0 for (int i = same; i < toPathStack.length; i++) {
+ 1592 0 relativePathStack.add(toPathStack[i]);
+ 1593
+ }
+ 1594
+
+ 1595 0 return getPath(relativePathStack);
+ 1596
+ }
+ 1597
+
+ 1598
+
+ 1599
+
+ 1600
+
+ 1601
+
+ 1602
+
+ 1603
+
+ 1604
+
+ 1605
+
+ 1606
+ public static String[] getPathStack(String path) {
+ 1607 0 String normalizedPath = path.replace(File.separatorChar, '/' );
+ 1608
+
+ 1609 0 return normalizedPath.split("/" );
+ 1610
+ }
+ 1611
+
+ 1612
+
+ 1613
+
+ 1614
+
+ 1615
+
+ 1616
+
+ 1617
+
+ 1618
+
+ 1619
+
+ 1620
+ public static String getPath(List pathStack) {
+ 1621
+
+ 1622 0 return getPath(pathStack, '/' );
+ 1623
+ }
+ 1624
+
+ 1625
+
+ 1626
+
+ 1627
+
+ 1628
+
+ 1629
+
+ 1630
+
+ 1631
+
+ 1632
+
+ 1633
+
+ 1634
+ public static String getPath(final List pathStack, final char separatorChar) {
+ 1635 0 final StringBuffer buffer = new StringBuffer();
+ 1636
+
+ 1637 0 final Iterator iter = pathStack.iterator();
+ 1638 0 if (iter.hasNext()) {
+ 1639 0 buffer.append(iter.next());
+ 1640
+ }
+ 1641 0 while (iter.hasNext()) {
+ 1642 0 buffer.append(separatorChar);
+ 1643 0 buffer.append(iter.next());
+ 1644
+ }
+ 1645 0 return buffer.toString();
+ 1646
+ }
+ 1647
+
+ 1648
+
+ 1649
+
+ 1650
+
+ 1651
+
+ 1652
+
+ 1653
+
+ 1654
+ public String getDefaultEncoding() {
+ 1655 0 InputStreamReader is = new InputStreamReader(
+ 1656
+ new InputStream() {
+ 1657
+ public int read() {
+ 1658 0 return -1;
+ 1659
+ }
+ 1660
+ });
+ 1661
+ try {
+ 1662 0 return is.getEncoding();
+ 1663
+ } finally {
+ 1664 0 close(is);
+ 1665
+ }
+ 1666
+ }
+ 1667
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils.html
new file mode 100644
index 000000000..b4576f59a
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils.html
@@ -0,0 +1,591 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.util;
+ 19
+
+ 20
+ import java.io.File;
+ 21
+ import java.io.FilenameFilter;
+ 22
+ import java.io.IOException;
+ 23
+
+ 24
+
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+ public class SymbolicLinkUtils {
+ 33
+
+ 34 1 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39 1 private static final SymbolicLinkUtils PRIMARY_INSTANCE
+ 40
+ = new SymbolicLinkUtils();
+ 41
+
+ 42
+
+ 43
+
+ 44
+
+ 45
+
+ 46
+
+ 47
+ public static SymbolicLinkUtils getSymbolicLinkUtils() {
+ 48
+
+ 49
+
+ 50 2 return PRIMARY_INSTANCE;
+ 51
+ }
+ 52
+
+ 53
+
+ 54
+
+ 55
+
+ 56
+ protected SymbolicLinkUtils() {
+ 57
+ }
+ 58
+
+ 59
+
+ 60
+
+ 61
+
+ 62
+
+ 63
+
+ 64
+
+ 65
+
+ 66
+
+ 67
+
+ 68
+
+ 69
+
+ 70
+
+ 71
+ public boolean isSymbolicLink(File file) throws IOException {
+ 72 0 return isSymbolicLink(file.getParentFile(), file.getName());
+ 73
+ }
+ 74
+
+ 75
+
+ 76
+
+ 77
+
+ 78
+
+ 79
+
+ 80
+
+ 81
+
+ 82
+
+ 83
+
+ 84
+
+ 85
+
+ 86
+
+ 87
+ public boolean isSymbolicLink(String name) throws IOException {
+ 88 0 return isSymbolicLink(new File(name));
+ 89
+ }
+ 90
+
+ 91
+
+ 92
+
+ 93
+
+ 94
+
+ 95
+
+ 96
+
+ 97
+
+ 98
+
+ 99
+
+ 100
+
+ 101
+
+ 102
+
+ 103
+
+ 104
+ public boolean isSymbolicLink(File parent, String name)
+ 105
+ throws IOException {
+ 106 0 File toTest = parent != null
+ 107
+ ? new File(parent.getCanonicalPath(), name)
+ 108
+ : new File(name);
+ 109 0 return !toTest.getAbsolutePath().equals(toTest.getCanonicalPath());
+ 110
+ }
+ 111
+
+ 112
+
+ 113
+
+ 114
+
+ 115
+
+ 116
+
+ 117
+
+ 118
+
+ 119
+
+ 120
+
+ 121
+
+ 122
+
+ 123
+
+ 124
+
+ 125
+
+ 126
+
+ 127
+
+ 128
+ public boolean isDanglingSymbolicLink(String name) throws IOException {
+ 129 0 return isDanglingSymbolicLink(new File(name));
+ 130
+ }
+ 131
+
+ 132
+
+ 133
+
+ 134
+
+ 135
+
+ 136
+
+ 137
+
+ 138
+
+ 139
+
+ 140
+
+ 141
+
+ 142
+
+ 143
+
+ 144
+
+ 145
+
+ 146
+
+ 147
+
+ 148
+ public boolean isDanglingSymbolicLink(File file) throws IOException {
+ 149 0 return isDanglingSymbolicLink(file.getParentFile(), file.getName());
+ 150
+ }
+ 151
+
+ 152
+
+ 153
+
+ 154
+
+ 155
+
+ 156
+
+ 157
+
+ 158
+
+ 159
+
+ 160
+
+ 161
+
+ 162
+
+ 163
+
+ 164
+
+ 165
+
+ 166
+
+ 167
+
+ 168
+
+ 169
+ public boolean isDanglingSymbolicLink(File parent, String name)
+ 170
+ throws IOException {
+ 171 0 File f = new File(parent, name);
+ 172 0 if (!f.exists()) {
+ 173 0 final String localName = f.getName();
+ 174 0 String[] c = parent.list(new FilenameFilter() {
+ 175
+ public boolean accept(File d, String n) {
+ 176 0 return localName.equals(n);
+ 177
+ }
+ 178
+ });
+ 179 0 return c != null && c.length > 0;
+ 180
+ }
+ 181 0 return false ;
+ 182
+ }
+ 183
+
+ 184
+
+ 185
+
+ 186
+
+ 187
+
+ 188
+
+ 189
+
+ 190
+
+ 191
+
+ 192
+
+ 193
+
+ 194
+
+ 195
+
+ 196
+
+ 197
+
+ 198
+
+ 199
+
+ 200
+
+ 201
+
+ 202
+
+ 203
+
+ 204
+
+ 205
+
+ 206
+
+ 207
+
+ 208
+
+ 209
+
+ 210
+
+ 211
+
+ 212
+
+ 213
+
+ 214
+
+ 215
+
+ 216
+
+ 217
+
+ 218
+
+ 219
+
+ 220
+
+ 221
+
+ 222
+
+ 223
+
+ 224
+
+ 225
+
+ 226
+
+ 227
+
+ 228
+
+ 229
+
+ 230
+
+ 231
+
+ 232
+
+ 233
+
+ 234
+
+ 235
+
+ 236
+
+ 237
+
+ 238
+
+ 239
+
+ 240
+
+ 241
+
+ 242
+
+ 243
+
+ 244
+
+ 245
+
+ 246
+
+ 247
+
+ 248
+
+ 249
+
+ 250
+
+ 251
+
+ 252
+
+ 253
+
+ 254
+
+ 255
+
+ 256
+
+ 257
+
+ 258
+
+ 259
+
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+
+ 266
+
+ 267
+
+ 268
+
+ 269
+
+ 270
+
+ 271
+
+ 272
+
+ 273
+
+ 274
+
+ 275
+
+ 276
+
+ 277
+
+ 278
+
+ 279
+
+ 280
+
+ 281
+
+ 282
+
+ 283
+
+ 284
+
+ 285
+
+ 286
+
+ 287
+
+ 288
+
+ 289
+
+ 290
+
+ 291
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet.html
new file mode 100644
index 000000000..93283d50c
--- /dev/null
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet.html
@@ -0,0 +1,403 @@
+
+
+
+
+Coverage Report
+
+
+
+
+Coverage Report - org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet
+
+
+
+
+ 1
+
+ 2
+
+ 3
+
+ 4
+
+ 5
+
+ 6
+
+ 7
+
+ 8
+
+ 9
+
+ 10
+
+ 11
+
+ 12
+
+ 13
+
+ 14
+
+ 15
+
+ 16
+
+ 17
+
+ 18
+ package org.owasp.dependencycheck.org.apache.tools.ant.util;
+ 19
+
+ 20
+ import java.util.Collection;
+ 21
+ import java.util.HashSet;
+ 22
+ import java.util.LinkedList;
+ 23
+ import java.util.Set;
+ 24
+ import java.util.Vector;
+ 25
+
+ 26
+
+ 27
+
+ 28
+
+ 29
+
+ 30
+
+ 31
+
+ 32
+
+ 33
+
+ 34
+
+ 35
+
+ 36
+
+ 37
+
+ 38
+
+ 39
+
+ 40
+ public final class VectorSet<E> extends Vector<E> {
+ 41
+ private static final long serialVersionUID = 1L;
+ 42
+
+ 43 8 private final HashSet<E> set = new HashSet<E>();
+ 44
+
+ 45 16 public VectorSet() { super (); }
+ 46
+
+ 47 0 public VectorSet(int initialCapacity) { super (initialCapacity); }
+ 48
+
+ 49
+ public VectorSet(int initialCapacity, int capacityIncrement) {
+ 50 0 super (initialCapacity, capacityIncrement);
+ 51 0 }
+ 52
+
+ 53 0 public VectorSet(Collection<? extends E> c) {
+ 54 0 if (c != null ) {
+ 55 0 for (E e : c) {
+ 56 0 add(e);
+ 57 0 }
+ 58
+ }
+ 59 0 }
+ 60
+
+ 61
+ public synchronized boolean add(E o) {
+ 62 19 if (!set.contains(o)) {
+ 63 19 doAdd(size(), o);
+ 64 19 return true ;
+ 65
+ }
+ 66 0 return false ;
+ 67
+ }
+ 68
+
+ 69
+
+ 70
+
+ 71
+
+ 72
+
+ 73
+ public void add(int index, E o) {
+ 74 0 doAdd(index, o);
+ 75 0 }
+ 76
+
+ 77
+ private synchronized void doAdd(int index, E o) {
+ 78
+
+ 79
+
+ 80 20 if (set.add(o)) {
+ 81 20 int count = size();
+ 82 20 ensureCapacity(count + 1);
+ 83 20 if (index != count) {
+ 84 0 System.arraycopy(elementData, index, elementData, index + 1,
+ 85
+ count - index);
+ 86
+ }
+ 87 20 elementData[index] = o;
+ 88 20 elementCount++;
+ 89
+ }
+ 90 20 }
+ 91
+
+ 92
+ public synchronized void addElement(E o) {
+ 93 1 doAdd(size(), o);
+ 94 1 }
+ 95
+
+ 96
+ public synchronized boolean addAll(Collection<? extends E> c) {
+ 97 0 boolean changed = false ;
+ 98 0 for (E e : c) {
+ 99 0 changed |= add(e);
+ 100 0 }
+ 101 0 return changed;
+ 102
+ }
+ 103
+
+ 104
+
+ 105
+
+ 106
+
+ 107
+
+ 108
+ public synchronized boolean addAll(int index, Collection<? extends E> c) {
+ 109 0 LinkedList toAdd = new LinkedList();
+ 110 0 for (E e : c) {
+ 111 0 if (set.add(e)) {
+ 112 0 toAdd.add(e);
+ 113
+ }
+ 114 0 }
+ 115 0 if (toAdd.isEmpty()) {
+ 116 0 return false ;
+ 117
+ }
+ 118 0 int count = size();
+ 119 0 ensureCapacity(count + toAdd.size());
+ 120 0 if (index != count) {
+ 121 0 System.arraycopy(elementData, index, elementData, index + toAdd.size(),
+ 122
+ count - index);
+ 123
+ }
+ 124 0 for (Object o : toAdd) {
+ 125 0 elementData[index++] = o;
+ 126 0 }
+ 127 0 elementCount += toAdd.size();
+ 128 0 return true ;
+ 129
+ }
+ 130
+
+ 131
+ public synchronized void clear() {
+ 132 0 super .clear();
+ 133 0 set.clear();
+ 134 0 }
+ 135
+
+ 136
+ public Object clone() {
+ 137
+ @SuppressWarnings("unchecked" )
+ 138 0 final VectorSet<E> vs = (VectorSet<E>) super .clone();
+ 139 0 vs.set.addAll(set);
+ 140 0 return vs;
+ 141
+ }
+ 142
+
+ 143
+ public synchronized boolean contains(Object o) {
+ 144 57 return set.contains(o);
+ 145
+ }
+ 146
+
+ 147
+ public synchronized boolean containsAll(Collection<?> c) {
+ 148 0 return set.containsAll(c);
+ 149
+ }
+ 150
+
+ 151
+ public void insertElementAt(E o, int index) {
+ 152 0 doAdd(index, o);
+ 153 0 }
+ 154
+
+ 155
+ public synchronized E remove(int index) {
+ 156 0 E o = get(index);
+ 157 0 remove(o);
+ 158 0 return o;
+ 159
+ }
+ 160
+
+ 161
+ public boolean remove(Object o) {
+ 162 0 return doRemove(o);
+ 163
+ }
+ 164
+
+ 165
+ private synchronized boolean doRemove(Object o) {
+ 166
+
+ 167
+
+ 168 0 if (set.remove(o)) {
+ 169 0 int index = indexOf(o);
+ 170 0 if (index < elementData.length - 1) {
+ 171 0 System.arraycopy(elementData, index + 1, elementData, index,
+ 172
+ elementData.length - index - 1);
+ 173
+ }
+ 174 0 elementCount--;
+ 175 0 return true ;
+ 176
+ }
+ 177 0 return false ;
+ 178
+ }
+ 179
+
+ 180
+ public synchronized boolean removeAll(Collection<?> c) {
+ 181 0 boolean changed = false ;
+ 182 0 for (Object o : c) {
+ 183 0 changed |= remove(o);
+ 184 0 }
+ 185 0 return changed;
+ 186
+ }
+ 187
+
+ 188
+ public synchronized void removeAllElements() {
+ 189 0 set.clear();
+ 190 0 super .removeAllElements();
+ 191 0 }
+ 192
+
+ 193
+ public boolean removeElement(Object o) {
+ 194 0 return doRemove(o);
+ 195
+ }
+ 196
+
+ 197
+ public synchronized void removeElementAt(int index) {
+ 198 0 remove(get(index));
+ 199 0 }
+ 200
+
+ 201
+ public synchronized void removeRange(final int fromIndex, int toIndex) {
+ 202 0 while (toIndex > fromIndex) {
+ 203 0 remove(--toIndex);
+ 204
+ }
+ 205 0 }
+ 206
+
+ 207
+ public synchronized boolean retainAll(Collection<?> c) {
+ 208 0 if (!(c instanceof Set)) {
+ 209 0 c = new HashSet<Object>(c);
+ 210
+ }
+ 211 0 LinkedList<E> l = new LinkedList<E>();
+ 212 0 for (E o : this ) {
+ 213 0 if (!c.contains(o)) {
+ 214 0 l.addLast(o);
+ 215
+ }
+ 216 0 }
+ 217 0 if (!l.isEmpty()) {
+ 218 0 removeAll(l);
+ 219 0 return true ;
+ 220
+ }
+ 221 0 return false ;
+ 222
+ }
+ 223
+
+ 224
+ public synchronized E set(int index, E o) {
+ 225 0 E orig = get(index);
+ 226 0 if (set.add(o)) {
+ 227 0 elementData[index] = o;
+ 228 0 set.remove(orig);
+ 229
+ } else {
+ 230 0 int oldIndexOfO = indexOf(o);
+ 231 0 remove(o);
+ 232 0 remove(orig);
+ 233 0 add(oldIndexOfO > index ? index : index - 1, o);
+ 234
+ }
+ 235 0 return orig;
+ 236
+ }
+ 237
+
+ 238
+ public void setElementAt(E o, int index) {
+ 239 0 set(index, o);
+ 240 0 }
+ 241
+
+ 242
+ }
+
+
+
+
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Checksum.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Checksum.html
index 6cb29a24a..79f84b829 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Checksum.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Checksum.html
@@ -286,6 +286,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
index aa0d4937f..63c25a6ce 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.DownloadFailedException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Downloader.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Downloader.html
index ed797b17f..cb564678d 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Downloader.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Downloader.html
@@ -337,6 +337,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
index 02b187e55..035a04c78 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.ExtractionException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.FileUtils.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
index fe97cb5cb..83e05fcf6 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.FileUtils.html
@@ -167,7 +167,7 @@
78 3 if (!org.apache.commons.io.FileUtils.deleteQuietly(file)) {
79 0 success = false ;
80 0 final String msg = String.format("Failed to delete file: %s; attempting to delete on exit." , file.getPath());
- 81 0 LOGGER.log(Level.FINE, msg);
+ 81 0 LOGGER.log(Level.INFO, msg);
82 0 file.deleteOnExit();
83
}
@@ -302,6 +302,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
index 232da8968..114c86725 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.InvalidSettingException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogFilter.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
index 7fca9f696..133d2abc4 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogFilter.html
@@ -101,6 +101,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogUtils.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogUtils.html
index e69d3f6d2..1451d597f 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogUtils.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.LogUtils.html
@@ -187,6 +187,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Settings.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Settings.html
index 802671ae9..1b20d88dd 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Settings.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.Settings.html
@@ -401,172 +401,174 @@
191
192
-
+
193
194
- public static final String ANALYZER_ASSEMBLY_MONO_PATH = "analyzer.assembly.mono.path" ;
+ public static final String ANALYZER_CENTRAL_ENABLED = "analyzer.central.enabled" ;
195
196
-
+
197
198
- public static final String ADDITIONAL_ZIP_EXTENSIONS = "extensions.zip" ;
+ public static final String ANALYZER_CENTRAL_URL = "analyzer.central.url" ;
199
200
-
+
201
202
- public static final String SKIP_TEST_SCOPE = "skip.test.scope" ;
+ public static final String ANALYZER_ASSEMBLY_MONO_PATH = "analyzer.assembly.mono.path" ;
203
204
-
+
205
206
- public static final String SKIP_RUNTIME_SCOPE = "skip.runtime.scope" ;
+ public static final String ADDITIONAL_ZIP_EXTENSIONS = "extensions.zip" ;
207
208
-
+
209
210
- public static final String SKIP_PROVIDED_SCOPE = "skip.provided.scope" ;
+ public static final String SKIP_TEST_SCOPE = "skip.test.scope" ;
211
-
+
212
-
+
213
-
+
214
-
+ public static final String SKIP_RUNTIME_SCOPE = "skip.runtime.scope" ;
215
- public static final String VFEED_DATA_FILE = "vfeed.data_file" ;
+
216
-
+
217
-
+
218
-
+ public static final String SKIP_PROVIDED_SCOPE = "skip.provided.scope" ;
219
- public static final String VFEED_CONNECTION_STRING = "vfeed.connection_string" ;
- 220
+ 220
+
221
-
+
222
-
+
223
-
+ public static final String VFEED_DATA_FILE = "vfeed.data_file" ;
224
- public static final String VFEED_DOWNLOAD_URL = "vfeed.download_url" ;
- 225
+ 225
+
226
-
- 227
+ 227
+ public static final String VFEED_CONNECTION_STRING = "vfeed.connection_string" ;
228
- public static final String VFEED_DOWNLOAD_FILE = "vfeed.download_file" ;
+
229
230
-
+
231
232
- public static final String VFEED_UPDATE_STATUS = "vfeed.update_status" ;
+ public static final String VFEED_DOWNLOAD_URL = "vfeed.download_url" ;
233
- }
+
234
-
+
235
-
+
236
-
+ public static final String VFEED_DOWNLOAD_FILE = "vfeed.download_file" ;
237
-
+
238
-
- 239 1 private static final Logger LOGGER = Logger.getLogger(Settings.class .getName());
+
+ 239
+
240
-
+ public static final String VFEED_UPDATE_STATUS = "vfeed.update_status" ;
241
-
+ }
242
-
+
243
- private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
+
244
245
-
+
246
- 247 1 private static ThreadLocal<Settings> localSettings = new ThreadLocal();
+ 247 1 private static final Logger LOGGER = Logger.getLogger(Settings.class .getName());
248
249
-
+
250
- 251 2 private Properties props = null ;
+ 251
+ private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
252
-
+
253
-
+
254
-
- 255
-
+
+ 255 1 private static ThreadLocal<Settings> localSettings = new ThreadLocal();
256
-
- 257
-
- 258 2 private Settings(String propertiesFilePath) {
- 259 2 InputStream in = null ;
- 260 2 props = new Properties();
- 261
- try {
- 262 2 in = this .getClass().getClassLoader().getResourceAsStream(propertiesFilePath);
- 263 2 props.load(in);
- 264 0 } catch (IOException ex) {
- 265 0 LOGGER.log(Level.SEVERE, "Unable to load default settings." );
- 266 0 LOGGER.log(Level.FINE, null , ex);
- 267
- } finally {
- 268 2 if (in != null ) {
- 269
- try {
- 270 2 in.close();
- 271 0 } catch (IOException ex) {
- 272 0 LOGGER.log(Level.FINEST, null , ex);
- 273 2 }
- 274
- }
- 275
- }
- 276 2 logProperties("Properties loaded" , props);
- 277 2 }
- 278
-
- 279
- 280
-
- 281
-
- 282
+ 257
+
+ 258
+ 259 2 private Properties props = null ;
+ 260
+
+ 261
+
+ 262
+
+ 263
+
+ 264
+
+ 265
+
+ 266 2 private Settings(String propertiesFilePath) {
+ 267 2 InputStream in = null ;
+ 268 2 props = new Properties();
+ 269
+ try {
+ 270 2 in = this .getClass().getClassLoader().getResourceAsStream(propertiesFilePath);
+ 271 2 props.load(in);
+ 272 0 } catch (IOException ex) {
+ 273 0 LOGGER.log(Level.SEVERE, "Unable to load default settings." );
+ 274 0 LOGGER.log(Level.FINE, null , ex);
+ 275
+ } finally {
+ 276 2 if (in != null ) {
+ 277
+ try {
+ 278 2 in.close();
+ 279 0 } catch (IOException ex) {
+ 280 0 LOGGER.log(Level.FINEST, null , ex);
+ 281 2 }
+ 282
+ }
283
- public static void initialize() {
- 284 2 localSettings.set(new Settings(PROPERTIES_FILE));
+ }
+ 284 2 logProperties("Properties loaded" , props);
285 2 }
286
@@ -577,28 +579,28 @@
289
290
-
- 291
-
- 292
- 293
- public static void initialize(String propertiesFilePath) {
- 294 0 localSettings.set(new Settings(propertiesFilePath));
- 295 0 }
- 296
+ 291
+ public static void initialize() {
+ 292 2 localSettings.set(new Settings(PROPERTIES_FILE));
+ 293 2 }
+ 294
- 297
+ 295
+ 296
+
+ 297
+
298
-
- 299
+ 299
+
300
301
- public static void cleanup() {
- 302 0 cleanup(true );
+ public static void initialize(String propertiesFilePath) {
+ 302 0 localSettings.set(new Settings(propertiesFilePath));
303 0 }
304
@@ -609,765 +611,779 @@
307
308
-
+
309
-
- 310
- public static void cleanup(boolean deleteTemporary) {
- 311 2 if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
- 312 2 FileUtils.delete(tempDirectory);
+ public static void cleanup() {
+ 310 0 cleanup(true );
+ 311 0 }
+ 312
+
313
- }
+
314
- try {
- 315 2 localSettings.remove();
- 316 0 } catch (Throwable ex) {
- 317 0 LOGGER.log(Level.FINE, "Error cleaning up Settings" , ex);
- 318 2 }
- 319 2 }
- 320
-
+
+ 315
+
+ 316
+
+ 317
+
+ 318
+ public static void cleanup(boolean deleteTemporary) {
+ 319 2 if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
+ 320 2 FileUtils.delete(tempDirectory);
321
-
+ }
322
-
- 323
-
- 324
-
- 325
-
- 326
- public static Settings getInstance() {
- 327 0 return localSettings.get();
+ try {
+ 323 2 localSettings.remove();
+ 324 0 } catch (Throwable ex) {
+ 325 0 LOGGER.log(Level.FINE, "Error cleaning up Settings" , ex);
+ 326 2 }
+ 327 2 }
328
- }
+
329
-
+
330
-
+
331
-
+
332
-
+
333
-
+
334
-
- 335
- public static void setInstance(Settings instance) {
- 336 0 localSettings.set(instance);
- 337 0 }
- 338
-
- 339
-
- 340
-
- 341
-
- 342
-
- 343
-
- 344
-
- 345
- private static void logProperties(String header, Properties properties) {
- 346 3 if (LOGGER.isLoggable(Level.FINE)) {
- 347 0 final StringWriter sw = new StringWriter();
- 348 0 PrintWriter pw = null ;
- 349
- try {
- 350 0 pw = new PrintWriter(sw);
- 351 0 pw.format("%s:%n%n" , header);
- 352 0 final Enumeration e = properties.propertyNames();
- 353 0 while (e.hasMoreElements()) {
- 354 0 final String key = (String) e.nextElement();
- 355 0 if (key.contains("password" )) {
- 356 0 pw.format("%s='*****'%n" , key);
- 357
- } else {
- 358 0 final String value = properties.getProperty(key);
- 359 0 if (value != null ) {
- 360 0 pw.format("%s='%s'%n" , key, value);
- 361
- }
- 362
- }
- 363 0 }
- 364 0 pw.flush();
- 365 0 LOGGER.fine(sw.toString());
- 366
- } finally {
- 367 0 if (pw != null ) {
- 368 0 pw.close();
- 369
- }
- 370
- }
- 371
-
- 372
- }
- 373 3 }
- 374
-
- 375
-
- 376
-
- 377
-
- 378
-
- 379
-
- 380
-
- 381
- public static void setString(String key, String value) {
- 382 5 localSettings.get().props.setProperty(key, value);
- 383 5 if (LOGGER.isLoggable(Level.FINE)) {
- 384 0 LOGGER.fine(String.format("Setting: %s='%s'" , key, value));
- 385
- }
- 386 5 }
- 387
-
- 388
-
- 389
-
- 390
-
- 391
-
- 392
-
- 393
-
- 394
- public static void setBoolean(String key, boolean value) {
- 395 0 if (value) {
- 396 0 localSettings.get().props.setProperty(key, Boolean.TRUE.toString());
- 397
- } else {
- 398 0 localSettings.get().props.setProperty(key, Boolean.FALSE.toString());
- 399
- }
- 400 0 if (LOGGER.isLoggable(Level.FINE)) {
- 401 0 LOGGER.fine(String.format("Setting: %s='%b'" , key, value));
- 402
- }
- 403 0 }
- 404
-
- 405
-
- 406
-
- 407
-
- 408
-
- 409
-
- 410
-
- 411
-
- 412
-
- 413
-
- 414
- public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
- 415 0 FileInputStream fis = null ;
- 416
- try {
- 417 0 fis = new FileInputStream(filePath);
- 418 0 mergeProperties(fis);
- 419
- } finally {
- 420 0 if (fis != null ) {
- 421
- try {
- 422 0 fis.close();
- 423 0 } catch (IOException ex) {
- 424 0 LOGGER.log(Level.FINEST, "close error" , ex);
- 425 0 }
- 426
- }
- 427
- }
- 428 0 }
- 429
-
- 430
-
- 431
-
- 432
-
- 433
-
- 434
-
- 435
-
- 436
-
- 437
-
- 438
-
- 439
- public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
- 440 1 FileInputStream fis = null ;
- 441
- try {
- 442 1 fis = new FileInputStream(filePath);
- 443 1 mergeProperties(fis);
- 444
- } finally {
- 445 1 if (fis != null ) {
- 446
- try {
- 447 1 fis.close();
- 448 0 } catch (IOException ex) {
- 449 0 LOGGER.log(Level.FINEST, "close error" , ex);
- 450 1 }
- 451
- }
- 452
- }
- 453 1 }
- 454
-
- 455
-
- 456
-
- 457
-
- 458
-
- 459
-
- 460
-
- 461
-
- 462
-
- 463
- public static void mergeProperties(InputStream stream) throws IOException {
- 464 1 localSettings.get().props.load(stream);
- 465 1 logProperties("Properties updated via merge" , localSettings.get().props);
- 466 1 }
- 467
-
- 468
-
- 469
-
- 470
-
- 471
-
- 472
-
- 473
-
- 474
-
- 475
-
- 476
- public static File getFile(String key) {
- 477 0 final String file = getString(key);
- 478 0 if (file == null ) {
- 479 0 return null ;
- 480
- }
- 481 0 return new File(file);
- 482
+ public static Settings getInstance() {
+ 335 0 return localSettings.get();
+ 336
}
- 483
+ 337
- 484
+ 338
- 485
-
- 486
-
- 487
-
- 488
+ 339
+
+ 340
- 489
-
- 490
-
- 491
-
- 492
-
- 493
-
- 494
-
- 495
+ 341
+
+ 342
- 496
- protected static File getDataFile(String key) {
- 497 3 final String file = getString(key);
- 498 3 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - file: '%s'" , file));
- 499 3 if (file == null ) {
- 500 0 return null ;
- 501
+ 343
+ public static void setInstance(Settings instance) {
+ 344 0 localSettings.set(instance);
+ 345 0 }
+ 346
+
+ 347
+
+ 348
+
+ 349
+
+ 350
+
+ 351
+
+ 352
+
+ 353
+ private static void logProperties(String header, Properties properties) {
+ 354 3 if (LOGGER.isLoggable(Level.FINE)) {
+ 355 0 final StringWriter sw = new StringWriter();
+ 356 0 PrintWriter pw = null ;
+ 357
+ try {
+ 358 0 pw = new PrintWriter(sw);
+ 359 0 pw.format("%s:%n%n" , header);
+ 360 0 final Enumeration e = properties.propertyNames();
+ 361 0 while (e.hasMoreElements()) {
+ 362 0 final String key = (String) e.nextElement();
+ 363 0 if (key.contains("password" )) {
+ 364 0 pw.format("%s='*****'%n" , key);
+ 365
+ } else {
+ 366 0 final String value = properties.getProperty(key);
+ 367 0 if (value != null ) {
+ 368 0 pw.format("%s='%s'%n" , key, value);
+ 369
+ }
+ 370
+ }
+ 371 0 }
+ 372 0 pw.flush();
+ 373 0 LOGGER.fine(sw.toString());
+ 374
+ } finally {
+ 375 0 if (pw != null ) {
+ 376 0 pw.close();
+ 377
+ }
+ 378
+ }
+ 379
+
+ 380
}
- 502 3 if (file.startsWith("[JAR]" )) {
- 503 3 LOGGER.log(Level.FINE, "Settings.getDataFile() - transforming filename" );
- 504 3 final File jarPath = getJarPath();
- 505 3 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - jar file: '%s'" , jarPath.toString()));
- 506 3 final File retVal = new File(jarPath, file.substring(6));
- 507 3 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - returning: '%s'" , retVal.toString()));
- 508 3 return retVal;
+ 381 3 }
+ 382
+
+ 383
+
+ 384
+
+ 385
+
+ 386
+
+ 387
+
+ 388
+
+ 389
+ public static void setString(String key, String value) {
+ 390 5 localSettings.get().props.setProperty(key, value);
+ 391 5 if (LOGGER.isLoggable(Level.FINE)) {
+ 392 0 LOGGER.fine(String.format("Setting: %s='%s'" , key, value));
+ 393
+ }
+ 394 5 }
+ 395
+
+ 396
+
+ 397
+
+ 398
+
+ 399
+
+ 400
+
+ 401
+
+ 402
+ public static void setBoolean(String key, boolean value) {
+ 403 0 if (value) {
+ 404 0 localSettings.get().props.setProperty(key, Boolean.TRUE.toString());
+ 405
+ } else {
+ 406 0 localSettings.get().props.setProperty(key, Boolean.FALSE.toString());
+ 407
+ }
+ 408 0 if (LOGGER.isLoggable(Level.FINE)) {
+ 409 0 LOGGER.fine(String.format("Setting: %s='%b'" , key, value));
+ 410
+ }
+ 411 0 }
+ 412
+
+ 413
+
+ 414
+
+ 415
+
+ 416
+
+ 417
+
+ 418
+
+ 419
+
+ 420
+
+ 421
+
+ 422
+ public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
+ 423 0 FileInputStream fis = null ;
+ 424
+ try {
+ 425 0 fis = new FileInputStream(filePath);
+ 426 0 mergeProperties(fis);
+ 427
+ } finally {
+ 428 0 if (fis != null ) {
+ 429
+ try {
+ 430 0 fis.close();
+ 431 0 } catch (IOException ex) {
+ 432 0 LOGGER.log(Level.FINEST, "close error" , ex);
+ 433 0 }
+ 434
+ }
+ 435
+ }
+ 436 0 }
+ 437
+
+ 438
+
+ 439
+
+ 440
+
+ 441
+
+ 442
+
+ 443
+
+ 444
+
+ 445
+
+ 446
+
+ 447
+ public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
+ 448 1 FileInputStream fis = null ;
+ 449
+ try {
+ 450 1 fis = new FileInputStream(filePath);
+ 451 1 mergeProperties(fis);
+ 452
+ } finally {
+ 453 1 if (fis != null ) {
+ 454
+ try {
+ 455 1 fis.close();
+ 456 0 } catch (IOException ex) {
+ 457 0 LOGGER.log(Level.FINEST, "close error" , ex);
+ 458 1 }
+ 459
+ }
+ 460
+ }
+ 461 1 }
+ 462
+
+ 463
+
+ 464
+
+ 465
+
+ 466
+
+ 467
+
+ 468
+
+ 469
+
+ 470
+
+ 471
+ public static void mergeProperties(InputStream stream) throws IOException {
+ 472 1 localSettings.get().props.load(stream);
+ 473 1 logProperties("Properties updated via merge" , localSettings.get().props);
+ 474 1 }
+ 475
+
+ 476
+
+ 477
+
+ 478
+
+ 479
+
+ 480
+
+ 481
+
+ 482
+
+ 483
+
+ 484
+ public static File getFile(String key) {
+ 485 0 final String file = getString(key);
+ 486 0 if (file == null ) {
+ 487 0 return null ;
+ 488
+ }
+ 489 0 return new File(file);
+ 490
+ }
+ 491
+
+ 492
+
+ 493
+
+ 494
+
+ 495
+
+ 496
+
+ 497
+
+ 498
+
+ 499
+
+ 500
+
+ 501
+
+ 502
+
+ 503
+
+ 504
+ protected static File getDataFile(String key) {
+ 505 3 final String file = getString(key);
+ 506 3 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - file: '%s'" , file));
+ 507 3 if (file == null ) {
+ 508 0 return null ;
509
}
- 510 0 return new File(file);
- 511
- }
- 512
-
- 513
-
- 514
-
- 515
-
- 516
-
+ 510 3 if (file.startsWith("[JAR]" )) {
+ 511 3 LOGGER.log(Level.FINE, "Settings.getDataFile() - transforming filename" );
+ 512 3 final File jarPath = getJarPath();
+ 513 3 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - jar file: '%s'" , jarPath.toString()));
+ 514 3 final File retVal = new File(jarPath, file.substring(6));
+ 515 3 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - returning: '%s'" , retVal.toString()));
+ 516 3 return retVal;
517
-
- 518
- private static File getJarPath() {
- 519 3 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
- 520 3 String decodedPath = "." ;
- 521
- try {
- 522 3 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
- 523 0 } catch (UnsupportedEncodingException ex) {
- 524 0 LOGGER.log(Level.FINEST, null , ex);
- 525 3 }
- 526
-
- 527 3 final File path = new File(decodedPath);
- 528 3 if (path.getName().toLowerCase().endsWith(".jar" )) {
- 529 0 return path.getParentFile();
- 530
- } else {
- 531 3 return new File("." );
- 532
}
- 533
+ 518 0 return new File(file);
+ 519
}
+ 520
+
+ 521
+
+ 522
+
+ 523
+
+ 524
+
+ 525
+
+ 526
+ private static File getJarPath() {
+ 527 3 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
+ 528 3 String decodedPath = "." ;
+ 529
+ try {
+ 530 3 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
+ 531 0 } catch (UnsupportedEncodingException ex) {
+ 532 0 LOGGER.log(Level.FINEST, null , ex);
+ 533 3 }
534
- 535
-
- 536
-
- 537
-
+ 535 3 final File path = new File(decodedPath);
+ 536 3 if (path.getName().toLowerCase().endsWith(".jar" )) {
+ 537 0 return path.getParentFile();
538
-
- 539
-
+ } else {
+ 539 3 return new File("." );
540
-
+ }
541
-
- 542
-
- 543
-
- 544
- public static String getString(String key, String defaultValue) {
- 545 4 final String str = System.getProperty(key, localSettings.get().props.getProperty(key, defaultValue));
- 546 4 return str;
- 547
}
- 548
+ 542
- 549
+ 543
+ 544
+
+ 545
+
+ 546
+
+ 547
+
+ 548
+
+ 549
+
550
-
+
551
- 552 1 private static File tempDirectory = null ;
- 553
-
- 554
-
+ 552
+ public static String getString(String key, String defaultValue) {
+ 553 4 final String str = System.getProperty(key, localSettings.get().props.getProperty(key, defaultValue));
+ 554 4 return str;
555
-
+ }
556
-
+
557
-
+
558
-
+
559
- 560
- public static File getTempDirectory() throws IOException {
- 561 2 final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
- 562 2 if (!tmpDir.exists()) {
- 563 2 if (!tmpDir.mkdirs()) {
- 564 0 final String msg = String.format("Unable to make a temporary folder '%s'" , tmpDir.getPath());
- 565 0 throw new IOException(msg);
+ 560 1 private static File tempDirectory = null ;
+ 561
+
+ 562
+
+ 563
+
+ 564
+
+ 565
+
566
- } else {
- 567 2 tempDirectory = tmpDir;
+
+ 567
+
568
- }
- 569
- }
- 570 2 return tmpDir;
- 571
- }
- 572
-
- 573
-
+ public static File getTempDirectory() throws IOException {
+ 569 2 final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
+ 570 2 if (!tmpDir.exists()) {
+ 571 2 if (!tmpDir.mkdirs()) {
+ 572 0 final String msg = String.format("Unable to make a temporary folder '%s'" , tmpDir.getPath());
+ 573 0 throw new IOException(msg);
574
-
- 575
-
+ } else {
+ 575 2 tempDirectory = tmpDir;
576
-
+ }
577
-
- 578
-
+ }
+ 578 2 return tmpDir;
579
-
+ }
580
-
+
581
- public static String getString(String key) {
- 582 20 return System.getProperty(key, localSettings.get().props.getProperty(key));
+
+ 582
+
583
- }
+
584
-
+
585
-
+
586
-
+
587
-
+
588
-
+
589
-
- 590
- public static void removeProperty(String key) {
- 591 1 localSettings.get().props.remove(key);
- 592 1 }
+ public static String getString(String key) {
+ 590 20 return System.getProperty(key, localSettings.get().props.getProperty(key));
+ 591
+ }
+ 592
+
593
-
+
594
-
+
595
-
+
596
-
+
597
-
+
598
-
- 599
-
- 600
-
+ public static void removeProperty(String key) {
+ 599 1 localSettings.get().props.remove(key);
+ 600 1 }
601
-
+
602
-
+
603
- public static int getInt(String key) throws InvalidSettingException {
- 604
- int value;
- 605
- try {
- 606 1 value = Integer.parseInt(Settings.getString(key));
- 607 0 } catch (NumberFormatException ex) {
- 608 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 609 1 }
- 610 1 return value;
- 611
- }
- 612
-
- 613
-
- 614
- 615
+ 604
- 616
+ 605
- 617
+ 606
- 618
+ 607
- 619
-
- 620
-
- 621
-
- 622
+ 608
+
+ 609
+
+ 610
- 623
- public static int getInt(String key, int defaultValue) {
- 624
+ 611
+ public static int getInt(String key) throws InvalidSettingException {
+ 612
int value;
- 625
+ 613
try {
- 626 0 value = Integer.parseInt(Settings.getString(key));
- 627 0 } catch (NumberFormatException ex) {
- 628 0 final String msg = String.format("Could not convert property '%s' to an int." , key);
- 629 0 LOGGER.log(Level.FINEST, msg, ex);
- 630 0 value = defaultValue;
- 631 0 }
- 632 0 return value;
- 633
+ 614 1 value = Integer.parseInt(Settings.getString(key));
+ 615 0 } catch (NumberFormatException ex) {
+ 616 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 617 1 }
+ 618 1 return value;
+ 619
}
- 634
+ 620
- 635
+ 621
- 636
-
- 637
+ 622
+
+ 623
- 638
+ 624
- 639
+ 625
- 640
+ 626
+ 627
+
+ 628
+
+ 629
+
+ 630
+
+ 631
+ public static int getInt(String key, int defaultValue) {
+ 632
+ int value;
+ 633
+ try {
+ 634 0 value = Integer.parseInt(Settings.getString(key));
+ 635 0 } catch (NumberFormatException ex) {
+ 636 0 final String msg = String.format("Could not convert property '%s' to an int." , key);
+ 637 0 LOGGER.log(Level.FINEST, msg, ex);
+ 638 0 value = defaultValue;
+ 639 0 }
+ 640 0 return value;
641
-
+ }
642
-
+
643
-
+
644
- public static long getLong(String key) throws InvalidSettingException {
+
645
- long value;
+
646
- try {
- 647 1 value = Long.parseLong(Settings.getString(key));
- 648 0 } catch (NumberFormatException ex) {
- 649 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 650 1 }
- 651 1 return value;
+
+ 647
+
+ 648
+
+ 649
+
+ 650
+
+ 651
+
652
- }
+ public static long getLong(String key) throws InvalidSettingException {
653
-
+ long value;
654
-
- 655
-
- 656
-
- 657
-
- 658
-
- 659
-
+ try {
+ 655 1 value = Long.parseLong(Settings.getString(key));
+ 656 0 } catch (NumberFormatException ex) {
+ 657 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 658 1 }
+ 659 1 return value;
660
-
+ }
661
-
+
662
-
+
663
- public static boolean getBoolean(String key) throws InvalidSettingException {
- 664
- boolean value;
- 665
- try {
- 666 1 value = Boolean.parseBoolean(Settings.getString(key));
- 667 0 } catch (NumberFormatException ex) {
- 668 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 669 1 }
- 670 1 return value;
- 671
- }
- 672
-
- 673
-
- 674
- 675
+ 664
- 676
+ 665
- 677
+ 666
- 678
+ 667
- 679
-
- 680
+ 668
- 681
+ 669
- 682
+ 670
- 683
- public static boolean getBoolean(String key, boolean defaultValue) throws InvalidSettingException {
- 684
+ 671
+ public static boolean getBoolean(String key) throws InvalidSettingException {
+ 672
boolean value;
- 685
+ 673
try {
- 686 1 final String strValue = Settings.getString(key);
- 687 1 if (strValue == null ) {
- 688 1 return defaultValue;
+ 674 1 value = Boolean.parseBoolean(Settings.getString(key));
+ 675 0 } catch (NumberFormatException ex) {
+ 676 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 677 1 }
+ 678 1 return value;
+ 679
+ }
+ 680
+
+ 681
+
+ 682
+
+ 683
+
+ 684
+
+ 685
+
+ 686
+
+ 687
+
+ 688
+
689
- }
- 690 0 value = Boolean.parseBoolean(strValue);
- 691 0 } catch (NumberFormatException ex) {
- 692 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
- 693 0 }
- 694 0 return value;
- 695
- }
- 696
-
+
+ 690
+
+ 691
+ public static boolean getBoolean(String key, boolean defaultValue) throws InvalidSettingException {
+ 692
+ boolean value;
+ 693
+ try {
+ 694 1 final String strValue = Settings.getString(key);
+ 695 1 if (strValue == null ) {
+ 696 1 return defaultValue;
697
-
- 698
-
- 699
-
- 700
-
- 701
-
- 702
-
+ }
+ 698 0 value = Boolean.parseBoolean(strValue);
+ 699 0 } catch (NumberFormatException ex) {
+ 700 0 throw new InvalidSettingException("Could not convert property '" + key + "' to an int." , ex);
+ 701 0 }
+ 702 0 return value;
703
-
+ }
704
-
- 705
-
- 706
-
- 707
-
- 708
-
- 709
- public static String getConnectionString(String connectionStringKey, String dbFileNameKey, String dbVersionKey)
- 710
- throws IOException, InvalidSettingException {
- 711 3 final String connStr = Settings.getString(connectionStringKey);
- 712 3 if (connStr == null ) {
- 713 1 final String msg = String.format("Invalid properties file to get the connection string; '%s' must be defined." ,
- 714
- connectionStringKey);
- 715 1 throw new InvalidSettingException(msg);
- 716
- }
- 717 2 if (connStr.contains("%s" )) {
- 718 2 final File directory = getDataDirectory();
- 719 2 String fileName = null ;
- 720 2 if (dbFileNameKey != null ) {
- 721 2 fileName = Settings.getString(dbFileNameKey);
- 722
- }
- 723 2 if (fileName == null ) {
- 724 0 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
- 725
- dbFileNameKey);
- 726 0 throw new InvalidSettingException(msg);
- 727
- }
- 728 2 if (fileName.contains("%s" )) {
- 729 2 String version = null ;
- 730 2 if (dbVersionKey != null ) {
- 731 1 version = Settings.getString(dbVersionKey);
- 732
- }
- 733 2 if (version == null ) {
- 734 1 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
- 735
- dbFileNameKey);
- 736 1 throw new InvalidSettingException(msg);
- 737
- }
- 738 1 fileName = String.format(fileName, version);
- 739
- }
- 740 1 if (connStr.startsWith("jdbc:h2:file:" ) && fileName.endsWith(".h2.db" )) {
- 741 1 fileName = fileName.substring(0, fileName.length() - 6);
- 742
- }
- 743
-
- 744 1 final File dbFile = new File(directory, fileName);
- 745 1 final String cString = String.format(connStr, dbFile.getCanonicalPath());
- 746 1 LOGGER.log(Level.FINE, String.format("Connection String: '%s'" , cString));
- 747 1 return cString;
- 748
- }
- 749 0 return connStr;
- 750
- }
- 751
- 752
+ 705
- 753
-
- 754
-
- 755
+ 706
+
+ 707
+
+ 708
+
+ 709
- 756
-
- 757
-
- 758
+ 710
+
+ 711
+
+ 712
+
+ 713
+
+ 714
+
+ 715
+
+ 716
- 759
- public static File getDataDirectory() throws IOException {
- 760 2 final File path = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
- 761 2 if (path.exists() || path.mkdirs()) {
- 762 2 return path;
- 763
+ 717
+ public static String getConnectionString(String connectionStringKey, String dbFileNameKey, String dbVersionKey)
+ 718
+ throws IOException, InvalidSettingException {
+ 719 3 final String connStr = Settings.getString(connectionStringKey);
+ 720 3 if (connStr == null ) {
+ 721 1 final String msg = String.format("Invalid properties file to get the connection string; '%s' must be defined." ,
+ 722
+ connectionStringKey);
+ 723 1 throw new InvalidSettingException(msg);
+ 724
}
- 764 0 throw new IOException(String.format("Unable to create the data directory '%s'" , path.getAbsolutePath()));
- 765
+ 725 2 if (connStr.contains("%s" )) {
+ 726 2 final File directory = getDataDirectory();
+ 727 2 String fileName = null ;
+ 728 2 if (dbFileNameKey != null ) {
+ 729 2 fileName = Settings.getString(dbFileNameKey);
+ 730
+ }
+ 731 2 if (fileName == null ) {
+ 732 0 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
+ 733
+ dbFileNameKey);
+ 734 0 throw new InvalidSettingException(msg);
+ 735
+ }
+ 736 2 if (fileName.contains("%s" )) {
+ 737 2 String version = null ;
+ 738 2 if (dbVersionKey != null ) {
+ 739 1 version = Settings.getString(dbVersionKey);
+ 740
+ }
+ 741 2 if (version == null ) {
+ 742 1 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
+ 743
+ dbFileNameKey);
+ 744 1 throw new InvalidSettingException(msg);
+ 745
+ }
+ 746 1 fileName = String.format(fileName, version);
+ 747
+ }
+ 748 1 if (connStr.startsWith("jdbc:h2:file:" ) && fileName.endsWith(".h2.db" )) {
+ 749 1 fileName = fileName.substring(0, fileName.length() - 6);
+ 750
+ }
+ 751
+
+ 752 1 final File dbFile = new File(directory, fileName);
+ 753 1 final String cString = String.format(connStr, dbFile.getCanonicalPath());
+ 754 1 LOGGER.log(Level.FINE, String.format("Connection String: '%s'" , cString));
+ 755 1 return cString;
+ 756
+ }
+ 757 0 return connStr;
+ 758
}
+ 759
+
+ 760
+
+ 761
+
+ 762
+
+ 763
+
+ 764
+
+ 765
+
766
+
+ 767
+ public static File getDataDirectory() throws IOException {
+ 768 2 final File path = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
+ 769 2 if (path.exists() || path.mkdirs()) {
+ 770 2 return path;
+ 771
+ }
+ 772 0 throw new IOException(String.format("Unable to create the data directory '%s'" , path.getAbsolutePath()));
+ 773
+ }
+ 774
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html
index a11f4375a..14f304dfc 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFactory.html
@@ -219,6 +219,6 @@
}
-
+
diff --git a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html
index 6b3ed6f25..70fbf86e7 100644
--- a/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html
+++ b/dependency-check-utils/cobertura/org.owasp.dependencycheck.utils.URLConnectionFailureException.html
@@ -155,6 +155,6 @@
}
-
+
diff --git a/dependency-check-utils/cpd.html b/dependency-check-utils/cpd.html
index 955d3e2ec..07769ffed 100644
--- a/dependency-check-utils/cpd.html
+++ b/dependency-check-utils/cpd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - CPD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-utils/dependency-updates-report.html b/dependency-check-utils/dependency-updates-report.html
index 6de80c299..68748b839 100644
--- a/dependency-check-utils/dependency-updates-report.html
+++ b/dependency-check-utils/dependency-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Dependency Updates Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -354,7 +354,7 @@
jar
Newer versions
-4.12-beta-1 Next Incremental
+4.12-beta-1 Next Incremental 4.12-beta-24.12-beta-3 Latest Incremental
diff --git a/dependency-check-utils/findbugs.html b/dependency-check-utils/findbugs.html
index 68cafbc0a..784e616e3 100644
--- a/dependency-check-utils/findbugs.html
+++ b/dependency-check-utils/findbugs.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - FindBugs Bug Detector Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -238,7 +238,7 @@
Errors
Missing Classes
-13
+49
1
0
0
diff --git a/dependency-check-utils/index.html b/dependency-check-utils/index.html
index cca50a7c6..ea416d5bb 100644
--- a/dependency-check-utils/index.html
+++ b/dependency-check-utils/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - About
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-utils/license.html b/dependency-check-utils/license.html
index 799022483..850c053ad 100644
--- a/dependency-check-utils/license.html
+++ b/dependency-check-utils/license.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Project License
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-utils/plugin-updates-report.html b/dependency-check-utils/plugin-updates-report.html
index e8eb91b13..372a9b71d 100644
--- a/dependency-check-utils/plugin-updates-report.html
+++ b/dependency-check-utils/plugin-updates-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Plugin Updates Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -230,7 +230,7 @@
# of plugins using the latest version available
-5
+1
# of plugins where the next version available is smaller than an incremental version update
@@ -242,7 +242,7 @@
# of plugins where the next version available is a minor version update
-9
+13
# of plugins where the next version available is a major version update
@@ -328,13 +328,13 @@
Next Major
Dependency status
-
+
com.github.github
site-maven-plugin
-0.9
-
+0.9
+0.10
@@ -348,13 +348,13 @@
-
+
org.apache.maven.plugins
maven-compiler-plugin
-3.1
-
+3.1
+3.2
@@ -368,13 +368,13 @@
-
+
org.apache.maven.plugins
maven-failsafe-plugin
-2.16
-
+2.16
+2.17
@@ -418,13 +418,13 @@
-
+
org.apache.maven.plugins
maven-surefire-plugin
-2.16
-
+2.16
+2.17
@@ -455,7 +455,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
com.github.github
@@ -464,7 +464,10 @@
site-maven-plugin
Current Version
-0.9
+0.9
+
+Newer versions
+0.10 Next Minor
Plugin org.apache.maven.plugins:maven-antrun-plugin
@@ -500,7 +503,7 @@
2.2-beta-5
Newer versions
-2.2 Next Version 2.2.1 Next Incremental 2.2.2 Latest Incremental 2.3 Next Minor 2.4 Latest Minor
+2.2 Next Version 2.2.1 Next Incremental 2.2.2 Latest Incremental 2.3 Next Minor 2.4 2.4.1 2.52.5.1 Latest Minor
Plugin org.apache.maven.plugins:maven-clean-plugin
@@ -518,13 +521,13 @@
2.4.1
Newer versions
-2.5 Next Minor
+2.5 Next Minor 2.62.6.1 Latest Minor
Plugin org.apache.maven.plugins:maven-compiler-plugin
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -533,7 +536,10 @@
maven-compiler-plugin
Current Version
-3.1
+3.1
+
+Newer versions
+3.2 Next Minor
Plugin org.apache.maven.plugins:maven-dependency-plugin
@@ -551,7 +557,7 @@
2.1
Newer versions
-2.2 Next Minor 2.3 2.4 2.5 2.5.1 2.6 2.72.8 Latest Minor
+2.2 Next Minor 2.3 2.4 2.5 2.5.1 2.6 2.7 2.82.9 Latest Minor
Plugin org.apache.maven.plugins:maven-deploy-plugin
@@ -569,13 +575,13 @@
2.7
Newer versions
-2.8 Next Minor 2.8.1 Latest Minor
+2.8 Next Minor 2.8.12.8.2 Latest Minor
Plugin org.apache.maven.plugins:maven-failsafe-plugin
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -584,7 +590,10 @@
maven-failsafe-plugin
Current Version
-2.16
+2.16
+
+Newer versions
+2.17 Next Minor 2.18 Latest Minor
Plugin org.apache.maven.plugins:maven-install-plugin
@@ -602,7 +611,7 @@
2.3.1
Newer versions
-2.4 Next Minor 2.52.5.1 Latest Minor
+2.4 Next Minor 2.5 2.5.12.5.2 Latest Minor
Plugin org.apache.maven.plugins:maven-jar-plugin
@@ -620,7 +629,7 @@
2.3.2
Newer versions
-2.4 Next Minor
+2.4 Next Minor 2.5 Latest Minor
Plugin org.apache.maven.plugins:maven-release-plugin
@@ -638,7 +647,7 @@
2.0
Newer versions
-2.1 Next Minor 2.2 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.12.4.2 Latest Minor
+2.1 Next Minor 2.2 2.2.1 2.2.2 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.52.5.1 Latest Minor
Plugin org.apache.maven.plugins:maven-resources-plugin
@@ -656,7 +665,7 @@
2.5
Newer versions
-2.6 Next Minor
+2.6 Next Minor 2.7 Latest Minor
Plugin org.apache.maven.plugins:maven-site-plugin
@@ -740,7 +749,7 @@
Status
- No newer versions available.
+ There is at least one newer minor version available. Minor updates are sometimes passive.
Group Id
org.apache.maven.plugins
@@ -749,7 +758,10 @@
maven-surefire-plugin
Current Version
-2.16
+2.16
+
+Newer versions
+2.17 Next Minor 2.18 Latest Minor
Plugin org.codehaus.mojo:cobertura-maven-plugin
diff --git a/dependency-check-utils/pmd.html b/dependency-check-utils/pmd.html
index cd5eb0d0c..94a65b483 100644
--- a/dependency-check-utils/pmd.html
+++ b/dependency-check-utils/pmd.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - PMD Results
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-utils/project-info.html b/dependency-check-utils/project-info.html
index 83a8c8aca..a85c615f5 100644
--- a/dependency-check-utils/project-info.html
+++ b/dependency-check-utils/project-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Project Information
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-utils/project-reports.html b/dependency-check-utils/project-reports.html
index caab7ca75..c5d276e45 100644
--- a/dependency-check-utils/project-reports.html
+++ b/dependency-check-utils/project-reports.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Generated Reports
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/dependency-check-utils/project-summary.html b/dependency-check-utils/project-summary.html
index fffae35d2..6f7d2e38c 100644
--- a/dependency-check-utils/project-summary.html
+++ b/dependency-check-utils/project-summary.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Project Summary
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -203,7 +203,7 @@
dependency-check-utils
Version
-1.2.5
+1.2.6
Type
jar
diff --git a/dependency-check-utils/surefire-report.html b/dependency-check-utils/surefire-report.html
index 3abe4fac3..9deb24eee 100644
--- a/dependency-check-utils/surefire-report.html
+++ b/dependency-check-utils/surefire-report.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Surefire Report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -254,12 +254,12 @@ function toggleDisplay(elementId) {
Success Rate
Time
-21
+25
0
0
0
100%
-0.263
+
0.137
Note: failures are anticipated and checked for with assertions while errors are unanticipated.
Package List
@@ -274,15 +274,44 @@ function toggleDisplay(elementId) {
Success Rate
Time
+org.owasp.dependencycheck.org.apache.tools.ant
+4
+0
+0
+0
+100%
+0.136
+
org.owasp.dependencycheck.utils
21
0
0
0
100%
-0.263
+
0.001
Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
+
org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+Class
+Tests
+Errors
+Failures
+Skipped
+Success Rate
+Time
+
+
+DirectoryScannerTest
+4
+0
+0
+0
+100%
+0.136
+
org.owasp.dependencycheck.utils
DownloaderTest
diff --git a/dependency-check-utils/taglist.html b/dependency-check-utils/taglist.html
index 43b7d3686..089f24c55 100644
--- a/dependency-check-utils/taglist.html
+++ b/dependency-check-utils/taglist.html
@@ -1,13 +1,13 @@
-
+
dependency-check-ant - Tag List report
@@ -54,7 +54,7 @@
-
+
/
@@ -67,9 +67,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -233,14 +233,158 @@
Tag strings used by tag class
Todo Work
-1
+47
todo, FIXME
Each tag is detailed below:
-
Number of occurrences found in the code: 1
+
Number of occurrences found in the code: 47
+org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScannerTest
+Line
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+125
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+140
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+156
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+169
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+183
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+197
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+208
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+221
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+234
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+248
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+262
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+275
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+288
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+302
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+315
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+328
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+341
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+354
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+367
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+380
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+394
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+406
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+418
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+430
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+445
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+460
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+475
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+490
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+505
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+521
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+535
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+549
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+563
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+577
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+591
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+605
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+619
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+633
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+647
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+661
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+675
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+687
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+702
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+716
+
+review the generated test code and remove the default call to fail. fail("The test case is a prototype."); }
+728
+
+org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator
+Line
+
+should use java.net.URI now that we can rely on 1.4... but check for UNC-related regressions, e.g. #42275 (and remember that \\server\share\file -> file:////server/share/file rather than -> file://server/share/file as it should; fixed only in JDK 7's java.nio.file.Path.toUri) return fromUriJava14(uri);
+184
+
org.owasp.dependencycheck.utils.Downloader
Line
diff --git a/dependency-check-utils/xref-test/allclasses-frame.html b/dependency-check-utils/xref-test/allclasses-frame.html
index b875633aa..e96969609 100644
--- a/dependency-check-utils/xref-test/allclasses-frame.html
+++ b/dependency-check-utils/xref-test/allclasses-frame.html
@@ -16,6 +16,9 @@
ChecksumTest
+
+
+ DirectoryScannerTest
DownloaderIntegrationTest
diff --git a/dependency-check-utils/xref-test/index.html b/dependency-check-utils/xref-test/index.html
index 11a59e267..c8f1ba916 100644
--- a/dependency-check-utils/xref-test/index.html
+++ b/dependency-check-utils/xref-test/index.html
@@ -4,7 +4,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
diff --git a/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScannerTest.html b/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScannerTest.html
new file mode 100644
index 000000000..9edf39652
--- /dev/null
+++ b/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScannerTest.html
@@ -0,0 +1,745 @@
+
+
+
+DirectoryScannerTest xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16 package org.owasp.dependencycheck.org.apache.tools.ant;
+17
+18 import org.owasp.dependencycheck.org.apache.tools.ant.DirectoryScanner;
+19 import java.io.File;
+20 import org.junit.After;
+21 import org.junit.AfterClass;
+22 import static org.junit.Assert.assertEquals;
+23 import static org.junit.Assert.assertTrue;
+24 import org.junit.Before;
+25 import org.junit.BeforeClass;
+26 import org.junit.Test;
+27
+28
+29
+30
+31
+32 public class DirectoryScannerTest {
+33
+34 public DirectoryScannerTest () {
+35 }
+36
+37 @BeforeClass
+38 public static void setUpClass() {
+39 }
+40
+41 @AfterClass
+42 public static void tearDownClass() {
+43 }
+44
+45 @Before
+46 public void setUp() {
+47 }
+48
+49 @After
+50 public void tearDown() {
+51 }
+52
+53
+54
+55
+56 @Test
+57 public void testExpectedUse() {
+58 DirectoryScanner scanner = new DirectoryScanner();
+59 scanner.setBasedir("./target" );
+60 scanner.setIncludes("/test-classes/**" );
+61 scanner.scan();
+62
+63 File base = new File("./target" );
+64 for (String t : scanner.getIncludedFiles()) {
+65 assertTrue(t.startsWith("test-classes" ));
+66 File test = new File(base, t);
+67 assertTrue(test.exists());
+68 }
+69 }
+70
+71
+72
+73
+74 @Test
+75 public void testMatchPatternStart_String_String() {
+76 String pattern = "alpha/be?a/**" ;
+77 String str = "alpha/beta/gamma/" ;
+78 boolean expResult = true ;
+79 boolean result = DirectoryScanner.matchPatternStart(pattern, str);
+80 assertEquals(expResult, result);
+81 }
+82
+83
+84
+85
+86 @Test
+87 public void testMatchPatternStart_3args() {
+88 String pattern = "Alpha/be?a/**" ;
+89 String str = "alpha/beta/gamma/" ;
+90 boolean isCaseSensitive = true ;
+91 boolean expResult = false;
+92 boolean result = DirectoryScanner.matchPatternStart(pattern, str, isCaseSensitive);
+93 assertEquals(expResult, result);
+94
+95 isCaseSensitive = false;
+96 expResult = true ;
+97 result = DirectoryScanner.matchPatternStart(pattern, str, isCaseSensitive);
+98 assertEquals(expResult, result);
+99 }
+100
+101
+102
+103
+104 @Test
+105 public void testMatchPath_String_String() {
+106 String pattern = "alpha/be?a/**" ;
+107 String str = "alpha/beta/gamma/" ;
+108 boolean expResult = true ;
+109 boolean result = DirectoryScanner.matchPath(pattern, str);
+110 assertEquals(expResult, result);
+111 }
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html b/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html
new file mode 100644
index 000000000..4975d61d9
--- /dev/null
+++ b/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html b/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html
new file mode 100644
index 000000000..4f06fe057
--- /dev/null
+++ b/dependency-check-utils/xref-test/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/ChecksumTest.html b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/ChecksumTest.html
index 90972288b..261c6d88e 100644
--- a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/ChecksumTest.html
+++ b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/ChecksumTest.html
@@ -28,134 +28,112 @@
20 import java.io.File;
21 import java.io.IOException;
22 import java.security.NoSuchAlgorithmException;
-23 import org.junit.After;
-24 import org.junit.AfterClass;
-25 import org.junit.Assert;
-26 import org.junit.Before;
-27 import org.junit.BeforeClass;
-28 import org.junit.Test;
+23
+24 import org.junit.Assert;
+25 import org.junit.Rule;
+26 import org.junit.Test;
+27 import org.junit.rules.ExpectedException;
+28 import org.owasp.dependencycheck.utils.Checksum;
29 import org.owasp.dependencycheck.utils.Checksum;
-30 import org.owasp.dependencycheck.utils.Checksum;
-31
-32
-33
-34
-35
-36 public class ChecksumTest {
-37
-38 @BeforeClass
-39 public static void setUpClass() throws Exception {
-40 }
-41
-42 @AfterClass
-43 public static void tearDownClass() throws Exception {
-44 }
-45
-46 @Before
-47 public void setUp() throws Exception {
-48 }
-49
-50 @After
-51 public void tearDown() throws Exception {
-52 }
-53
-54
-55
-56
-57
-58
-59 @Test
-60 public void testGetChecksum() throws Exception {
-61 String algorithm = "MD5" ;
-62 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
-63 byte[] expResult = {-16, -111, 92, 95, 70, -72, -49, -94, -125, -27, -83, 103, -96, -101, 55, -109};
-64 byte[] result = Checksum.getChecksum(algorithm, file);
-65 boolean arraysAreEqual = true ;
-66 if (expResult.length == result.length) {
-67 for (int i = 0; arraysAreEqual && i < result.length; i++) {
-68 arraysAreEqual = result[i] == expResult[i];
-69 }
-70 } else {
-71 Assert.fail("Checksum results do not match expected results." );
-72 }
-73 Assert.assertTrue(arraysAreEqual);
-74 }
-75
-76
-77
-78
-79
-80
-81
-82 @Test
-83 public void testGetChecksum_FileNotFound() throws Exception {
-84 String algorithm = "MD5" ;
-85 File file = new File("not a valid file" );
-86 boolean exceptionThrown = false;
-87 try {
-88 byte[] result = Checksum.getChecksum(algorithm, file);
-89 } catch (IOException ex) {
-90 exceptionThrown = true ;
-91 }
-92 Assert.assertTrue(exceptionThrown);
-93 }
-94
-95
-96
-97
-98
-99
-100
-101 @Test
-102 public void testGetChecksum_NoSuchAlgorithm() throws Exception {
-103 String algorithm = "some unknown algorithm" ;
-104 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
-105 boolean exceptionThrown = false;
-106 try {
-107 byte[] result = Checksum.getChecksum(algorithm, file);
-108 } catch (NoSuchAlgorithmException ex) {
-109 exceptionThrown = true ;
-110 }
-111 Assert.assertTrue(exceptionThrown);
-112 }
-113
-114
-115
-116
-117
-118
-119 @Test
-120 public void testGetMD5Checksum() throws Exception {
-121 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
-122 String expResult = "F0915C5F46B8CFA283E5AD67A09B3793" ;
-123 String result = Checksum.getMD5Checksum(file);
-124 Assert.assertEquals(expResult, result);
-125 }
-126
-127
-128
-129
-130
-131
-132 @Test
-133 public void testGetSHA1Checksum() throws Exception {
-134 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
-135 String expResult = "B8A9FF28B21BCB1D0B50E24A5243D8B51766851A" ;
-136 String result = Checksum.getSHA1Checksum(file);
-137 Assert.assertEquals(expResult, result);
-138 }
-139
-140
-141
-142
-143 @Test
-144 public void testGetHex() {
-145 byte[] raw = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
-146 String expResult = "000102030405060708090A0B0C0D0E0F10" ;
-147 String result = Checksum.getHex(raw);
-148 Assert.assertEquals(expResult, result);
-149 }
-150 }
+30
+31
+32
+33
+34
+35 public class ChecksumTest {
+36
+37 @Rule
+38 public ExpectedException expectedException = ExpectedException.none();
+39
+40
+41
+42
+43
+44
+45 @Test
+46 public void testGetChecksum() throws Exception {
+47 String algorithm = "MD5" ;
+48 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
+49 byte[] expResult = {-16, -111, 92, 95, 70, -72, -49, -94, -125, -27, -83, 103, -96, -101, 55, -109};
+50 byte[] result = Checksum.getChecksum(algorithm, file);
+51 boolean arraysAreEqual = true ;
+52 if (expResult.length == result.length) {
+53 for (int i = 0; arraysAreEqual && i < result.length; i++) {
+54 arraysAreEqual = result[i] == expResult[i];
+55 }
+56 } else {
+57 Assert.fail("Checksum results do not match expected results." );
+58 }
+59 Assert.assertTrue(arraysAreEqual);
+60 }
+61
+62
+63
+64
+65
+66
+67
+68 @Test
+69 public void testGetChecksum_FileNotFound() throws Exception {
+70 String algorithm = "MD5" ;
+71 File file = new File("not a valid file" );
+72
+73 expectedException.expect(IOException.class );
+74 Checksum.getChecksum(algorithm, file);
+75 }
+76
+77
+78
+79
+80
+81
+82
+83 @Test
+84 public void testGetChecksum_NoSuchAlgorithm() throws Exception {
+85 String algorithm = "some unknown algorithm" ;
+86 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
+87
+88 expectedException.expect(NoSuchAlgorithmException.class );
+89 Checksum.getChecksum(algorithm, file);
+90 }
+91
+92
+93
+94
+95
+96
+97 @Test
+98 public void testGetMD5Checksum() throws Exception {
+99 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
+100 String expResult = "F0915C5F46B8CFA283E5AD67A09B3793" ;
+101 String result = Checksum.getMD5Checksum(file);
+102 Assert.assertEquals(expResult, result);
+103 }
+104
+105
+106
+107
+108
+109
+110 @Test
+111 public void testGetSHA1Checksum() throws Exception {
+112 File file = new File(this .getClass().getClassLoader().getResource("checkSumTest.file" ).getPath());
+113 String expResult = "B8A9FF28B21BCB1D0B50E24A5243D8B51766851A" ;
+114 String result = Checksum.getSHA1Checksum(file);
+115 Assert.assertEquals(expResult, result);
+116 }
+117
+118
+119
+120
+121 @Test
+122 public void testGetHex() {
+123 byte[] raw = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
+124 String expResult = "000102030405060708090A0B0C0D0E0F10" ;
+125 String result = Checksum.getHex(raw);
+126 Assert.assertEquals(expResult, result);
+127 }
+128 }
diff --git a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/DownloaderIntegrationTest.html b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/DownloaderIntegrationTest.html
index acb7cedd5..6624139e5 100644
--- a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/DownloaderIntegrationTest.html
+++ b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/DownloaderIntegrationTest.html
@@ -50,12 +50,12 @@
42 URL url = new URL(Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL));
43 File outputPath = new File("target/downloaded_cve.xml" );
44 Downloader.fetchFile(url, outputPath);
-45
+45 assertTrue(outputPath.isFile());
46 }
47
48 @Test
49 public void testGetLastModified() throws Exception {
-50 URL url = new URL("http://nvd.nist.gov/download/nvdcve-2012.xml" );
+50 URL url = new URL(Settings.getString(Settings.KEYS.CVE_MODIFIED_20_URL));
51 long timestamp = Downloader.getLastModified(url);
52 assertTrue("timestamp equal to zero?" , timestamp > 0);
53 }
diff --git a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-frame.html b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-frame.html
index 7dac3172e..e5e77d11e 100644
--- a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-frame.html
+++ b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-summary.html b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-summary.html
index bda36d226..728bdf2a0 100644
--- a/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-summary.html
+++ b/dependency-check-utils/xref-test/org/owasp/dependencycheck/utils/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-utils/xref-test/overview-frame.html b/dependency-check-utils/xref-test/overview-frame.html
index 879cf6ab8..974df1df8 100644
--- a/dependency-check-utils/xref-test/overview-frame.html
+++ b/dependency-check-utils/xref-test/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
@@ -16,6 +16,9 @@
diff --git a/dependency-check-utils/xref-test/overview-summary.html b/dependency-check-utils/xref-test/overview-summary.html
index 2cb4f6f35..d120d5c55 100644
--- a/dependency-check-utils/xref-test/overview-summary.html
+++ b/dependency-check-utils/xref-test/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
@@ -34,6 +34,11 @@
+
+ org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
org.owasp.dependencycheck.utils
diff --git a/dependency-check-utils/xref/allclasses-frame.html b/dependency-check-utils/xref/allclasses-frame.html
index 72142d0a8..8635442a4 100644
--- a/dependency-check-utils/xref/allclasses-frame.html
+++ b/dependency-check-utils/xref/allclasses-frame.html
@@ -12,40 +12,124 @@
diff --git a/dependency-check-utils/xref/index.html b/dependency-check-utils/xref/index.html
index 11a59e267..c8f1ba916 100644
--- a/dependency-check-utils/xref/index.html
+++ b/dependency-check-utils/xref/index.html
@@ -4,7 +4,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/BuildException.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/BuildException.html
new file mode 100644
index 000000000..d943026ea
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/BuildException.html
@@ -0,0 +1,166 @@
+
+
+
+BuildException xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant;
+19
+20
+21
+22
+23 public class BuildException extends RuntimeException {
+24
+25 private static final long serialVersionUID = -5419014565354664240L;
+26
+27
+28 private Location location = Location.UNKNOWN_LOCATION;
+29
+30
+31
+32
+33 public BuildException () {
+34 super ();
+35 }
+36
+37
+38
+39
+40
+41
+42
+43 public BuildException (String message) {
+44 super (message);
+45 }
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56 public BuildException (String message, Throwable cause) {
+57 super (message, cause);
+58 }
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71 public BuildException (String msg, Throwable cause, Location location) {
+72 this (msg, cause);
+73 this .location = location;
+74 }
+75
+76
+77
+78
+79
+80
+81
+82 public BuildException (Throwable cause) {
+83 super (cause);
+84 }
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95 public BuildException (String message, Location location) {
+96 super (message);
+97 this .location = location;
+98 }
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109 public BuildException (Throwable cause, Location location) {
+110 this (cause);
+111 this .location = location;
+112 }
+113
+114
+115
+116
+117
+118
+119
+120
+121 public Throwable getException() {
+122 return getCause();
+123 }
+124
+125
+126
+127
+128
+129
+130 public String toString() {
+131 return location.toString() + getMessage();
+132 }
+133
+134
+135
+136
+137
+138
+139
+140 public void setLocation(Location location) {
+141 this .location = location;
+142 }
+143
+144
+145
+146
+147
+148
+149 public Location getLocation() {
+150 return location;
+151 }
+152
+153 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScanner.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScanner.html
new file mode 100644
index 000000000..51ea92740
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/DirectoryScanner.html
@@ -0,0 +1,1829 @@
+
+
+
+DirectoryScanner xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant;
+19
+20 import java.io.File;
+21 import java.io.IOException;
+22 import java.util.ArrayList;
+23 import java.util.Arrays;
+24 import java.util.HashMap;
+25 import java.util.HashSet;
+26 import java.util.Iterator;
+27 import java.util.LinkedList;
+28 import java.util.Map;
+29 import java.util.Set;
+30 import java.util.Vector;
+31 import org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os;
+32 import org.owasp.dependencycheck.org.apache.tools.ant.types.Resource;
+33 import org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory;
+34 import org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileResource;
+35 import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.FileSelector;
+36 import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorScanner;
+37 import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.SelectorUtils;
+38 import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPath;
+39 import org.owasp.dependencycheck.org.apache.tools.ant.types.selectors.TokenizedPattern;
+40 import org.owasp.dependencycheck.org.apache.tools.ant.util.CollectionUtils;
+41 import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+42 import org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils;
+43 import org.owasp.dependencycheck.org.apache.tools.ant.util.VectorSet;
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113 public class DirectoryScanner
+114 implements FileScanner, SelectorScanner, ResourceFactory {
+115
+116
+117
+118
+119 private static final boolean ON_VMS = Os.isFamily("openvms" );
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130 protected static final String[] DEFAULTEXCLUDES = {
+131
+132 SelectorUtils.DEEP_TREE_MATCH + "/*~" ,
+133 SelectorUtils.DEEP_TREE_MATCH + "/#*#" ,
+134 SelectorUtils.DEEP_TREE_MATCH + "/.#*" ,
+135 SelectorUtils.DEEP_TREE_MATCH + "/%*%" ,
+136 SelectorUtils.DEEP_TREE_MATCH + "/._*" ,
+137
+138 SelectorUtils.DEEP_TREE_MATCH + "/CVS" ,
+139 SelectorUtils.DEEP_TREE_MATCH + "/CVS/" + SelectorUtils.DEEP_TREE_MATCH,
+140 SelectorUtils.DEEP_TREE_MATCH + "/.cvsignore" ,
+141
+142 SelectorUtils.DEEP_TREE_MATCH + "/SCCS" ,
+143 SelectorUtils.DEEP_TREE_MATCH + "/SCCS/" + SelectorUtils.DEEP_TREE_MATCH,
+144
+145 SelectorUtils.DEEP_TREE_MATCH + "/vssver.scc" ,
+146
+147 SelectorUtils.DEEP_TREE_MATCH + "/.svn" ,
+148 SelectorUtils.DEEP_TREE_MATCH + "/.svn/" + SelectorUtils.DEEP_TREE_MATCH,
+149
+150 SelectorUtils.DEEP_TREE_MATCH + "/.git" ,
+151 SelectorUtils.DEEP_TREE_MATCH + "/.git/" + SelectorUtils.DEEP_TREE_MATCH,
+152 SelectorUtils.DEEP_TREE_MATCH + "/.gitattributes" ,
+153 SelectorUtils.DEEP_TREE_MATCH + "/.gitignore" ,
+154 SelectorUtils.DEEP_TREE_MATCH + "/.gitmodules" ,
+155
+156 SelectorUtils.DEEP_TREE_MATCH + "/.hg" ,
+157 SelectorUtils.DEEP_TREE_MATCH + "/.hg/" + SelectorUtils.DEEP_TREE_MATCH,
+158 SelectorUtils.DEEP_TREE_MATCH + "/.hgignore" ,
+159 SelectorUtils.DEEP_TREE_MATCH + "/.hgsub" ,
+160 SelectorUtils.DEEP_TREE_MATCH + "/.hgsubstate" ,
+161 SelectorUtils.DEEP_TREE_MATCH + "/.hgtags" ,
+162
+163 SelectorUtils.DEEP_TREE_MATCH + "/.bzr" ,
+164 SelectorUtils.DEEP_TREE_MATCH + "/.bzr/" + SelectorUtils.DEEP_TREE_MATCH,
+165 SelectorUtils.DEEP_TREE_MATCH + "/.bzrignore" ,
+166
+167 SelectorUtils.DEEP_TREE_MATCH + "/.DS_Store"
+168 };
+169
+170
+171
+172
+173
+174
+175 public static final int MAX_LEVELS_OF_SYMLINKS = 5;
+176
+177
+178
+179 public static final String DOES_NOT_EXIST_POSTFIX = " does not exist." ;
+180
+181
+182
+183
+184 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+185
+186
+187
+188
+189 private static final SymbolicLinkUtils SYMLINK_UTILS
+190 = SymbolicLinkUtils.getSymbolicLinkUtils();
+191
+192
+193
+194
+195
+196
+197 private static final Set<String> defaultExcludes = new HashSet<String>();
+198
+199 static {
+200 resetDefaultExcludes();
+201 }
+202
+203
+204
+205
+206
+207 protected File basedir;
+208
+209
+210
+211
+212 protected String[] includes;
+213
+214
+215
+216
+217 protected String[] excludes;
+218
+219
+220
+221
+222 protected FileSelector [] selectors = null ;
+223
+224
+225
+226
+227 protected Vector<String> filesIncluded;
+228
+229
+230
+231
+232 protected Vector<String> filesNotIncluded;
+233
+234
+235
+236
+237 protected Vector<String> filesExcluded;
+238
+239
+240
+241
+242 protected Vector<String> dirsIncluded;
+243
+244
+245
+246
+247 protected Vector<String> dirsNotIncluded;
+248
+249
+250
+251
+252 protected Vector<String> dirsExcluded;
+253
+254
+255
+256
+257 protected Vector<String> filesDeselected;
+258
+259
+260
+261
+262 protected Vector<String> dirsDeselected;
+263
+264
+265
+266
+267 protected boolean haveSlowResults = false;
+268
+269
+270
+271
+272 protected boolean isCaseSensitive = true ;
+273
+274
+275
+276
+277
+278
+279 protected boolean errorOnMissingDir = true ;
+280
+281
+282
+283
+284
+285
+286 private boolean followSymlinks = true ;
+287
+288
+289
+290
+291 protected boolean everythingIncluded = true ;
+292
+293
+294
+295
+296
+297
+298
+299 private Set<String> scannedDirs = new HashSet<String>();
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316 private Map<String, TokenizedPath> includeNonPatterns = new HashMap<String, TokenizedPath>();
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333 private Map<String, TokenizedPath> excludeNonPatterns = new HashMap<String, TokenizedPath>();
+334
+335
+336
+337
+338
+339
+340
+341
+342 private TokenizedPattern [] includePatterns;
+343
+344
+345
+346
+347
+348
+349
+350
+351 private TokenizedPattern [] excludePatterns;
+352
+353
+354
+355
+356
+357
+358 private boolean areNonPatternSetsReady = false;
+359
+360
+361
+362
+363
+364
+365 private boolean scanning = false;
+366
+367
+368
+369
+370
+371
+372 private Object scanLock = new Object();
+373
+374
+375
+376
+377
+378
+379 private boolean slowScanning = false;
+380
+381
+382
+383
+384
+385
+386 private Object slowScanLock = new Object();
+387
+388
+389
+390
+391
+392
+393 private IllegalStateException illegal = null ;
+394
+395
+396
+397
+398
+399
+400 private int maxLevelsOfSymlinks = MAX_LEVELS_OF_SYMLINKS;
+401
+402
+403
+404
+405
+406
+407
+408 private Set<String> notFollowedSymlinks = new HashSet<String>();
+409
+410
+411
+412
+413 public DirectoryScanner () {
+414 }
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427 protected static boolean matchPatternStart(String pattern, String str) {
+428 return SelectorUtils.matchPatternStart(pattern, str);
+429 }
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443 protected static boolean matchPatternStart(String pattern, String str,
+444 boolean isCaseSensitive) {
+445 return SelectorUtils.matchPatternStart(pattern, str, isCaseSensitive);
+446 }
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456 protected static boolean matchPath(String pattern, String str) {
+457 return SelectorUtils.matchPath(pattern, str);
+458 }
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469 protected static boolean matchPath(String pattern, String str,
+470 boolean isCaseSensitive) {
+471 return SelectorUtils.matchPath(pattern, str, isCaseSensitive);
+472 }
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484 public static boolean match(String pattern, String str) {
+485 return SelectorUtils.match(pattern, str);
+486 }
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500 protected static boolean match(String pattern, String str,
+501 boolean isCaseSensitive) {
+502 return SelectorUtils.match(pattern, str, isCaseSensitive);
+503 }
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513 public static String[] getDefaultExcludes() {
+514 synchronized (defaultExcludes) {
+515 return (String[]) defaultExcludes.toArray(new String[defaultExcludes
+516 .size()]);
+517 }
+518 }
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528 public static boolean addDefaultExclude(String s) {
+529 synchronized (defaultExcludes) {
+530 return defaultExcludes.add(s);
+531 }
+532 }
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543 public static boolean removeDefaultExclude(String s) {
+544 synchronized (defaultExcludes) {
+545 return defaultExcludes.remove(s);
+546 }
+547 }
+548
+549
+550
+551
+552
+553
+554 public static void resetDefaultExcludes() {
+555 synchronized (defaultExcludes) {
+556 defaultExcludes.clear();
+557 for (int i = 0; i < DEFAULTEXCLUDES.length; i++) {
+558 defaultExcludes.add(DEFAULTEXCLUDES[i]);
+559 }
+560 }
+561 }
+562
+563
+564
+565
+566
+567
+568
+569
+570 public void setBasedir(String basedir) {
+571 setBasedir(basedir == null ? (File) null
+572 : new File(basedir.replace('/', File.separatorChar).replace(
+573 '\\', File.separatorChar)));
+574 }
+575
+576
+577
+578
+579
+580
+581 public synchronized void setBasedir(File basedir) {
+582 this .basedir = basedir;
+583 }
+584
+585
+586
+587
+588
+589
+590 public synchronized File getBasedir() {
+591 return basedir;
+592 }
+593
+594
+595
+596
+597
+598
+599
+600 public synchronized boolean isCaseSensitive() {
+601 return isCaseSensitive;
+602 }
+603
+604
+605
+606
+607
+608
+609 public synchronized void setCaseSensitive(boolean isCaseSensitive) {
+610 this .isCaseSensitive = isCaseSensitive;
+611 }
+612
+613
+614
+615
+616
+617
+618
+619 public void setErrorOnMissingDir(boolean errorOnMissingDir) {
+620 this .errorOnMissingDir = errorOnMissingDir;
+621 }
+622
+623
+624
+625
+626
+627
+628
+629
+630 public synchronized boolean isFollowSymlinks() {
+631 return followSymlinks;
+632 }
+633
+634
+635
+636
+637
+638
+639 public synchronized void setFollowSymlinks(boolean followSymlinks) {
+640 this .followSymlinks = followSymlinks;
+641 }
+642
+643
+644
+645
+646
+647
+648 public void setMaxLevelsOfSymlinks(int max) {
+649 maxLevelsOfSymlinks = max;
+650 }
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661 public synchronized void setIncludes(String[] includes) {
+662 if (includes == null ) {
+663 this .includes = null ;
+664 } else {
+665 this .includes = new String[includes.length];
+666 for (int i = 0; i < includes.length; i++) {
+667 this .includes[i] = normalizePattern(includes[i]);
+668 }
+669 }
+670 }
+671
+672 public synchronized void setIncludes(String include) {
+673 if (include == null ) {
+674 this .includes = null ;
+675 } else {
+676 this .includes = new String[1];
+677 this .includes[0] = normalizePattern(include);
+678 }
+679 }
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690 public synchronized void setExcludes(String[] excludes) {
+691 if (excludes == null ) {
+692 this .excludes = null ;
+693 } else {
+694 this .excludes = new String[excludes.length];
+695 for (int i = 0; i < excludes.length; i++) {
+696 this .excludes[i] = normalizePattern(excludes[i]);
+697 }
+698 }
+699 }
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712 public synchronized void addExcludes(String[] excludes) {
+713 if (excludes != null && excludes.length > 0) {
+714 if (this .excludes != null && this .excludes.length > 0) {
+715 String[] tmp = new String[excludes.length
+716 + this .excludes.length];
+717 System.arraycopy(this .excludes, 0, tmp, 0,
+718 this .excludes.length);
+719 for (int i = 0; i < excludes.length; i++) {
+720 tmp[this .excludes.length + i]
+721 = normalizePattern(excludes[i]);
+722 }
+723 this .excludes = tmp;
+724 } else {
+725 setExcludes(excludes);
+726 }
+727 }
+728 }
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739 private static String normalizePattern(String p) {
+740 String pattern = p.replace('/', File.separatorChar)
+741 .replace('\\', File.separatorChar);
+742 if (pattern.endsWith(File.separator)) {
+743 pattern += SelectorUtils.DEEP_TREE_MATCH;
+744 }
+745 return pattern;
+746 }
+747
+748
+749
+750
+751
+752
+753 public synchronized void setSelectors(FileSelector [] selectors) {
+754 this .selectors = selectors;
+755 }
+756
+757
+758
+759
+760
+761
+762 public synchronized boolean isEverythingIncluded() {
+763 return everythingIncluded;
+764 }
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774 public void scan() throws IllegalStateException {
+775 synchronized (scanLock) {
+776 if (scanning) {
+777 while (scanning) {
+778 try {
+779 scanLock.wait();
+780 } catch (InterruptedException e) {
+781 continue ;
+782 }
+783 }
+784 if (illegal != null ) {
+785 throw illegal;
+786 }
+787 return ;
+788 }
+789 scanning = true ;
+790 }
+791 File savedBase = basedir;
+792 try {
+793 synchronized (this ) {
+794 illegal = null ;
+795 clearResults();
+796
+797
+798 boolean nullIncludes = (includes == null );
+799 includes = nullIncludes
+800 ? new String[]{SelectorUtils.DEEP_TREE_MATCH} : includes;
+801 boolean nullExcludes = (excludes == null );
+802 excludes = nullExcludes ? new String[0] : excludes;
+803
+804 if (basedir != null && !followSymlinks
+805 && SYMLINK_UTILS.isSymbolicLink(basedir)) {
+806 notFollowedSymlinks.add(basedir.getAbsolutePath());
+807 basedir = null ;
+808 }
+809
+810 if (basedir == null ) {
+811
+812 if (nullIncludes) {
+813 return ;
+814 }
+815 } else {
+816 if (!basedir.exists()) {
+817 if (errorOnMissingDir) {
+818 illegal = new IllegalStateException("basedir "
+819 + basedir
+820 + DOES_NOT_EXIST_POSTFIX);
+821 } else {
+822
+823 return ;
+824 }
+825 } else if (!basedir.isDirectory()) {
+826 illegal = new IllegalStateException("basedir "
+827 + basedir
+828 + " is not a"
+829 + " directory." );
+830 }
+831 if (illegal != null ) {
+832 throw illegal;
+833 }
+834 }
+835 if (isIncluded(TokenizedPath.EMPTY_PATH)) {
+836 if (!isExcluded(TokenizedPath.EMPTY_PATH)) {
+837 if (isSelected("" , basedir)) {
+838 dirsIncluded.addElement("" );
+839 } else {
+840 dirsDeselected.addElement("" );
+841 }
+842 } else {
+843 dirsExcluded.addElement("" );
+844 }
+845 } else {
+846 dirsNotIncluded.addElement("" );
+847 }
+848 checkIncludePatterns();
+849 clearCaches();
+850 includes = nullIncludes ? null : includes;
+851 excludes = nullExcludes ? null : excludes;
+852 }
+853 } catch (IOException ex) {
+854 throw new BuildException (ex);
+855 } finally {
+856 basedir = savedBase;
+857 synchronized (scanLock) {
+858 scanning = false;
+859 scanLock.notifyAll();
+860 }
+861 }
+862 }
+863
+864
+865
+866
+867
+868
+869 private void checkIncludePatterns() {
+870 ensureNonPatternSetsReady();
+871 Map<TokenizedPath, String> newroots = new HashMap<TokenizedPath, String>();
+872
+873
+874
+875 for (int i = 0; i < includePatterns.length; i++) {
+876 String pattern = includePatterns[i].toString();
+877 if (!shouldSkipPattern(pattern)) {
+878 newroots.put(includePatterns[i].rtrimWildcardTokens(),
+879 pattern);
+880 }
+881 }
+882 for (Map.Entry<String, TokenizedPath> entry : includeNonPatterns.entrySet()) {
+883 String pattern = entry.getKey();
+884 if (!shouldSkipPattern(pattern)) {
+885 newroots.put(entry.getValue(), pattern);
+886 }
+887 }
+888
+889 if (newroots.containsKey(TokenizedPath.EMPTY_PATH)
+890 && basedir != null ) {
+891
+892 scandir(basedir, "" , true );
+893 } else {
+894 File canonBase = null ;
+895 if (basedir != null ) {
+896 try {
+897 canonBase = basedir.getCanonicalFile();
+898 } catch (IOException ex) {
+899 throw new BuildException (ex);
+900 }
+901 }
+902
+903
+904 for (Map.Entry<TokenizedPath, String> entry : newroots.entrySet()) {
+905 TokenizedPath currentPath = entry.getKey();
+906 String currentelement = currentPath.toString();
+907 if (basedir == null
+908 && !FileUtils.isAbsolutePath(currentelement)) {
+909 continue ;
+910 }
+911 File myfile = new File(basedir, currentelement);
+912
+913 if (myfile.exists()) {
+914
+915
+916
+917 try {
+918 String path = (basedir == null )
+919 ? myfile.getCanonicalPath()
+920 : FILE_UTILS.removeLeadingPath(canonBase,
+921 myfile.getCanonicalFile());
+922 if (!path.equals(currentelement) || ON_VMS) {
+923 myfile = currentPath.findFile(basedir, true );
+924 if (myfile != null && basedir != null ) {
+925 currentelement = FILE_UTILS.removeLeadingPath(
+926 basedir, myfile);
+927 if (!currentPath.toString()
+928 .equals(currentelement)) {
+929 currentPath
+930 = new TokenizedPath (currentelement);
+931 }
+932 }
+933 }
+934 } catch (IOException ex) {
+935 throw new BuildException (ex);
+936 }
+937 }
+938
+939 if ((myfile == null || !myfile.exists()) && !isCaseSensitive()) {
+940 File f = currentPath.findFile(basedir, false);
+941 if (f != null && f.exists()) {
+942
+943
+944 currentelement = (basedir == null )
+945 ? f.getAbsolutePath()
+946 : FILE_UTILS.removeLeadingPath(basedir, f);
+947 myfile = f;
+948 currentPath = new TokenizedPath (currentelement);
+949 }
+950 }
+951
+952 if (myfile != null && myfile.exists()) {
+953 if (!followSymlinks && currentPath.isSymlink(basedir)) {
+954 accountForNotFollowedSymlink(currentPath, myfile);
+955 continue ;
+956 }
+957 if (myfile.isDirectory()) {
+958 if (isIncluded(currentPath)
+959 && currentelement.length() > 0) {
+960 accountForIncludedDir(currentPath, myfile, true );
+961 } else {
+962 scandir(myfile, currentPath, true );
+963 }
+964 } else if (myfile.isFile()) {
+965 String originalpattern = (String) entry.getValue();
+966 boolean included = isCaseSensitive()
+967 ? originalpattern.equals(currentelement)
+968 : originalpattern.equalsIgnoreCase(currentelement);
+969 if (included) {
+970 accountForIncludedFile(currentPath, myfile);
+971 }
+972 }
+973 }
+974 }
+975 }
+976 }
+977
+978
+979
+980
+981
+982
+983 private boolean shouldSkipPattern(String pattern) {
+984 if (FileUtils.isAbsolutePath(pattern)) {
+985
+986 if (basedir != null
+987 && !SelectorUtils.matchPatternStart(pattern,
+988 basedir.getAbsolutePath(),
+989 isCaseSensitive())) {
+990 return true ;
+991 }
+992 } else if (basedir == null ) {
+993
+994 return true ;
+995 }
+996 return false;
+997 }
+998
+999
+1000
+1001
+1002 protected synchronized void clearResults() {
+1003 filesIncluded = new VectorSet<String>();
+1004 filesNotIncluded = new VectorSet<String>();
+1005 filesExcluded = new VectorSet<String>();
+1006 filesDeselected = new VectorSet<String>();
+1007 dirsIncluded = new VectorSet<String>();
+1008 dirsNotIncluded = new VectorSet<String>();
+1009 dirsExcluded = new VectorSet<String>();
+1010 dirsDeselected = new VectorSet<String>();
+1011 everythingIncluded = (basedir != null );
+1012 scannedDirs.clear();
+1013 notFollowedSymlinks.clear();
+1014 }
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023 protected void slowScan() {
+1024 synchronized (slowScanLock) {
+1025 if (haveSlowResults) {
+1026 return ;
+1027 }
+1028 if (slowScanning) {
+1029 while (slowScanning) {
+1030 try {
+1031 slowScanLock.wait();
+1032 } catch (InterruptedException e) {
+1033
+1034 }
+1035 }
+1036 return ;
+1037 }
+1038 slowScanning = true ;
+1039 }
+1040 try {
+1041 synchronized (this ) {
+1042
+1043
+1044 boolean nullIncludes = (includes == null );
+1045 includes = nullIncludes
+1046 ? new String[]{SelectorUtils.DEEP_TREE_MATCH} : includes;
+1047 boolean nullExcludes = (excludes == null );
+1048 excludes = nullExcludes ? new String[0] : excludes;
+1049
+1050 String[] excl = new String[dirsExcluded.size()];
+1051 dirsExcluded.copyInto(excl);
+1052
+1053 String[] notIncl = new String[dirsNotIncluded.size()];
+1054 dirsNotIncluded.copyInto(notIncl);
+1055
+1056 ensureNonPatternSetsReady();
+1057
+1058 processSlowScan(excl);
+1059 processSlowScan(notIncl);
+1060 clearCaches();
+1061 includes = nullIncludes ? null : includes;
+1062 excludes = nullExcludes ? null : excludes;
+1063 }
+1064 } finally {
+1065 synchronized (slowScanLock) {
+1066 haveSlowResults = true ;
+1067 slowScanning = false;
+1068 slowScanLock.notifyAll();
+1069 }
+1070 }
+1071 }
+1072
+1073 private void processSlowScan(String[] arr) {
+1074 for (int i = 0; i < arr.length; i++) {
+1075 TokenizedPath path = new TokenizedPath (arr[i]);
+1076 if (!couldHoldIncluded(path) || contentsExcluded(path)) {
+1077 scandir(new File(basedir, arr[i]), path, false);
+1078 }
+1079 }
+1080 }
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100 protected void scandir(File dir, String vpath, boolean fast) {
+1101 scandir(dir, new TokenizedPath (vpath), fast);
+1102 }
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122 private void scandir(File dir, TokenizedPath path, boolean fast) {
+1123 if (dir == null ) {
+1124 throw new BuildException ("dir must not be null." );
+1125 }
+1126 String[] newfiles = dir.list();
+1127 if (newfiles == null ) {
+1128 if (!dir.exists()) {
+1129 throw new BuildException (dir + DOES_NOT_EXIST_POSTFIX);
+1130 } else if (!dir.isDirectory()) {
+1131 throw new BuildException (dir + " is not a directory." );
+1132 } else {
+1133 throw new BuildException ("IO error scanning directory '"
+1134 + dir.getAbsolutePath() + "'" );
+1135 }
+1136 }
+1137 scandir(dir, path, fast, newfiles, new LinkedList<String>());
+1138 }
+1139
+1140 private void scandir(File dir, TokenizedPath path, boolean fast,
+1141 String[] newfiles, LinkedList<String> directoryNamesFollowed) {
+1142 String vpath = path.toString();
+1143 if (vpath.length() > 0 && !vpath.endsWith(File.separator)) {
+1144 vpath += File.separator;
+1145 }
+1146
+1147
+1148 if (fast && hasBeenScanned(vpath)) {
+1149 return ;
+1150 }
+1151 if (!followSymlinks) {
+1152 ArrayList<String> noLinks = new ArrayList<String>();
+1153 for (int i = 0; i < newfiles.length; i++) {
+1154 try {
+1155 if (SYMLINK_UTILS.isSymbolicLink(dir, newfiles[i])) {
+1156 String name = vpath + newfiles[i];
+1157 File file = new File(dir, newfiles[i]);
+1158 if (file.isDirectory()) {
+1159 dirsExcluded.addElement(name);
+1160 } else if (file.isFile()) {
+1161 filesExcluded.addElement(name);
+1162 }
+1163 accountForNotFollowedSymlink(name, file);
+1164 } else {
+1165 noLinks.add(newfiles[i]);
+1166 }
+1167 } catch (IOException ioe) {
+1168 String msg = "IOException caught while checking "
+1169 + "for links, couldn't get canonical path!" ;
+1170
+1171 System.err.println(msg);
+1172 noLinks.add(newfiles[i]);
+1173 }
+1174 }
+1175 newfiles = (String[]) (noLinks.toArray(new String[noLinks.size()]));
+1176 } else {
+1177 directoryNamesFollowed.addFirst(dir.getName());
+1178 }
+1179
+1180 for (int i = 0; i < newfiles.length; i++) {
+1181 String name = vpath + newfiles[i];
+1182 TokenizedPath newPath = new TokenizedPath (path, newfiles[i]);
+1183 File file = new File(dir, newfiles[i]);
+1184 String[] children = file.list();
+1185 if (children == null || (children.length == 0 && file.isFile())) {
+1186 if (isIncluded(newPath)) {
+1187 accountForIncludedFile(newPath, file);
+1188 } else {
+1189 everythingIncluded = false;
+1190 filesNotIncluded.addElement(name);
+1191 }
+1192 } else if (file.isDirectory()) {
+1193
+1194 if (followSymlinks
+1195 && causesIllegalSymlinkLoop(newfiles[i], dir,
+1196 directoryNamesFollowed)) {
+1197
+1198 System.err.println("skipping symbolic link "
+1199 + file.getAbsolutePath()
+1200 + " -- too many levels of symbolic"
+1201 + " links." );
+1202 notFollowedSymlinks.add(file.getAbsolutePath());
+1203 continue ;
+1204 }
+1205
+1206 if (isIncluded(newPath)) {
+1207 accountForIncludedDir(newPath, file, fast, children,
+1208 directoryNamesFollowed);
+1209 } else {
+1210 everythingIncluded = false;
+1211 dirsNotIncluded.addElement(name);
+1212 if (fast && couldHoldIncluded(newPath)
+1213 && !contentsExcluded(newPath)) {
+1214 scandir(file, newPath, fast, children,
+1215 directoryNamesFollowed);
+1216 }
+1217 }
+1218 if (!fast) {
+1219 scandir(file, newPath, fast, children, directoryNamesFollowed);
+1220 }
+1221 }
+1222 }
+1223
+1224 if (followSymlinks) {
+1225 directoryNamesFollowed.removeFirst();
+1226 }
+1227 }
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235 private void accountForIncludedFile(TokenizedPath name, File file) {
+1236 processIncluded(name, file, filesIncluded, filesExcluded,
+1237 filesDeselected);
+1238 }
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247 private void accountForIncludedDir(TokenizedPath name, File file,
+1248 boolean fast) {
+1249 processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
+1250 if (fast && couldHoldIncluded(name) && !contentsExcluded(name)) {
+1251 scandir(file, name, fast);
+1252 }
+1253 }
+1254
+1255 private void accountForIncludedDir(TokenizedPath name,
+1256 File file, boolean fast,
+1257 String[] children,
+1258 LinkedList<String> directoryNamesFollowed) {
+1259 processIncluded(name, file, dirsIncluded, dirsExcluded, dirsDeselected);
+1260 if (fast && couldHoldIncluded(name) && !contentsExcluded(name)) {
+1261 scandir(file, name, fast, children, directoryNamesFollowed);
+1262 }
+1263 }
+1264
+1265 private void accountForNotFollowedSymlink(String name, File file) {
+1266 accountForNotFollowedSymlink(new TokenizedPath (name), file);
+1267 }
+1268
+1269 private void accountForNotFollowedSymlink(TokenizedPath name, File file) {
+1270 if (!isExcluded(name)
+1271 && (isIncluded(name)
+1272 || (file.isDirectory() && couldHoldIncluded(name)
+1273 && !contentsExcluded(name)))) {
+1274 notFollowedSymlinks.add(file.getAbsolutePath());
+1275 }
+1276 }
+1277
+1278 private void processIncluded(TokenizedPath path,
+1279 File file, Vector<String> inc, Vector<String> exc,
+1280 Vector<String> des) {
+1281 String name = path.toString();
+1282 if (inc.contains(name) || exc.contains(name) || des.contains(name)) {
+1283 return ;
+1284 }
+1285
+1286 boolean included = false;
+1287 if (isExcluded(path)) {
+1288 exc.add(name);
+1289 } else if (isSelected(name, file)) {
+1290 included = true ;
+1291 inc.add(name);
+1292 } else {
+1293 des.add(name);
+1294 }
+1295 everythingIncluded &= included;
+1296 }
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305 protected boolean isIncluded(String name) {
+1306 return isIncluded(new TokenizedPath (name));
+1307 }
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316 private boolean isIncluded(TokenizedPath path) {
+1317 ensureNonPatternSetsReady();
+1318
+1319 if (isCaseSensitive()
+1320 ? includeNonPatterns.containsKey(path.toString())
+1321 : includeNonPatterns.containsKey(path.toString().toUpperCase())) {
+1322 return true ;
+1323 }
+1324 for (int i = 0; i < includePatterns.length; i++) {
+1325 if (includePatterns[i].matchPath(path, isCaseSensitive())) {
+1326 return true ;
+1327 }
+1328 }
+1329 return false;
+1330 }
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339 protected boolean couldHoldIncluded(String name) {
+1340 return couldHoldIncluded(new TokenizedPath (name));
+1341 }
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350 private boolean couldHoldIncluded(TokenizedPath tokenizedName) {
+1351 for (int i = 0; i < includePatterns.length; i++) {
+1352 if (couldHoldIncluded(tokenizedName, includePatterns[i])) {
+1353 return true ;
+1354 }
+1355 }
+1356 for (Iterator<TokenizedPath> iter = includeNonPatterns.values().iterator();
+1357 iter.hasNext();) {
+1358 if (couldHoldIncluded(tokenizedName,
+1359 iter.next().toPattern())) {
+1360 return true ;
+1361 }
+1362 }
+1363 return false;
+1364 }
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373 private boolean couldHoldIncluded(TokenizedPath tokenizedName,
+1374 TokenizedPattern tokenizedInclude) {
+1375 return tokenizedInclude.matchStartOf(tokenizedName, isCaseSensitive())
+1376 && isMorePowerfulThanExcludes(tokenizedName.toString())
+1377 && isDeeper(tokenizedInclude, tokenizedName);
+1378 }
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388 private boolean isDeeper(TokenizedPattern pattern, TokenizedPath name) {
+1389 return pattern.containsPattern(SelectorUtils.DEEP_TREE_MATCH)
+1390 || pattern.depth() > name.depth();
+1391 }
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405 private boolean isMorePowerfulThanExcludes(String name) {
+1406 final String soughtexclude
+1407 = name + File.separatorChar + SelectorUtils.DEEP_TREE_MATCH;
+1408 for (int counter = 0; counter < excludePatterns.length; counter++) {
+1409 if (excludePatterns[counter].toString().equals(soughtexclude)) {
+1410 return false;
+1411 }
+1412 }
+1413 return true ;
+1414 }
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422 boolean contentsExcluded(TokenizedPath path) {
+1423 for (int i = 0; i < excludePatterns.length; i++) {
+1424 if (excludePatterns[i].endsWith(SelectorUtils.DEEP_TREE_MATCH)
+1425 && excludePatterns[i].withoutLastToken()
+1426 .matchPath(path, isCaseSensitive())) {
+1427 return true ;
+1428 }
+1429 }
+1430 return false;
+1431 }
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440 protected boolean isExcluded(String name) {
+1441 return isExcluded(new TokenizedPath (name));
+1442 }
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451 private boolean isExcluded(TokenizedPath name) {
+1452 ensureNonPatternSetsReady();
+1453
+1454 if (isCaseSensitive()
+1455 ? excludeNonPatterns.containsKey(name.toString())
+1456 : excludeNonPatterns.containsKey(name.toString().toUpperCase())) {
+1457 return true ;
+1458 }
+1459 for (int i = 0; i < excludePatterns.length; i++) {
+1460 if (excludePatterns[i].matchPath(name, isCaseSensitive())) {
+1461 return true ;
+1462 }
+1463 }
+1464 return false;
+1465 }
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475 protected boolean isSelected(String name, File file) {
+1476 if (selectors != null ) {
+1477 for (int i = 0; i < selectors.length; i++) {
+1478 if (!selectors[i].isSelected(basedir, name, file)) {
+1479 return false;
+1480 }
+1481 }
+1482 }
+1483 return true ;
+1484 }
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493 public String[] getIncludedFiles() {
+1494 String[] files;
+1495 synchronized (this ) {
+1496 if (filesIncluded == null ) {
+1497 throw new IllegalStateException("Must call scan() first" );
+1498 }
+1499 files = new String[filesIncluded.size()];
+1500 filesIncluded.copyInto(files);
+1501 }
+1502 Arrays.sort(files);
+1503 return files;
+1504 }
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512 public synchronized int getIncludedFilesCount() {
+1513 if (filesIncluded == null ) {
+1514 throw new IllegalStateException("Must call scan() first" );
+1515 }
+1516 return filesIncluded.size();
+1517 }
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527 public synchronized String[] getNotIncludedFiles() {
+1528 slowScan();
+1529 String[] files = new String[filesNotIncluded.size()];
+1530 filesNotIncluded.copyInto(files);
+1531 return files;
+1532 }
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544 public synchronized String[] getExcludedFiles() {
+1545 slowScan();
+1546 String[] files = new String[filesExcluded.size()];
+1547 filesExcluded.copyInto(files);
+1548 return files;
+1549 }
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563 public synchronized String[] getDeselectedFiles() {
+1564 slowScan();
+1565 String[] files = new String[filesDeselected.size()];
+1566 filesDeselected.copyInto(files);
+1567 return files;
+1568 }
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577 public String[] getIncludedDirectories() {
+1578 String[] directories;
+1579 synchronized (this ) {
+1580 if (dirsIncluded == null ) {
+1581 throw new IllegalStateException("Must call scan() first" );
+1582 }
+1583 directories = new String[dirsIncluded.size()];
+1584 dirsIncluded.copyInto(directories);
+1585 }
+1586 Arrays.sort(directories);
+1587 return directories;
+1588 }
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596 public synchronized int getIncludedDirsCount() {
+1597 if (dirsIncluded == null ) {
+1598 throw new IllegalStateException("Must call scan() first" );
+1599 }
+1600 return dirsIncluded.size();
+1601 }
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611 public synchronized String[] getNotIncludedDirectories() {
+1612 slowScan();
+1613 String[] directories = new String[dirsNotIncluded.size()];
+1614 dirsNotIncluded.copyInto(directories);
+1615 return directories;
+1616 }
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628 public synchronized String[] getExcludedDirectories() {
+1629 slowScan();
+1630 String[] directories = new String[dirsExcluded.size()];
+1631 dirsExcluded.copyInto(directories);
+1632 return directories;
+1633 }
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647 public synchronized String[] getDeselectedDirectories() {
+1648 slowScan();
+1649 String[] directories = new String[dirsDeselected.size()];
+1650 dirsDeselected.copyInto(directories);
+1651 return directories;
+1652 }
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662 public synchronized String[] getNotFollowedSymlinks() {
+1663 String[] links;
+1664 synchronized (this ) {
+1665 links = (String[]) notFollowedSymlinks
+1666 .toArray(new String[notFollowedSymlinks.size()]);
+1667 }
+1668 Arrays.sort(links);
+1669 return links;
+1670 }
+1671
+1672
+1673
+1674
+1675 public synchronized void addDefaultExcludes() {
+1676 int excludesLength = excludes == null ? 0 : excludes.length;
+1677 String[] newExcludes;
+1678 String[] defaultExcludesTemp = getDefaultExcludes();
+1679 newExcludes = new String[excludesLength + defaultExcludesTemp.length];
+1680 if (excludesLength > 0) {
+1681 System.arraycopy(excludes, 0, newExcludes, 0, excludesLength);
+1682 }
+1683 for (int i = 0; i < defaultExcludesTemp.length; i++) {
+1684 newExcludes[i + excludesLength]
+1685 = defaultExcludesTemp[i].replace('/', File.separatorChar)
+1686 .replace('\\', File.separatorChar);
+1687 }
+1688 excludes = newExcludes;
+1689 }
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699 public synchronized Resource getResource(String name) {
+1700 return new FileResource (basedir, name);
+1701 }
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711 private boolean hasBeenScanned(String vpath) {
+1712 return !scannedDirs.add(vpath);
+1713 }
+1714
+1715
+1716
+1717
+1718
+1719
+1720 Set<String> getScannedDirs() {
+1721 return scannedDirs;
+1722 }
+1723
+1724
+1725
+1726
+1727
+1728
+1729 private synchronized void clearCaches() {
+1730 includeNonPatterns.clear();
+1731 excludeNonPatterns.clear();
+1732 includePatterns = null ;
+1733 excludePatterns = null ;
+1734 areNonPatternSetsReady = false;
+1735 }
+1736
+1737
+1738
+1739
+1740
+1741
+1742 synchronized void ensureNonPatternSetsReady() {
+1743 if (!areNonPatternSetsReady) {
+1744 includePatterns = fillNonPatternSet(includeNonPatterns, includes);
+1745 excludePatterns = fillNonPatternSet(excludeNonPatterns, excludes);
+1746 areNonPatternSetsReady = true ;
+1747 }
+1748 }
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757 private TokenizedPattern [] fillNonPatternSet(Map<String, TokenizedPath> map, String[] patterns) {
+1758 ArrayList<TokenizedPattern> al = new ArrayList<TokenizedPattern>(patterns.length);
+1759 for (int i = 0; i < patterns.length; i++) {
+1760 if (!SelectorUtils.hasWildcards(patterns[i])) {
+1761 String s = isCaseSensitive()
+1762 ? patterns[i] : patterns[i].toUpperCase();
+1763 map.put(s, new TokenizedPath (s));
+1764 } else {
+1765 al.add(new TokenizedPattern (patterns[i]));
+1766 }
+1767 }
+1768 return (TokenizedPattern[]) al.toArray(new TokenizedPattern[al.size()]);
+1769 }
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781 private boolean causesIllegalSymlinkLoop(String dirName, File parent,
+1782 LinkedList<String> directoryNamesFollowed) {
+1783 try {
+1784 if (directoryNamesFollowed.size() >= maxLevelsOfSymlinks
+1785 && CollectionUtils.frequency(directoryNamesFollowed, dirName)
+1786 >= maxLevelsOfSymlinks
+1787 && SYMLINK_UTILS.isSymbolicLink(parent, dirName)) {
+1788
+1789 ArrayList<String> files = new ArrayList<String>();
+1790 File f = FILE_UTILS.resolveFile(parent, dirName);
+1791 String target = f.getCanonicalPath();
+1792 files.add(target);
+1793
+1794 String relPath = "" ;
+1795 for (String dir : directoryNamesFollowed) {
+1796 relPath += "../" ;
+1797 if (dirName.equals(dir)) {
+1798 f = FILE_UTILS.resolveFile(parent, relPath + dir);
+1799 files.add(f.getCanonicalPath());
+1800 if (files.size() > maxLevelsOfSymlinks
+1801 && CollectionUtils.frequency(files, target)
+1802 > maxLevelsOfSymlinks) {
+1803 return true ;
+1804 }
+1805 }
+1806 }
+1807
+1808 }
+1809 return false;
+1810 } catch (IOException ex) {
+1811 throw new BuildException ("Caught error while checking for"
+1812 + " symbolic links" , ex);
+1813 }
+1814 }
+1815
+1816 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/FileScanner.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/FileScanner.html
new file mode 100644
index 000000000..a2e273346
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/FileScanner.html
@@ -0,0 +1,171 @@
+
+
+
+FileScanner xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant;
+19
+20 import java.io.File;
+21
+22
+23
+24
+25
+26
+27 public interface FileScanner {
+28
+29
+30
+31 void addDefaultExcludes();
+32
+33
+34
+35
+36
+37
+38
+39 File getBasedir();
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49 String[] getExcludedDirectories();
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60 String[] getExcludedFiles();
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70 String[] getIncludedDirectories();
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80 String[] getIncludedFiles();
+81
+82
+83
+84
+85
+86
+87
+88
+89 String[] getNotIncludedDirectories();
+90
+91
+92
+93
+94
+95
+96
+97
+98 String[] getNotIncludedFiles();
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108 void scan() throws IllegalStateException;
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119 void setBasedir(String basedir);
+120
+121
+122
+123
+124
+125
+126
+127
+128 void setBasedir(File basedir);
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138 void setExcludes(String[] excludes);
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149 void setIncludes(String[] includes);
+150
+151
+152
+153
+154
+155
+156
+157 void setCaseSensitive(boolean isCaseSensitive);
+158 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/Location.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/Location.html
new file mode 100644
index 000000000..cd1315cd1
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/Location.html
@@ -0,0 +1,191 @@
+
+
+
+Location xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant;
+20
+21 import java.io.Serializable;
+22 import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+23 import org.xml.sax.Locator;
+24
+25
+26
+27
+28
+29
+30
+31 public class Location implements Serializable {
+32 private static final long serialVersionUID = 1L;
+33
+34
+35 private final String fileName;
+36
+37 private final int lineNumber;
+38
+39 private final int columnNumber;
+40
+41
+42 public static final Location UNKNOWN_LOCATION = new Location ();
+43
+44 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+45
+46
+47
+48
+49 private Location () {
+50 this (null , 0, 0);
+51 }
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61 public Location (String fileName) {
+62 this (fileName, 0, 0);
+63 }
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73 public Location (Locator loc) {
+74 this (loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber());
+75 }
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89 public Location (String fileName, int lineNumber, int columnNumber) {
+90 if (fileName != null && fileName.startsWith("file:" )) {
+91 this .fileName = FILE_UTILS.fromURI(fileName);
+92 } else {
+93 this .fileName = fileName;
+94 }
+95 this .lineNumber = lineNumber;
+96 this .columnNumber = columnNumber;
+97 }
+98
+99
+100
+101
+102
+103 public String getFileName() {
+104 return fileName;
+105 }
+106
+107
+108
+109
+110
+111 public int getLineNumber() {
+112 return lineNumber;
+113 }
+114
+115
+116
+117
+118
+119 public int getColumnNumber() {
+120 return columnNumber;
+121 }
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133 public String toString() {
+134 StringBuffer buf = new StringBuffer();
+135
+136 if (fileName != null ) {
+137 buf.append(fileName);
+138
+139 if (lineNumber != 0) {
+140 buf.append(":" );
+141 buf.append(lineNumber);
+142 }
+143
+144 buf.append(": " );
+145 }
+146
+147 return buf.toString();
+148 }
+149
+150
+151
+152
+153
+154
+155
+156
+157 public boolean equals(Object other) {
+158 if (this == other) {
+159 return true ;
+160 }
+161 if (other == null ) {
+162 return false;
+163 }
+164 if (!(other.getClass() == getClass())) {
+165 return false;
+166 }
+167 return toString().equals(other.toString());
+168 }
+169
+170
+171
+172
+173
+174
+175 public int hashCode() {
+176 return toString().hashCode();
+177 }
+178 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/PathTokenizer.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/PathTokenizer.html
new file mode 100644
index 000000000..343aacfb2
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/PathTokenizer.html
@@ -0,0 +1,178 @@
+
+
+
+PathTokenizer xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant;
+19
+20 import java.io.File;
+21 import java.util.NoSuchElementException;
+22 import java.util.StringTokenizer;
+23 import org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os;
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33 public class PathTokenizer {
+34
+35
+36
+37 private StringTokenizer tokenizer;
+38
+39
+40
+41
+42
+43 private String lookahead = null ;
+44
+45
+46
+47
+48
+49
+50 private boolean onNetWare = Os.isFamily("netware" );
+51
+52
+53
+54
+55
+56 private boolean dosStyleFilesystem;
+57
+58
+59
+60
+61
+62
+63 public PathTokenizer (String path) {
+64 if (onNetWare) {
+65
+66
+67 tokenizer = new StringTokenizer(path, ":;" , true );
+68 } else {
+69
+70
+71 tokenizer = new StringTokenizer(path, ":;" , false);
+72 }
+73 dosStyleFilesystem = File.pathSeparatorChar == ';';
+74 }
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84 public boolean hasMoreTokens() {
+85 if (lookahead != null ) {
+86 return true ;
+87 }
+88
+89 return tokenizer.hasMoreTokens();
+90 }
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100 public String nextToken() throws NoSuchElementException {
+101 String token = null ;
+102 if (lookahead != null ) {
+103 token = lookahead;
+104 lookahead = null ;
+105 } else {
+106 token = tokenizer.nextToken().trim();
+107 }
+108
+109 if (!onNetWare) {
+110 if (token.length() == 1 && Character.isLetter(token.charAt(0))
+111 && dosStyleFilesystem
+112 && tokenizer.hasMoreTokens()) {
+113
+114
+115 String nextToken = tokenizer.nextToken().trim();
+116 if (nextToken.startsWith("\\" ) || nextToken.startsWith("/" )) {
+117
+118
+119
+120 token += ":" + nextToken;
+121 } else {
+122
+123 lookahead = nextToken;
+124 }
+125 }
+126 } else {
+127
+128
+129 if (token.equals(File.pathSeparator) || token.equals(":" )) {
+130
+131 token = tokenizer.nextToken().trim();
+132 }
+133
+134 if (tokenizer.hasMoreTokens()) {
+135
+136 String nextToken = tokenizer.nextToken().trim();
+137
+138
+139 if (!nextToken.equals(File.pathSeparator)) {
+140 if (nextToken.equals(":" )) {
+141 if (!token.startsWith("/" ) && !token.startsWith("\\" )
+142 && !token.startsWith("." )
+143 && !token.startsWith(".." )) {
+144
+145 String oneMore = tokenizer.nextToken().trim();
+146 if (!oneMore.equals(File.pathSeparator)) {
+147 token += ":" + oneMore;
+148 } else {
+149 token += ":" ;
+150 lookahead = oneMore;
+151 }
+152 }
+153
+154
+155 } else {
+156
+157 lookahead = nextToken;
+158 }
+159 }
+160 }
+161 }
+162 return token;
+163 }
+164 }
+165
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/ProjectComponent.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/ProjectComponent.html
new file mode 100644
index 000000000..a37a4c811
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/ProjectComponent.html
@@ -0,0 +1,174 @@
+
+
+
+ProjectComponent xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant;
+19
+20
+21
+22
+23
+24 public abstract class ProjectComponent implements Cloneable {
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41 protected Location location = Location.UNKNOWN_LOCATION;
+42
+43
+44
+45
+46
+47
+48 protected String description;
+49
+50
+51
+52
+53
+54 public ProjectComponent () {
+55 }
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86 public Location getLocation() {
+87 return location;
+88 }
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98 public void setLocation(Location location) {
+99 this .location = location;
+100 }
+101
+102
+103
+104
+105
+106
+107
+108
+109 public void setDescription(String desc) {
+110 description = desc;
+111 }
+112
+113
+114
+115
+116
+117
+118 public String getDescription() {
+119 return description;
+120 }
+121
+122
+123
+124
+125
+126
+127 public void log(String msg) {
+128
+129 }
+130
+131
+132
+133
+134
+135
+136
+137 public void log(String msg, int msgLevel) {
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148 }
+149
+150
+151
+152
+153
+154
+155 public Object clone() throws CloneNotSupportedException {
+156 ProjectComponent pc = (ProjectComponent) super .clone();
+157 pc.setLocation(getLocation());
+158
+159 return pc;
+160 }
+161 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/Locator.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/Locator.html
new file mode 100644
index 000000000..1ab5f62cd
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/Locator.html
@@ -0,0 +1,543 @@
+
+
+
+Locator xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.launch;
+19
+20 import java.net.MalformedURLException;
+21 import java.net.URL;
+22 import java.io.File;
+23 import java.io.FilenameFilter;
+24 import java.io.ByteArrayOutputStream;
+25 import java.io.UnsupportedEncodingException;
+26 import java.text.CharacterIterator;
+27 import java.text.StringCharacterIterator;
+28 import java.util.Locale;
+29
+30 import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50 public final class Locator {
+51
+52 private static final int NIBBLE = 4;
+53 private static final int NIBBLE_MASK = 0xF;
+54
+55 private static final int ASCII_SIZE = 128;
+56
+57 private static final int BYTE_SIZE = 256;
+58
+59 private static final int WORD = 16;
+60
+61 private static final int SPACE = 0x20;
+62 private static final int DEL = 0x7F;
+63
+64
+65
+66
+67 public static final String URI_ENCODING = "UTF-8" ;
+68
+69
+70
+71 private static boolean [] gNeedEscaping = new boolean [ASCII_SIZE];
+72
+73 private static char [] gAfterEscaping1 = new char [ASCII_SIZE];
+74
+75 private static char [] gAfterEscaping2 = new char [ASCII_SIZE];
+76 private static char [] gHexChs = {'0', '1', '2', '3', '4', '5', '6', '7',
+77 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+78
+79 public static final String ERROR_NOT_FILE_URI
+80 = "Can only handle valid file: URIs, not " ;
+81
+82
+83 static {
+84 for (int i = 0; i < SPACE; i++) {
+85 gNeedEscaping[i] = true ;
+86 gAfterEscaping1[i] = gHexChs[i >> NIBBLE];
+87 gAfterEscaping2[i] = gHexChs[i & NIBBLE_MASK];
+88 }
+89 gNeedEscaping[DEL] = true ;
+90 gAfterEscaping1[DEL] = '7';
+91 gAfterEscaping2[DEL] = 'F';
+92 char [] escChs = {' ', '<', '>', '#', '%', '"', '{', '}',
+93 '|', '\\', '^', '~', '[', ']', '`'};
+94 int len = escChs.length;
+95 char ch;
+96 for (int i = 0; i < len; i++) {
+97 ch = escChs[i];
+98 gNeedEscaping[ch] = true ;
+99 gAfterEscaping1[ch] = gHexChs[ch >> NIBBLE];
+100 gAfterEscaping2[ch] = gHexChs[ch & NIBBLE_MASK];
+101 }
+102 }
+103
+104
+105
+106 private Locator () {
+107 }
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118 public static File getClassSource(Class<?> c) {
+119 String classResource = c.getName().replace('.', '/') + ".class" ;
+120 return getResourceSource(c.getClassLoader(), classResource);
+121 }
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134 public static File getResourceSource(ClassLoader c, String resource) {
+135 if (c == null ) {
+136 c = Locator.class .getClassLoader();
+137 }
+138 URL url = null ;
+139 if (c == null ) {
+140 url = ClassLoader.getSystemResource(resource);
+141 } else {
+142 url = c.getResource(resource);
+143 }
+144 if (url != null ) {
+145 String u = url.toString();
+146 try {
+147 if (u.startsWith("jar:file:" )) {
+148 return new File(fromJarURI(u));
+149 } else if (u.startsWith("file:" )) {
+150 int tail = u.indexOf(resource);
+151 String dirName = u.substring(0, tail);
+152 return new File(fromURI(dirName));
+153 }
+154 } catch (IllegalArgumentException e) {
+155
+156 return null ;
+157 }
+158 }
+159 return null ;
+160 }
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181 public static String fromURI(String uri) {
+182 return fromURIJava13(uri);
+183
+184
+185
+186
+187
+188
+189
+190 }
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230 private static String fromURIJava13(String uri) {
+231
+232
+233 URL url = null ;
+234 try {
+235 url = new URL(uri);
+236 } catch (MalformedURLException emYouEarlEx) {
+237
+238 }
+239 if (url == null || !("file" .equals(url.getProtocol()))) {
+240 throw new IllegalArgumentException(ERROR_NOT_FILE_URI + uri);
+241 }
+242 StringBuffer buf = new StringBuffer(url.getHost());
+243 if (buf.length() > 0) {
+244 buf.insert(0, File.separatorChar).insert(0, File.separatorChar);
+245 }
+246 String file = url.getFile();
+247 int queryPos = file.indexOf('?');
+248 buf.append((queryPos < 0) ? file : file.substring(0, queryPos));
+249
+250 uri = buf.toString().replace('/', File.separatorChar);
+251
+252 if (File.pathSeparatorChar == ';' && uri.startsWith("\\" ) && uri.length() > 2
+253 && Character.isLetter(uri.charAt(1)) && uri.lastIndexOf(':') > -1) {
+254 uri = uri.substring(1);
+255 }
+256 String path = null ;
+257 try {
+258 path = decodeUri(uri);
+259
+260
+261 String cwd = System.getProperty("user.dir" );
+262 int posi = cwd.indexOf(':');
+263 boolean pathStartsWithFileSeparator = path.startsWith(File.separator);
+264 boolean pathStartsWithUNC = path.startsWith("" + File.separator + File.separator);
+265 if ((posi > 0) && pathStartsWithFileSeparator && !pathStartsWithUNC) {
+266 path = cwd.substring(0, posi + 1) + path;
+267 }
+268 } catch (UnsupportedEncodingException exc) {
+269
+270
+271 throw new IllegalStateException(
+272 "Could not convert URI " + uri + " to path: "
+273 + exc.getMessage());
+274 }
+275 return path;
+276 }
+277
+278
+279
+280
+281
+282
+283
+284
+285 public static String fromJarURI(String uri) {
+286 int pling = uri.indexOf("!/" );
+287 String jarName = uri.substring("jar:" .length(), pling);
+288 return fromURI(jarName);
+289 }
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299 public static String decodeUri(String uri) throws UnsupportedEncodingException {
+300 if (uri.indexOf('%') == -1) {
+301 return uri;
+302 }
+303 ByteArrayOutputStream sb = new ByteArrayOutputStream(uri.length());
+304 CharacterIterator iter = new StringCharacterIterator(uri);
+305 for (char c = iter.first(); c != CharacterIterator.DONE;
+306 c = iter.next()) {
+307 if (c == '%') {
+308 char c1 = iter.next();
+309 if (c1 != CharacterIterator.DONE) {
+310 int i1 = Character.digit(c1, WORD);
+311 char c2 = iter.next();
+312 if (c2 != CharacterIterator.DONE) {
+313 int i2 = Character.digit(c2, WORD);
+314 sb.write((char ) ((i1 << NIBBLE) + i2));
+315 }
+316 }
+317 } else if (c >= 0x0000 && c < 0x0080) {
+318 sb.write(c);
+319 } else {
+320 byte[] bytes = String.valueOf(c).getBytes(URI_ENCODING);
+321 sb.write(bytes, 0, bytes.length);
+322 }
+323 }
+324 return sb.toString(URI_ENCODING);
+325 }
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335 public static String encodeURI(String path) throws UnsupportedEncodingException {
+336 int i = 0;
+337 int len = path.length();
+338 int ch = 0;
+339 StringBuffer sb = null ;
+340 for (; i < len; i++) {
+341 ch = path.charAt(i);
+342
+343 if (ch >= ASCII_SIZE) {
+344 break ;
+345 }
+346 if (gNeedEscaping[ch]) {
+347 if (sb == null ) {
+348 sb = new StringBuffer(path.substring(0, i));
+349 }
+350 sb.append('%');
+351 sb.append(gAfterEscaping1[ch]);
+352 sb.append(gAfterEscaping2[ch]);
+353
+354 } else if (sb != null ) {
+355 sb.append((char ) ch);
+356 }
+357 }
+358
+359
+360 if (i < len) {
+361 if (sb == null ) {
+362 sb = new StringBuffer(path.substring(0, i));
+363 }
+364
+365 byte[] bytes = null ;
+366 byte b;
+367 bytes = path.substring(i).getBytes(URI_ENCODING);
+368 len = bytes.length;
+369
+370
+371 for (i = 0; i < len; i++) {
+372 b = bytes[i];
+373
+374 if (b < 0) {
+375 ch = b + BYTE_SIZE;
+376 sb.append('%');
+377 sb.append(gHexChs[ch >> NIBBLE]);
+378 sb.append(gHexChs[ch & NIBBLE_MASK]);
+379 } else if (gNeedEscaping[b]) {
+380 sb.append('%');
+381 sb.append(gAfterEscaping1[b]);
+382 sb.append(gAfterEscaping2[b]);
+383 } else {
+384 sb.append((char ) b);
+385 }
+386 }
+387 }
+388 return sb == null ? path : sb.toString();
+389 }
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405 @Deprecated
+406 public static URL fileToURL(File file)
+407 throws MalformedURLException {
+408 return new URL(file.toURI().toASCIIString());
+409 }
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419 public static File getToolsJar() {
+420
+421 boolean toolsJarAvailable = false;
+422 try {
+423
+424 Class.forName("com.sun.tools.javac.Main" );
+425 toolsJarAvailable = true ;
+426 } catch (Exception e) {
+427 try {
+428 Class.forName("sun.tools.javac.Main" );
+429 toolsJarAvailable = true ;
+430 } catch (Exception e2) {
+431
+432 }
+433 }
+434 if (toolsJarAvailable) {
+435 return null ;
+436 }
+437
+438
+439 String libToolsJar
+440 = File.separator + "lib" + File.separator + "tools.jar" ;
+441 String javaHome = System.getProperty("java.home" );
+442 File toolsJar = new File(javaHome + libToolsJar);
+443 if (toolsJar.exists()) {
+444
+445 return toolsJar;
+446 }
+447 if (javaHome.toLowerCase(Locale.ENGLISH).endsWith(File.separator + "jre" )) {
+448 javaHome = javaHome.substring(
+449 0, javaHome.length() - "/jre" .length());
+450 toolsJar = new File(javaHome + libToolsJar);
+451 }
+452 if (!toolsJar.exists()) {
+453 System.out.println("Unable to locate tools.jar. "
+454 + "Expected to find it in " + toolsJar.getPath());
+455 return null ;
+456 }
+457 return toolsJar;
+458 }
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473 public static URL[] getLocationURLs(File location)
+474 throws MalformedURLException {
+475 return getLocationURLs(location, new String[]{".jar" });
+476 }
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492 public static URL[] getLocationURLs(File location,
+493 final String[] extensions)
+494 throws MalformedURLException {
+495 URL[] urls = new URL[0];
+496
+497 if (!location.exists()) {
+498 return urls;
+499 }
+500 if (!location.isDirectory()) {
+501 urls = new URL[1];
+502 String path = location.getPath();
+503 String littlePath = path.toLowerCase(Locale.ENGLISH);
+504 for (int i = 0; i < extensions.length; ++i) {
+505 if (littlePath.endsWith(extensions[i])) {
+506 urls[0] = fileToURL(location);
+507 break ;
+508 }
+509 }
+510 return urls;
+511 }
+512 File[] matches = location.listFiles(
+513 new FilenameFilter() {
+514 public boolean accept(File dir, String name) {
+515 String littleName = name.toLowerCase(Locale.ENGLISH);
+516 for (int i = 0; i < extensions.length; ++i) {
+517 if (littleName.endsWith(extensions[i])) {
+518 return true ;
+519 }
+520 }
+521 return false;
+522 }
+523 });
+524 urls = new URL[matches.length];
+525 for (int i = 0; i < matches.length; ++i) {
+526 urls[i] = fileToURL(matches[i]);
+527 }
+528 return urls;
+529 }
+530 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-frame.html
new file mode 100644
index 000000000..02ce443fd
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-frame.html
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-summary.html
new file mode 100644
index 000000000..0db967be9
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/launch/package-summary.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+
+
+ Class Summary
+
+
+
+
+
+ Locator
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html
new file mode 100644
index 000000000..f4c926429
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/package-frame.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html
new file mode 100644
index 000000000..94b859c27
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/package-summary.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Condition.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Condition.html
new file mode 100644
index 000000000..8248fe820
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Condition.html
@@ -0,0 +1,48 @@
+
+
+
+Condition xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition;
+20
+21 import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+22
+23
+24
+25
+26
+27 public interface Condition {
+28
+29
+30
+31
+32
+33 boolean eval() throws BuildException;
+34 }
+35
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Os.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Os.html
new file mode 100644
index 000000000..47fa4b00d
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/Os.html
@@ -0,0 +1,334 @@
+
+
+
+Os xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition;
+20
+21 import java.util.Locale;
+22
+23 import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+24
+25
+26
+27
+28
+29
+30 public class Os implements Condition {
+31 private static final String OS_NAME =
+32 System.getProperty("os.name" ).toLowerCase(Locale.ENGLISH);
+33 private static final String OS_ARCH =
+34 System.getProperty("os.arch" ).toLowerCase(Locale.ENGLISH);
+35 private static final String OS_VERSION =
+36 System.getProperty("os.version" ).toLowerCase(Locale.ENGLISH);
+37 private static final String PATH_SEP =
+38 System.getProperty("path.separator" );
+39
+40
+41
+42
+43 private String family;
+44
+45
+46
+47 private String name;
+48
+49
+50
+51 private String version;
+52
+53
+54
+55 private String arch;
+56
+57
+58
+59 public static final String FAMILY_WINDOWS = "windows" ;
+60
+61
+62
+63 public static final String FAMILY_9X = "win9x" ;
+64
+65
+66
+67 public static final String FAMILY_NT = "winnt" ;
+68
+69
+70
+71 public static final String FAMILY_OS2 = "os/2" ;
+72
+73
+74
+75 public static final String FAMILY_NETWARE = "netware" ;
+76
+77
+78
+79 public static final String FAMILY_DOS = "dos" ;
+80
+81
+82
+83 public static final String FAMILY_MAC = "mac" ;
+84
+85
+86
+87 public static final String FAMILY_TANDEM = "tandem" ;
+88
+89
+90
+91 public static final String FAMILY_UNIX = "unix" ;
+92
+93
+94
+95 public static final String FAMILY_VMS = "openvms" ;
+96
+97
+98
+99 public static final String FAMILY_ZOS = "z/os" ;
+100
+101 public static final String FAMILY_OS400 = "os/400" ;
+102
+103
+104
+105
+106
+107
+108 private static final String DARWIN = "darwin" ;
+109
+110
+111
+112
+113
+114 public Os () {
+115
+116 }
+117
+118
+119
+120
+121
+122 public Os (String family) {
+123 setFamily(family);
+124 }
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144 public void setFamily(String f) {
+145 family = f.toLowerCase(Locale.ENGLISH);
+146 }
+147
+148
+149
+150
+151
+152
+153 public void setName(String name) {
+154 this .name = name.toLowerCase(Locale.ENGLISH);
+155 }
+156
+157
+158
+159
+160
+161
+162 public void setArch(String arch) {
+163 this .arch = arch.toLowerCase(Locale.ENGLISH);
+164 }
+165
+166
+167
+168
+169
+170
+171 public void setVersion(String version) {
+172 this .version = version.toLowerCase(Locale.ENGLISH);
+173 }
+174
+175
+176
+177
+178
+179
+180
+181
+182 public boolean eval() throws BuildException {
+183 return isOs(family, name, arch, version);
+184 }
+185
+186
+187
+188
+189
+190
+191
+192
+193 public static boolean isFamily(String family) {
+194 return isOs(family, null , null , null );
+195 }
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205 public static boolean isName(String name) {
+206 return isOs(null , name, null , null );
+207 }
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217 public static boolean isArch(String arch) {
+218 return isOs(null , null , arch, null );
+219 }
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229 public static boolean isVersion(String version) {
+230 return isOs(null , null , null , version);
+231 }
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244 public static boolean isOs(String family, String name, String arch,
+245 String version) {
+246 boolean retValue = false;
+247
+248 if (family != null || name != null || arch != null
+249 || version != null ) {
+250
+251 boolean isFamily = true ;
+252 boolean isName = true ;
+253 boolean isArch = true ;
+254 boolean isVersion = true ;
+255
+256 if (family != null ) {
+257
+258
+259
+260 boolean isWindows = OS_NAME.indexOf(FAMILY_WINDOWS) > -1;
+261 boolean is9x = false;
+262 boolean isNT = false;
+263 if (isWindows) {
+264
+265 is9x = (OS_NAME.indexOf("95" ) >= 0
+266 || OS_NAME.indexOf("98" ) >= 0
+267 || OS_NAME.indexOf("me" ) >= 0
+268
+269
+270 || OS_NAME.indexOf("ce" ) >= 0);
+271 isNT = !is9x;
+272 }
+273 if (family.equals(FAMILY_WINDOWS)) {
+274 isFamily = isWindows;
+275 } else if (family.equals(FAMILY_9X)) {
+276 isFamily = isWindows && is9x;
+277 } else if (family.equals(FAMILY_NT)) {
+278 isFamily = isWindows && isNT;
+279 } else if (family.equals(FAMILY_OS2)) {
+280 isFamily = OS_NAME.indexOf(FAMILY_OS2) > -1;
+281 } else if (family.equals(FAMILY_NETWARE)) {
+282 isFamily = OS_NAME.indexOf(FAMILY_NETWARE) > -1;
+283 } else if (family.equals(FAMILY_DOS)) {
+284 isFamily = PATH_SEP.equals(";" ) && !isFamily(FAMILY_NETWARE);
+285 } else if (family.equals(FAMILY_MAC)) {
+286 isFamily = OS_NAME.indexOf(FAMILY_MAC) > -1
+287 || OS_NAME.indexOf(DARWIN) > -1;
+288 } else if (family.equals(FAMILY_TANDEM)) {
+289 isFamily = OS_NAME.indexOf("nonstop_kernel" ) > -1;
+290 } else if (family.equals(FAMILY_UNIX)) {
+291 isFamily = PATH_SEP.equals(":" )
+292 && !isFamily(FAMILY_VMS)
+293 && (!isFamily(FAMILY_MAC) || OS_NAME.endsWith("x" )
+294 || OS_NAME.indexOf(DARWIN) > -1);
+295 } else if (family.equals(FAMILY_ZOS)) {
+296 isFamily = OS_NAME.indexOf(FAMILY_ZOS) > -1
+297 || OS_NAME.indexOf("os/390" ) > -1;
+298 } else if (family.equals(FAMILY_OS400)) {
+299 isFamily = OS_NAME.indexOf(FAMILY_OS400) > -1;
+300 } else if (family.equals(FAMILY_VMS)) {
+301 isFamily = OS_NAME.indexOf(FAMILY_VMS) > -1;
+302 } else {
+303 throw new BuildException (
+304 "Don\'t know how to detect os family \""
+305 + family + "\"" );
+306 }
+307 }
+308 if (name != null ) {
+309 isName = name.equals(OS_NAME);
+310 }
+311 if (arch != null ) {
+312 isArch = arch.equals(OS_ARCH);
+313 }
+314 if (version != null ) {
+315 isVersion = version.equals(OS_VERSION);
+316 }
+317 retValue = isFamily && isName && isArch && isVersion;
+318 }
+319 return retValue;
+320 }
+321 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-frame.html
new file mode 100644
index 000000000..dcb206387
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-frame.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-summary.html
new file mode 100644
index 000000000..d648c94c2
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/taskdefs/condition/package-summary.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+
+
+ Class Summary
+
+
+
+
+
+ Condition
+
+
+
+
+ Os
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/DataType.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/DataType.html
new file mode 100644
index 000000000..72240bfa0
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/DataType.html
@@ -0,0 +1,366 @@
+
+
+
+DataType xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types;
+19
+20 import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+21 import org.owasp.dependencycheck.org.apache.tools.ant.ProjectComponent;
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32 public abstract class DataType extends ProjectComponent implements Cloneable {
+33
+34
+35
+36
+37
+38
+39
+40
+41 protected Reference ref;
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53 protected boolean checked = true ;
+54
+55
+56
+57
+58
+59
+60
+61 public boolean isReference() {
+62 return ref != null ;
+63 }
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74 public void setRefid(final Reference ref) {
+75 this .ref = ref;
+76 checked = false;
+77 }
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251 protected BuildException tooManyAttributes() {
+252 return new BuildException ("You must not specify more than one "
+253 + "attribute when using refid" );
+254 }
+255
+256
+257
+258
+259
+260
+261
+262 protected BuildException noChildrenAllowed() {
+263 return new BuildException ("You must not specify nested elements "
+264 + "when using refid" );
+265 }
+266
+267
+268
+269
+270
+271
+272 protected BuildException circularReference() {
+273 return new BuildException ("This data type contains a circular "
+274 + "reference." );
+275 }
+276
+277
+278
+279
+280
+281
+282 protected boolean isChecked() {
+283 return checked;
+284 }
+285
+286
+287
+288
+289
+290
+291 protected void setChecked(final boolean checked) {
+292 this .checked = checked;
+293 }
+294
+295
+296
+297
+298
+299
+300 public Reference getRefid() {
+301 return ref;
+302 }
+303
+304
+305
+306
+307
+308
+309
+310 protected void checkAttributesAllowed() {
+311 if (isReference()) {
+312 throw tooManyAttributes();
+313 }
+314 }
+315
+316
+317
+318
+319
+320
+321
+322 protected void checkChildrenAllowed() {
+323 if (isReference()) {
+324 throw noChildrenAllowed();
+325 }
+326 }
+327
+328
+329
+330
+331
+332
+333 public String toString() {
+334 String d = getDescription();
+335
+336 return d == null ? "DataType" : d;
+337 }
+338
+339
+340
+341
+342
+343
+344 public Object clone() throws CloneNotSupportedException {
+345 DataType dt = (DataType) super .clone();
+346 dt.setDescription(getDescription());
+347 if (getRefid() != null ) {
+348 dt.setRefid(getRefid());
+349 }
+350 dt.setChecked(isChecked());
+351 return dt;
+352 }
+353 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/Reference.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/Reference.html
new file mode 100644
index 000000000..4d6e2fe3a
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/Reference.html
@@ -0,0 +1,139 @@
+
+
+
+Reference xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types;
+19
+20
+21
+22
+23
+24 public class Reference {
+25
+26 private String refid;
+27
+28
+29
+30
+31
+32
+33
+34 public Reference () {
+35 }
+36
+37
+38
+39
+40
+41
+42
+43 public Reference (String id) {
+44 setRefId(id);
+45 }
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63 public void setRefId(String id) {
+64 refid = id;
+65 }
+66
+67
+68
+69
+70
+71
+72 public String getRefId() {
+73 return refid;
+74 }
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/Resource.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/Resource.html
new file mode 100644
index 000000000..c8db24c55
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/Resource.html
@@ -0,0 +1,475 @@
+
+
+
+Resource xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types;
+19
+20 import java.io.IOException;
+21 import java.io.InputStream;
+22 import java.io.OutputStream;
+23 import java.math.BigInteger;
+24 import java.util.Iterator;
+25 import java.util.NoSuchElementException;
+26 import org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider;
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37 public class Resource extends DataType implements Comparable<Resource>, ResourceCollection {
+38
+39
+40
+41
+42 public static final long UNKNOWN_SIZE = -1;
+43
+44
+45
+46
+47 public static final long UNKNOWN_DATETIME = 0L;
+48
+49
+50
+51
+52 protected static final int MAGIC = getMagicNumber("Resource" .getBytes());
+53
+54 private static final int NULL_NAME = getMagicNumber("null name" .getBytes());
+55
+56
+57
+58
+59
+60
+61
+62 protected static int getMagicNumber(byte[] seed) {
+63 return new BigInteger(seed).intValue();
+64 }
+65
+66 private String name = null ;
+67 private Boolean exists = null ;
+68 private Long lastmodified = null ;
+69 private Boolean directory = null ;
+70 private Long size = null ;
+71
+72
+73
+74
+75 public Resource () {
+76 }
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86 public Resource (String name) {
+87 this (name, false, 0, false);
+88 }
+89
+90
+91
+92
+93
+94
+95
+96
+97 public Resource (String name, boolean exists, long lastmodified) {
+98 this (name, exists, lastmodified, false);
+99 }
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109 public Resource (String name, boolean exists, long lastmodified, boolean directory) {
+110 this (name, exists, lastmodified, directory, UNKNOWN_SIZE);
+111 }
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122 public Resource (String name, boolean exists, long lastmodified, boolean directory, long size) {
+123 this .name = name;
+124 setName(name);
+125 setExists(exists);
+126 setLastModified(lastmodified);
+127 setDirectory(directory);
+128 setSize(size);
+129 }
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144 public String getName() {
+145
+146 return name;
+147 }
+148
+149
+150
+151
+152
+153
+154 public void setName(String name) {
+155 checkAttributesAllowed();
+156 this .name = name;
+157 }
+158
+159
+160
+161
+162
+163
+164 public boolean isExists() {
+165
+166
+167
+168
+169 return exists == null || exists.booleanValue();
+170 }
+171
+172
+173
+174
+175
+176
+177 public void setExists(boolean exists) {
+178 checkAttributesAllowed();
+179 this .exists = exists ? Boolean.TRUE : Boolean.FALSE;
+180 }
+181
+182
+183
+184
+185
+186
+187
+188
+189 public long getLastModified() {
+190
+191
+192
+193 if (!isExists() || lastmodified == null ) {
+194 return UNKNOWN_DATETIME;
+195 }
+196 long result = lastmodified.longValue();
+197 return result < UNKNOWN_DATETIME ? UNKNOWN_DATETIME : result;
+198 }
+199
+200
+201
+202
+203
+204
+205 public void setLastModified(long lastmodified) {
+206 checkAttributesAllowed();
+207 this .lastmodified = new Long(lastmodified);
+208 }
+209
+210
+211
+212
+213
+214
+215 public boolean isDirectory() {
+216
+217
+218
+219
+220 return directory != null && directory.booleanValue();
+221 }
+222
+223
+224
+225
+226
+227
+228 public void setDirectory(boolean directory) {
+229 checkAttributesAllowed();
+230 this .directory = directory ? Boolean.TRUE : Boolean.FALSE;
+231 }
+232
+233
+234
+235
+236
+237
+238
+239 public void setSize(long size) {
+240 checkAttributesAllowed();
+241 this .size = new Long(size > UNKNOWN_SIZE ? size : UNKNOWN_SIZE);
+242 }
+243
+244
+245
+246
+247
+248
+249
+250
+251 public long getSize() {
+252
+253
+254
+255 return isExists()
+256 ? (size != null ? size.longValue() : UNKNOWN_SIZE)
+257 : 0L;
+258 }
+259
+260
+261
+262
+263
+264
+265 public Object clone() {
+266 try {
+267 return super .clone();
+268 } catch (CloneNotSupportedException e) {
+269 throw new UnsupportedOperationException(
+270 "CloneNotSupportedException for a Resource caught. "
+271 + "Derived classes must support cloning." );
+272 }
+273 }
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283 public int compareTo(Resource other) {
+284
+285
+286
+287 return toString().compareTo(other.toString());
+288 }
+289
+290
+291
+292
+293
+294
+295
+296
+297 public boolean equals(Object other) {
+298
+299
+300
+301 return other != null && other.getClass().equals(getClass())
+302 && compareTo((Resource) other) == 0;
+303 }
+304
+305
+306
+307
+308
+309
+310
+311 public int hashCode() {
+312
+313
+314
+315 String name = getName();
+316 return MAGIC * (name == null ? NULL_NAME : name.hashCode());
+317 }
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327 public InputStream getInputStream() throws IOException {
+328
+329
+330
+331 throw new UnsupportedOperationException();
+332 }
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342 public OutputStream getOutputStream() throws IOException {
+343
+344
+345
+346 throw new UnsupportedOperationException();
+347 }
+348
+349
+350
+351
+352
+353
+354
+355 public Iterator<Resource> iterator() {
+356
+357
+358 return new Iterator<Resource>() {
+359 private boolean done = false;
+360
+361 public boolean hasNext() {
+362 return !done;
+363 }
+364
+365 public Resource next() {
+366 if (done) {
+367 throw new NoSuchElementException();
+368 }
+369 done = true ;
+370 return Resource.this ;
+371 }
+372
+373 public void remove() {
+374 throw new UnsupportedOperationException();
+375 }
+376 };
+377 }
+378
+379
+380
+381
+382
+383
+384
+385 public int size() {
+386
+387 return 1;
+388 }
+389
+390
+391
+392
+393
+394
+395
+396 public boolean isFilesystemOnly() {
+397
+398
+399 return this .as(FileProvider.class ) != null ;
+400 }
+401
+402
+403
+404
+405
+406
+407
+408 public String toString() {
+409
+410
+411
+412 String n = getName();
+413 return n == null ? "(anonymous)" : n;
+414 }
+415
+416
+417
+418
+419
+420
+421
+422
+423 public final String toLongString() {
+424
+425
+426 return toString();
+427 }
+428
+429
+430
+431
+432
+433
+434 public void setRefid(Reference r) {
+435 if (name != null
+436 || exists != null
+437 || lastmodified != null
+438 || directory != null
+439 || size != null ) {
+440 throw tooManyAttributes();
+441 }
+442 super .setRefid(r);
+443 }
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459 public <T> T as(Class<T> clazz) {
+460 return clazz.isAssignableFrom(getClass()) ? clazz.cast (this ) : null ;
+461 }
+462 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceCollection.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceCollection.html
new file mode 100644
index 000000000..c637598d9
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceCollection.html
@@ -0,0 +1,63 @@
+
+
+
+ResourceCollection xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types;
+19
+20 import java.util.Iterator;
+21 import org.owasp.dependencycheck.org.apache.tools.ant.types.resources.FileProvider;
+22
+23
+24
+25
+26
+27 public interface ResourceCollection extends Iterable<Resource> {
+28
+29
+30
+31
+32
+33 Iterator<Resource> iterator();
+34
+35
+36
+37
+38
+39 int size();
+40
+41
+42
+43
+44
+45
+46
+47
+48 boolean isFilesystemOnly();
+49
+50 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceFactory.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceFactory.html
new file mode 100644
index 000000000..d32f61f97
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/ResourceFactory.html
@@ -0,0 +1,51 @@
+
+
+
+ResourceFactory xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types;
+19
+20
+21
+22
+23
+24
+25
+26 public interface ResourceFactory {
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37 Resource getResource(String name);
+38 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/package-frame.html
new file mode 100644
index 000000000..fd7abaf2f
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/package-frame.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/package-summary.html
new file mode 100644
index 000000000..720c7b498
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/package-summary.html
@@ -0,0 +1,89 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Appendable.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Appendable.html
new file mode 100644
index 000000000..5fb9529b0
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Appendable.html
@@ -0,0 +1,48 @@
+
+
+
+Appendable xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+19
+20 import java.io.IOException;
+21 import java.io.OutputStream;
+22
+23
+24
+25
+26
+27 public interface Appendable {
+28
+29
+30
+31
+32
+33
+34 OutputStream getAppendOutputStream() throws IOException;
+35 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileProvider.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileProvider.html
new file mode 100644
index 000000000..f34aa6ecd
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileProvider.html
@@ -0,0 +1,49 @@
+
+
+
+FileProvider xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+20
+21 import java.io.File;
+22
+23
+24
+25
+26
+27
+28
+29
+30 public interface FileProvider {
+31
+32
+33
+34
+35 File getFile();
+36 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileResource.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileResource.html
new file mode 100644
index 000000000..5567caa3f
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/FileResource.html
@@ -0,0 +1,427 @@
+
+
+
+FileResource xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+19
+20 import java.io.File;
+21 import java.io.FileInputStream;
+22 import java.io.FileOutputStream;
+23 import java.io.IOException;
+24 import java.io.InputStream;
+25 import java.io.OutputStream;
+26 import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+27 import org.owasp.dependencycheck.org.apache.tools.ant.types.Reference;
+28 import org.owasp.dependencycheck.org.apache.tools.ant.types.Resource;
+29 import org.owasp.dependencycheck.org.apache.tools.ant.types.ResourceFactory;
+30 import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+31
+32
+33
+34
+35
+36
+37 public class FileResource extends Resource implements Touchable, FileProvider,
+38 ResourceFactory, Appendable {
+39
+40 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+41 private static final int NULL_FILE
+42 = Resource.getMagicNumber("null file" .getBytes());
+43
+44 private File file;
+45 private File baseDir;
+46
+47
+48
+49
+50 public FileResource () {
+51 }
+52
+53
+54
+55
+56
+57
+58
+59 public FileResource (File b, String name) {
+60 this .baseDir = b;
+61 this .file = FILE_UTILS.resolveFile(b, name);
+62 }
+63
+64
+65
+66
+67
+68
+69 public FileResource (File f) {
+70 setFile(f);
+71 }
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98 public void setFile(File f) {
+99 checkAttributesAllowed();
+100 file = f;
+101 if (f != null && (getBaseDir() == null || !FILE_UTILS.isLeadingPath(getBaseDir(), f))) {
+102 setBaseDir(f.getParentFile());
+103 }
+104 }
+105
+106
+107
+108
+109
+110
+111 public File getFile() {
+112
+113
+114
+115
+116 synchronized (this ) {
+117 if (file == null ) {
+118
+119 File d = getBaseDir();
+120 String n = super .getName();
+121 if (n != null ) {
+122 setFile(FILE_UTILS.resolveFile(d, n));
+123 }
+124 }
+125 }
+126 return file;
+127 }
+128
+129
+130
+131
+132
+133
+134 public void setBaseDir(File b) {
+135 checkAttributesAllowed();
+136 baseDir = b;
+137 }
+138
+139
+140
+141
+142
+143
+144 public File getBaseDir() {
+145
+146
+147
+148
+149 return baseDir;
+150 }
+151
+152
+153
+154
+155
+156
+157 public void setRefid(Reference r) {
+158 if (file != null || baseDir != null ) {
+159 throw tooManyAttributes();
+160 }
+161 super .setRefid(r);
+162 }
+163
+164
+165
+166
+167
+168
+169
+170 public String getName() {
+171
+172
+173
+174 File b = getBaseDir();
+175 return b == null ? getNotNullFile().getName()
+176 : FILE_UTILS.removeLeadingPath(b, getNotNullFile());
+177 }
+178
+179
+180
+181
+182
+183
+184 public boolean isExists() {
+185
+186
+187 return getNotNullFile().exists();
+188 }
+189
+190
+191
+192
+193
+194
+195 public long getLastModified() {
+196
+197
+198
+199 return getNotNullFile().lastModified();
+200 }
+201
+202
+203
+204
+205
+206
+207 public boolean isDirectory() {
+208
+209
+210 return getNotNullFile().isDirectory();
+211 }
+212
+213
+214
+215
+216
+217
+218 public long getSize() {
+219
+220
+221 return getNotNullFile().length();
+222 }
+223
+224
+225
+226
+227
+228
+229
+230 public InputStream getInputStream() throws IOException {
+231
+232
+233
+234 return new FileInputStream(getNotNullFile());
+235 }
+236
+237
+238
+239
+240
+241
+242
+243
+244 public OutputStream getOutputStream() throws IOException {
+245
+246
+247
+248 return getOutputStream(false);
+249 }
+250
+251
+252
+253
+254 public OutputStream getAppendOutputStream() throws IOException {
+255
+256
+257
+258 return getOutputStream(true );
+259 }
+260
+261 private OutputStream getOutputStream(boolean append) throws IOException {
+262 File f = getNotNullFile();
+263 if (f.exists()) {
+264 if (f.isFile() && !append) {
+265 f.delete();
+266 }
+267 } else {
+268 File p = f.getParentFile();
+269 if (p != null && !(p.exists())) {
+270 p.mkdirs();
+271 }
+272 }
+273 return append ? new FileOutputStream(f.getAbsolutePath(), true ) : new FileOutputStream(f);
+274 }
+275
+276
+277
+278
+279
+280
+281
+282
+283 public int compareTo(Resource another) {
+284
+285
+286
+287 if (this .equals(another)) {
+288 return 0;
+289 }
+290 FileProvider otherFP = another.as(FileProvider.class );
+291 if (otherFP != null ) {
+292 File f = getFile();
+293 if (f == null ) {
+294 return -1;
+295 }
+296 File of = otherFP.getFile();
+297 if (of == null ) {
+298 return 1;
+299 }
+300 return f.compareTo(of);
+301 }
+302 return super .compareTo(another);
+303 }
+304
+305
+306
+307
+308
+309
+310
+311 public boolean equals(Object another) {
+312 if (this == another) {
+313 return true ;
+314 }
+315
+316
+317
+318 if (another == null || !(another.getClass().equals(getClass()))) {
+319 return false;
+320 }
+321 FileResource otherfr = (FileResource) another;
+322 return getFile() == null
+323 ? otherfr.getFile() == null
+324 : getFile().equals(otherfr.getFile());
+325 }
+326
+327
+328
+329
+330
+331
+332 public int hashCode() {
+333
+334
+335
+336 return MAGIC * (getFile() == null ? NULL_FILE : getFile().hashCode());
+337 }
+338
+339
+340
+341
+342
+343
+344 public String toString() {
+345
+346
+347
+348 if (file == null ) {
+349 return "(unbound file resource)" ;
+350 }
+351 String absolutePath = file.getAbsolutePath();
+352 return FILE_UTILS.normalize(absolutePath).getAbsolutePath();
+353 }
+354
+355
+356
+357
+358
+359
+360 public boolean isFilesystemOnly() {
+361
+362
+363
+364
+365 return true ;
+366 }
+367
+368
+369
+370
+371
+372
+373 public void touch(long modTime) {
+374
+375
+376
+377
+378 if (!getNotNullFile().setLastModified(modTime)) {
+379
+380 }
+381 }
+382
+383
+384
+385
+386
+387
+388
+389 protected File getNotNullFile() {
+390 if (getFile() == null ) {
+391 throw new BuildException ("file attribute is null!" );
+392 }
+393
+394 return getFile();
+395 }
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406 public Resource getResource(String path) {
+407 File newfile = FILE_UTILS.resolveFile(getFile(), path);
+408 FileResource fileResource = new FileResource (newfile);
+409 if (FILE_UTILS.isLeadingPath(getBaseDir(), newfile)) {
+410 fileResource.setBaseDir(getBaseDir());
+411 }
+412 return fileResource;
+413 }
+414 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Touchable.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Touchable.html
new file mode 100644
index 000000000..f6cce89db
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/Touchable.html
@@ -0,0 +1,45 @@
+
+
+
+Touchable xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types.resources;
+19
+20
+21
+22
+23
+24
+25 public interface Touchable {
+26
+27
+28
+29
+30
+31 void touch(long modTime);
+32 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-frame.html
new file mode 100644
index 000000000..3902aba74
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-frame.html
@@ -0,0 +1,33 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-summary.html
new file mode 100644
index 000000000..8e478ccb2
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/resources/package-summary.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/FileSelector.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/FileSelector.html
new file mode 100644
index 000000000..e61b56aef
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/FileSelector.html
@@ -0,0 +1,61 @@
+
+
+
+FileSelector xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+20
+21 import java.io.File;
+22
+23 import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+24
+25
+26
+27
+28
+29
+30 public interface FileSelector {
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44 boolean isSelected(File basedir, String filename, File file)
+45 throws BuildException;
+46
+47 }
+48
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorScanner.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorScanner.html
new file mode 100644
index 000000000..7694e0264
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorScanner.html
@@ -0,0 +1,62 @@
+
+
+
+SelectorScanner xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+19
+20
+21
+22
+23
+24
+25
+26 public interface SelectorScanner {
+27
+28
+29
+30
+31
+32 void setSelectors(FileSelector [] selectors);
+33
+34
+35
+36
+37
+38
+39 String[] getDeselectedDirectories();
+40
+41
+42
+43
+44
+45
+46 String[] getDeselectedFiles();
+47
+48
+49 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorUtils.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorUtils.html
new file mode 100644
index 000000000..11c736aa8
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/SelectorUtils.html
@@ -0,0 +1,708 @@
+
+
+
+SelectorUtils xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+20
+21 import java.io.File;
+22 import java.util.StringTokenizer;
+23 import java.util.Vector;
+24
+25 import org.owasp.dependencycheck.org.apache.tools.ant.types.Resource;
+26 import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38 public final class SelectorUtils {
+39
+40
+41
+42
+43
+44 public static final String DEEP_TREE_MATCH = "**" ;
+45
+46 private static final SelectorUtils instance = new SelectorUtils ();
+47 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+48
+49
+50
+51
+52 private SelectorUtils () {
+53 }
+54
+55
+56
+57
+58
+59 public static SelectorUtils getInstance() {
+60 return instance;
+61 }
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79 public static boolean matchPatternStart(String pattern, String str) {
+80 return matchPatternStart(pattern, str, true );
+81 }
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101 public static boolean matchPatternStart(String pattern, String str,
+102 boolean isCaseSensitive) {
+103
+104
+105
+106
+107 if (str.startsWith(File.separator)
+108 != pattern.startsWith(File.separator)) {
+109 return false;
+110 }
+111
+112 String[] patDirs = tokenizePathAsArray(pattern);
+113 String[] strDirs = tokenizePathAsArray(str);
+114 return matchPatternStart(patDirs, strDirs, isCaseSensitive);
+115 }
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136 static boolean matchPatternStart(String[] patDirs, String[] strDirs,
+137 boolean isCaseSensitive) {
+138 int patIdxStart = 0;
+139 int patIdxEnd = patDirs.length - 1;
+140 int strIdxStart = 0;
+141 int strIdxEnd = strDirs.length - 1;
+142
+143
+144 while (patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd) {
+145 String patDir = patDirs[patIdxStart];
+146 if (patDir.equals(DEEP_TREE_MATCH)) {
+147 break ;
+148 }
+149 if (!match(patDir, strDirs[strIdxStart], isCaseSensitive)) {
+150 return false;
+151 }
+152 patIdxStart++;
+153 strIdxStart++;
+154 }
+155
+156
+157
+158
+159 if (strIdxStart > strIdxEnd) {
+160
+161 return true ;
+162 } else if (patIdxStart > patIdxEnd) {
+163
+164 return false;
+165 } else {
+166
+167
+168 return true ;
+169 }
+170 }
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188 public static boolean matchPath(String pattern, String str) {
+189 String[] patDirs = tokenizePathAsArray(pattern);
+190 return matchPath(patDirs, tokenizePathAsArray(str), true );
+191 }
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211 public static boolean matchPath(String pattern, String str,
+212 boolean isCaseSensitive) {
+213 String[] patDirs = tokenizePathAsArray(pattern);
+214 return matchPath(patDirs, tokenizePathAsArray(str), isCaseSensitive);
+215 }
+216
+217
+218
+219
+220
+221 static boolean matchPath(String[] tokenizedPattern, String[] strDirs,
+222 boolean isCaseSensitive) {
+223 int patIdxStart = 0;
+224 int patIdxEnd = tokenizedPattern.length - 1;
+225 int strIdxStart = 0;
+226 int strIdxEnd = strDirs.length - 1;
+227
+228
+229 while (patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd) {
+230 String patDir = tokenizedPattern[patIdxStart];
+231 if (patDir.equals(DEEP_TREE_MATCH)) {
+232 break ;
+233 }
+234 if (!match(patDir, strDirs[strIdxStart], isCaseSensitive)) {
+235 return false;
+236 }
+237 patIdxStart++;
+238 strIdxStart++;
+239 }
+240 if (strIdxStart > strIdxEnd) {
+241
+242 for (int i = patIdxStart; i <= patIdxEnd; i++) {
+243 if (!tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+244 return false;
+245 }
+246 }
+247 return true ;
+248 } else {
+249 if (patIdxStart > patIdxEnd) {
+250
+251 return false;
+252 }
+253 }
+254
+255
+256 while (patIdxStart <= patIdxEnd && strIdxStart <= strIdxEnd) {
+257 String patDir = tokenizedPattern[patIdxEnd];
+258 if (patDir.equals(DEEP_TREE_MATCH)) {
+259 break ;
+260 }
+261 if (!match(patDir, strDirs[strIdxEnd], isCaseSensitive)) {
+262 return false;
+263 }
+264 patIdxEnd--;
+265 strIdxEnd--;
+266 }
+267 if (strIdxStart > strIdxEnd) {
+268
+269 for (int i = patIdxStart; i <= patIdxEnd; i++) {
+270 if (!tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+271 return false;
+272 }
+273 }
+274 return true ;
+275 }
+276
+277 while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {
+278 int patIdxTmp = -1;
+279 for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {
+280 if (tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+281 patIdxTmp = i;
+282 break ;
+283 }
+284 }
+285 if (patIdxTmp == patIdxStart + 1) {
+286
+287 patIdxStart++;
+288 continue ;
+289 }
+290
+291
+292 int patLength = (patIdxTmp - patIdxStart - 1);
+293 int strLength = (strIdxEnd - strIdxStart + 1);
+294 int foundIdx = -1;
+295 strLoop:
+296 for (int i = 0; i <= strLength - patLength; i++) {
+297 for (int j = 0; j < patLength; j++) {
+298 String subPat = tokenizedPattern[patIdxStart + j + 1];
+299 String subStr = strDirs[strIdxStart + i + j];
+300 if (!match(subPat, subStr, isCaseSensitive)) {
+301 continue strLoop;
+302 }
+303 }
+304
+305 foundIdx = strIdxStart + i;
+306 break ;
+307 }
+308
+309 if (foundIdx == -1) {
+310 return false;
+311 }
+312
+313 patIdxStart = patIdxTmp;
+314 strIdxStart = foundIdx + patLength;
+315 }
+316
+317 for (int i = patIdxStart; i <= patIdxEnd; i++) {
+318 if (!tokenizedPattern[i].equals(DEEP_TREE_MATCH)) {
+319 return false;
+320 }
+321 }
+322
+323 return true ;
+324 }
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340 public static boolean match(String pattern, String str) {
+341 return match(pattern, str, true );
+342 }
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361 public static boolean match(String pattern, String str,
+362 boolean caseSensitive) {
+363 char [] patArr = pattern.toCharArray();
+364 char [] strArr = str.toCharArray();
+365 int patIdxStart = 0;
+366 int patIdxEnd = patArr.length - 1;
+367 int strIdxStart = 0;
+368 int strIdxEnd = strArr.length - 1;
+369 char ch;
+370
+371 boolean containsStar = false;
+372 for (int i = 0; i < patArr.length; i++) {
+373 if (patArr[i] == '*') {
+374 containsStar = true ;
+375 break ;
+376 }
+377 }
+378
+379 if (!containsStar) {
+380
+381 if (patIdxEnd != strIdxEnd) {
+382 return false;
+383 }
+384 for (int i = 0; i <= patIdxEnd; i++) {
+385 ch = patArr[i];
+386 if (ch != '?') {
+387 if (different(caseSensitive, ch, strArr[i])) {
+388 return false;
+389 }
+390 }
+391 }
+392 return true ;
+393 }
+394
+395 if (patIdxEnd == 0) {
+396 return true ;
+397 }
+398
+399
+400 while (true ) {
+401 ch = patArr[patIdxStart];
+402 if (ch == '*' || strIdxStart > strIdxEnd) {
+403 break ;
+404 }
+405 if (ch != '?') {
+406 if (different(caseSensitive, ch, strArr[strIdxStart])) {
+407 return false;
+408 }
+409 }
+410 patIdxStart++;
+411 strIdxStart++;
+412 }
+413 if (strIdxStart > strIdxEnd) {
+414
+415
+416 return allStars(patArr, patIdxStart, patIdxEnd);
+417 }
+418
+419
+420 while (true ) {
+421 ch = patArr[patIdxEnd];
+422 if (ch == '*' || strIdxStart > strIdxEnd) {
+423 break ;
+424 }
+425 if (ch != '?') {
+426 if (different(caseSensitive, ch, strArr[strIdxEnd])) {
+427 return false;
+428 }
+429 }
+430 patIdxEnd--;
+431 strIdxEnd--;
+432 }
+433 if (strIdxStart > strIdxEnd) {
+434
+435
+436 return allStars(patArr, patIdxStart, patIdxEnd);
+437 }
+438
+439
+440
+441 while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {
+442 int patIdxTmp = -1;
+443 for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {
+444 if (patArr[i] == '*') {
+445 patIdxTmp = i;
+446 break ;
+447 }
+448 }
+449 if (patIdxTmp == patIdxStart + 1) {
+450
+451 patIdxStart++;
+452 continue ;
+453 }
+454
+455
+456 int patLength = (patIdxTmp - patIdxStart - 1);
+457 int strLength = (strIdxEnd - strIdxStart + 1);
+458 int foundIdx = -1;
+459 strLoop:
+460 for (int i = 0; i <= strLength - patLength; i++) {
+461 for (int j = 0; j < patLength; j++) {
+462 ch = patArr[patIdxStart + j + 1];
+463 if (ch != '?') {
+464 if (different(caseSensitive, ch,
+465 strArr[strIdxStart + i + j])) {
+466 continue strLoop;
+467 }
+468 }
+469 }
+470
+471 foundIdx = strIdxStart + i;
+472 break ;
+473 }
+474
+475 if (foundIdx == -1) {
+476 return false;
+477 }
+478
+479 patIdxStart = patIdxTmp;
+480 strIdxStart = foundIdx + patLength;
+481 }
+482
+483
+484
+485 return allStars(patArr, patIdxStart, patIdxEnd);
+486 }
+487
+488 private static boolean allStars(char [] chars, int start, int end) {
+489 for (int i = start; i <= end; ++i) {
+490 if (chars[i] != '*') {
+491 return false;
+492 }
+493 }
+494 return true ;
+495 }
+496
+497 private static boolean different(
+498 boolean caseSensitive, char ch, char other) {
+499 return caseSensitive
+500 ? ch != other
+501 : Character.toUpperCase(ch) != Character.toUpperCase(other);
+502 }
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512 public static Vector<String> tokenizePath(String path) {
+513 return tokenizePath(path, File.separator);
+514 }
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525 public static Vector<String> tokenizePath(String path, String separator) {
+526 Vector<String> ret = new Vector<String>();
+527 if (FileUtils.isAbsolutePath(path)) {
+528 String[] s = FILE_UTILS.dissect(path);
+529 ret.add(s[0]);
+530 path = s[1];
+531 }
+532 StringTokenizer st = new StringTokenizer(path, separator);
+533 while (st.hasMoreTokens()) {
+534 ret.addElement(st.nextToken());
+535 }
+536 return ret;
+537 }
+538
+539
+540
+541
+542 static String[] tokenizePathAsArray(String path) {
+543 String root = null ;
+544 if (FileUtils.isAbsolutePath(path)) {
+545 String[] s = FILE_UTILS.dissect(path);
+546 root = s[0];
+547 path = s[1];
+548 }
+549 char sep = File.separatorChar;
+550 int start = 0;
+551 int len = path.length();
+552 int count = 0;
+553 for (int pos = 0; pos < len; pos++) {
+554 if (path.charAt(pos) == sep) {
+555 if (pos != start) {
+556 count++;
+557 }
+558 start = pos + 1;
+559 }
+560 }
+561 if (len != start) {
+562 count++;
+563 }
+564 String[] l = new String[count + ((root == null ) ? 0 : 1)];
+565
+566 if (root != null ) {
+567 l[0] = root;
+568 count = 1;
+569 } else {
+570 count = 0;
+571 }
+572 start = 0;
+573 for (int pos = 0; pos < len; pos++) {
+574 if (path.charAt(pos) == sep) {
+575 if (pos != start) {
+576 String tok = path.substring(start, pos);
+577 l[count++] = tok;
+578 }
+579 start = pos + 1;
+580 }
+581 }
+582 if (len != start) {
+583 String tok = path.substring(start);
+584 l[count] = tok;
+585 }
+586 return l;
+587 }
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603 public static boolean isOutOfDate(File src, File target, int granularity) {
+604 if (!src.exists()) {
+605 return false;
+606 }
+607 if (!target.exists()) {
+608 return true ;
+609 }
+610 if ((src.lastModified() - granularity) > target.lastModified()) {
+611 return true ;
+612 }
+613 return false;
+614 }
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630 public static boolean isOutOfDate(Resource src, Resource target,
+631 int granularity) {
+632 return isOutOfDate(src, target, (long ) granularity);
+633 }
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649 public static boolean isOutOfDate(Resource src, Resource target, long granularity) {
+650 long sourceLastModified = src.getLastModified();
+651 long targetLastModified = target.getLastModified();
+652 return src.isExists()
+653 && (sourceLastModified == Resource.UNKNOWN_DATETIME
+654 || targetLastModified == Resource.UNKNOWN_DATETIME
+655 || (sourceLastModified - granularity) > targetLastModified);
+656 }
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666 public static String removeWhitespace(String input) {
+667 StringBuffer result = new StringBuffer();
+668 if (input != null ) {
+669 StringTokenizer st = new StringTokenizer(input);
+670 while (st.hasMoreTokens()) {
+671 result.append(st.nextToken());
+672 }
+673 }
+674 return result.toString();
+675 }
+676
+677
+678
+679
+680
+681
+682 public static boolean hasWildcards(String input) {
+683 return (input.indexOf('*') != -1 || input.indexOf('?') != -1);
+684 }
+685
+686
+687
+688
+689
+690
+691 public static String rtrimWildcardTokens(String input) {
+692 return new TokenizedPattern (input).rtrimWildcardTokens().toString();
+693 }
+694 }
+695
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPath.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPath.html
new file mode 100644
index 000000000..afe635c99
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPath.html
@@ -0,0 +1,232 @@
+
+
+
+TokenizedPath xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+20
+21 import java.io.File;
+22
+23 import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+24 import org.owasp.dependencycheck.org.apache.tools.ant.util.FileUtils;
+25 import org.owasp.dependencycheck.org.apache.tools.ant.util.SymbolicLinkUtils;
+26
+27
+28
+29
+30
+31 public class TokenizedPath {
+32
+33
+34
+35
+36 public static final TokenizedPath EMPTY_PATH =
+37 new TokenizedPath ("" , new String[0]);
+38
+39
+40 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+41
+42 private static final SymbolicLinkUtils SYMLINK_UTILS =
+43 SymbolicLinkUtils.getSymbolicLinkUtils();
+44
+45 private static final boolean [] CS_SCAN_ONLY = new boolean [] {true };
+46
+47 private static final boolean [] CS_THEN_NON_CS = new boolean [] {true , false};
+48
+49 private final String path;
+50 private final String[] tokenizedPath;
+51
+52
+53
+54
+55
+56
+57 public TokenizedPath (String path) {
+58 this (path, SelectorUtils.tokenizePathAsArray(path));
+59 }
+60
+61
+62
+63
+64
+65
+66
+67 public TokenizedPath (TokenizedPath parent, String child) {
+68 if (parent.path.length() > 0
+69 && parent.path.charAt(parent.path.length() - 1)
+70 != File.separatorChar) {
+71 path = parent.path + File.separatorChar + child;
+72 } else {
+73 path = parent.path + child;
+74 }
+75 tokenizedPath = new String[parent.tokenizedPath.length + 1];
+76 System.arraycopy(parent.tokenizedPath, 0, tokenizedPath, 0,
+77 parent.tokenizedPath.length);
+78 tokenizedPath[parent.tokenizedPath.length] = child;
+79 }
+80
+81 TokenizedPath (String path, String[] tokens) {
+82 this .path = path;
+83 this .tokenizedPath = tokens;
+84 }
+85
+86
+87
+88
+89 public String toString() {
+90 return path;
+91 }
+92
+93
+94
+95
+96 public int depth() {
+97 return tokenizedPath.length;
+98 }
+99
+100 String[] getTokens() {
+101 return tokenizedPath;
+102 }
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112 public File findFile(File base, final boolean cs) {
+113 String[] tokens = tokenizedPath;
+114 if (FileUtils.isAbsolutePath(path)) {
+115 if (base == null ) {
+116 String[] s = FILE_UTILS.dissect(path);
+117 base = new File(s[0]);
+118 tokens = SelectorUtils.tokenizePathAsArray(s[1]);
+119 } else {
+120 File f = FILE_UTILS.normalize(path);
+121 String s = FILE_UTILS.removeLeadingPath(base, f);
+122 if (s.equals(f.getAbsolutePath())) {
+123
+124
+125 return null ;
+126 }
+127 tokens = SelectorUtils.tokenizePathAsArray(s);
+128 }
+129 }
+130 return findFile(base, tokens, cs);
+131 }
+132
+133
+134
+135
+136
+137
+138 public boolean isSymlink(File base) {
+139 for (int i = 0; i < tokenizedPath.length; i++) {
+140 try {
+141 if ((base != null
+142 && SYMLINK_UTILS.isSymbolicLink(base, tokenizedPath[i]))
+143 ||
+144 (base == null
+145 && SYMLINK_UTILS.isSymbolicLink(tokenizedPath[i]))
+146 ) {
+147 return true ;
+148 }
+149 base = new File(base, tokenizedPath[i]);
+150 } catch (java.io.IOException ioe) {
+151 String msg = "IOException caught while checking "
+152 + "for links, couldn't get canonical path!" ;
+153
+154 System.err.println(msg);
+155 }
+156 }
+157 return false;
+158 }
+159
+160
+161
+162
+163 public boolean equals(Object o) {
+164 return o instanceof TokenizedPath
+165 && path.equals(((TokenizedPath) o).path);
+166 }
+167
+168 public int hashCode() {
+169 return path.hashCode();
+170 }
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181 private static File findFile(File base, final String[] pathElements,
+182 final boolean cs) {
+183 for (int current = 0; current < pathElements.length; current++) {
+184 if (!base.isDirectory()) {
+185 return null ;
+186 }
+187 String[] files = base.list();
+188 if (files == null ) {
+189 throw new BuildException ("IO error scanning directory "
+190 + base.getAbsolutePath());
+191 }
+192 boolean found = false;
+193 boolean [] matchCase = cs ? CS_SCAN_ONLY : CS_THEN_NON_CS;
+194 for (int i = 0; !found && i < matchCase.length; i++) {
+195 for (int j = 0; !found && j < files.length; j++) {
+196 if (matchCase[i]
+197 ? files[j].equals(pathElements[current])
+198 : files[j].equalsIgnoreCase(pathElements[current])) {
+199 base = new File(base, files[j]);
+200 found = true ;
+201 }
+202 }
+203 }
+204 if (!found) {
+205 return null ;
+206 }
+207 }
+208 return pathElements.length == 0 && !base.isDirectory() ? null : base;
+209 }
+210
+211
+212
+213
+214
+215 public TokenizedPattern toPattern() {
+216 return new TokenizedPattern (path, tokenizedPath);
+217 }
+218
+219 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPattern.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPattern.html
new file mode 100644
index 000000000..5de30c672
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/TokenizedPattern.html
@@ -0,0 +1,190 @@
+
+
+
+TokenizedPattern xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19 package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors;
+20
+21 import java.io.File;
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32 public class TokenizedPattern {
+33
+34
+35
+36
+37 public static final TokenizedPattern EMPTY_PATTERN =
+38 new TokenizedPattern ("" , new String[0]);
+39
+40 private final String pattern;
+41 private final String[] tokenizedPattern;
+42
+43
+44
+45
+46
+47
+48 public TokenizedPattern (String pattern) {
+49 this (pattern, SelectorUtils.tokenizePathAsArray(pattern));
+50 }
+51
+52 TokenizedPattern (String pattern, String[] tokens) {
+53 this .pattern = pattern;
+54 this .tokenizedPattern = tokens;
+55 }
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68 public boolean matchPath(TokenizedPath path, boolean isCaseSensitive) {
+69 return SelectorUtils.matchPath(tokenizedPattern, path.getTokens(),
+70 isCaseSensitive);
+71 }
+72
+73
+74
+75
+76
+77 public boolean matchStartOf(TokenizedPath path,
+78 boolean caseSensitive) {
+79 return SelectorUtils.matchPatternStart(tokenizedPattern,
+80 path.getTokens(), caseSensitive);
+81 }
+82
+83
+84
+85
+86 public String toString() {
+87 return pattern;
+88 }
+89
+90 public String getPattern() {
+91 return pattern;
+92 }
+93
+94
+95
+96
+97 public boolean equals(Object o) {
+98 return o instanceof TokenizedPattern
+99 && pattern.equals(((TokenizedPattern) o).pattern);
+100 }
+101
+102 public int hashCode() {
+103 return pattern.hashCode();
+104 }
+105
+106
+107
+108
+109 public int depth() {
+110 return tokenizedPattern.length;
+111 }
+112
+113
+114
+115
+116 public boolean containsPattern(String pat) {
+117 for (int i = 0; i < tokenizedPattern.length; i++) {
+118 if (tokenizedPattern[i].equals(pat)) {
+119 return true ;
+120 }
+121 }
+122 return false;
+123 }
+124
+125
+126
+127
+128
+129
+130 public TokenizedPath rtrimWildcardTokens() {
+131 StringBuilder sb = new StringBuilder();
+132 int newLen = 0;
+133 for (; newLen < tokenizedPattern.length; newLen++) {
+134 if (SelectorUtils.hasWildcards(tokenizedPattern[newLen])) {
+135 break ;
+136 }
+137 if (newLen > 0
+138 && sb.charAt(sb.length() - 1) != File.separatorChar) {
+139 sb.append(File.separator);
+140 }
+141 sb.append(tokenizedPattern[newLen]);
+142 }
+143 if (newLen == 0) {
+144 return TokenizedPath.EMPTY_PATH;
+145 }
+146 String[] newPats = new String[newLen];
+147 System.arraycopy(tokenizedPattern, 0, newPats, 0, newLen);
+148 return new TokenizedPath (sb.toString(), newPats);
+149 }
+150
+151
+152
+153
+154 public boolean endsWith(String s) {
+155 return tokenizedPattern.length > 0
+156 && tokenizedPattern[tokenizedPattern.length - 1].equals(s);
+157 }
+158
+159
+160
+161
+162 public TokenizedPattern withoutLastToken() {
+163 if (tokenizedPattern.length == 0) {
+164 throw new IllegalStateException("cant strip a token from nothing" );
+165 } else if (tokenizedPattern.length == 1) {
+166 return EMPTY_PATTERN;
+167 } else {
+168 String toStrip = tokenizedPattern[tokenizedPattern.length - 1];
+169 int index = pattern.lastIndexOf(toStrip);
+170 String[] tokens = new String[tokenizedPattern.length - 1];
+171 System.arraycopy(tokenizedPattern, 0, tokens, 0,
+172 tokenizedPattern.length - 1);
+173 return new TokenizedPattern (pattern.substring(0, index), tokens);
+174 }
+175 }
+176
+177 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-frame.html
new file mode 100644
index 000000000..53a1dad32
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-frame.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-summary.html
new file mode 100644
index 000000000..1cb020a59
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/types/selectors/package-summary.html
@@ -0,0 +1,89 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.html
new file mode 100644
index 000000000..975e801e6
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/CollectionUtils.html
@@ -0,0 +1,278 @@
+
+
+
+CollectionUtils xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.util;
+19
+20 import java.util.ArrayList;
+21 import java.util.Collection;
+22 import java.util.Collections;
+23 import java.util.Dictionary;
+24 import java.util.Enumeration;
+25 import java.util.Iterator;
+26 import java.util.List;
+27 import java.util.NoSuchElementException;
+28 import java.util.Vector;
+29
+30
+31
+32
+33
+34
+35
+36
+37 public class CollectionUtils {
+38
+39
+40
+41
+42 @SuppressWarnings("rawtypes" )
+43 @Deprecated
+44 public static final List EMPTY_LIST = Collections.EMPTY_LIST;
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54 public static boolean equals(Vector<?> v1, Vector<?> v2) {
+55 if (v1 == v2) {
+56 return true ;
+57 }
+58
+59 if (v1 == null || v2 == null ) {
+60 return false;
+61 }
+62
+63 return v1.equals(v2);
+64 }
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77 public static boolean equals(Dictionary<?, ?> d1, Dictionary<?, ?> d2) {
+78 if (d1 == d2) {
+79 return true ;
+80 }
+81
+82 if (d1 == null || d2 == null ) {
+83 return false;
+84 }
+85
+86 if (d1.size() != d2.size()) {
+87 return false;
+88 }
+89
+90 Enumeration<?> e1 = d1.keys();
+91 while (e1.hasMoreElements()) {
+92 Object key = e1.nextElement();
+93 Object value1 = d1.get(key);
+94 Object value2 = d2.get(key);
+95 if (value2 == null || !value1.equals(value2)) {
+96 return false;
+97 }
+98 }
+99
+100
+101
+102
+103 return true ;
+104 }
+105
+106
+107
+108
+109
+110
+111
+112 public static String flattenToString(Collection<?> c) {
+113 final StringBuilder sb = new StringBuilder();
+114 for (Object o : c) {
+115 if (sb.length() != 0) {
+116 sb.append("," );
+117 }
+118 sb.append(o);
+119 }
+120 return sb.toString();
+121 }
+122
+123
+124
+125
+126
+127
+128
+129
+130 public static <K, V> void putAll(Dictionary<? super K, ? super V> m1, Dictionary<? extends K, ? extends V> m2) {
+131 for (Enumeration<? extends K> it = m2.keys(); it.hasMoreElements();) {
+132 K key = it.nextElement();
+133 m1.put(key, m2.get(key));
+134 }
+135 }
+136
+137
+138
+139
+140
+141 public static final class EmptyEnumeration<E> implements Enumeration<E> {
+142
+143 public EmptyEnumeration () {
+144 }
+145
+146
+147
+148
+149 public boolean hasMoreElements() {
+150 return false;
+151 }
+152
+153
+154
+155
+156
+157 public E nextElement() throws NoSuchElementException {
+158 throw new NoSuchElementException();
+159 }
+160 }
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170 public static <E> Enumeration<E> append(Enumeration<E> e1, Enumeration<E> e2) {
+171 return new CompoundEnumeration<E>(e1, e2);
+172 }
+173
+174
+175
+176
+177
+178
+179 public static <E> Enumeration<E> asEnumeration(final Iterator<E> iter) {
+180 return new Enumeration<E>() {
+181 public boolean hasMoreElements() {
+182 return iter.hasNext();
+183 }
+184 public E nextElement() {
+185 return iter.next();
+186 }
+187 };
+188 }
+189
+190
+191
+192
+193
+194
+195 public static <E> Iterator<E> asIterator(final Enumeration<E> e) {
+196 return new Iterator<E>() {
+197 public boolean hasNext() {
+198 return e.hasMoreElements();
+199 }
+200 public E next() {
+201 return e.nextElement();
+202 }
+203 public void remove() {
+204 throw new UnsupportedOperationException();
+205 }
+206 };
+207 }
+208
+209
+210
+211
+212
+213
+214 public static <T> Collection<T> asCollection(final Iterator<? extends T> iter) {
+215 List<T> l = new ArrayList<T>();
+216 while (iter.hasNext()) {
+217 l.add(iter.next());
+218 }
+219 return l;
+220 }
+221
+222 private static final class CompoundEnumeration<E> implements Enumeration<E> {
+223
+224 private final Enumeration<E> e1, e2;
+225
+226 public CompoundEnumeration (Enumeration<E> e1, Enumeration<E> e2) {
+227 this .e1 = e1;
+228 this .e2 = e2;
+229 }
+230
+231 public boolean hasMoreElements() {
+232 return e1.hasMoreElements() || e2.hasMoreElements();
+233 }
+234
+235 public E nextElement() throws NoSuchElementException {
+236 if (e1.hasMoreElements()) {
+237 return e1.nextElement();
+238 } else {
+239 return e2.nextElement();
+240 }
+241 }
+242
+243 }
+244
+245
+246
+247
+248
+249
+250
+251 public static int frequency(Collection<?> c, Object o) {
+252
+253 int freq = 0;
+254 if (c != null ) {
+255 for (Iterator<?> i = c.iterator(); i.hasNext(); ) {
+256 Object test = i.next();
+257 if (o == null ? test == null : o.equals(test)) {
+258 freq++;
+259 }
+260 }
+261 }
+262 return freq;
+263 }
+264
+265 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/FileUtils.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/FileUtils.html
new file mode 100644
index 000000000..f5c16d268
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/FileUtils.html
@@ -0,0 +1,1680 @@
+
+
+
+FileUtils xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.util;
+19
+20 import java.io.File;
+21 import java.io.FilenameFilter;
+22 import java.io.IOException;
+23 import java.io.InputStream;
+24 import java.io.InputStreamReader;
+25 import java.io.OutputStream;
+26 import java.io.Reader;
+27 import java.io.Writer;
+28 import java.net.HttpURLConnection;
+29 import java.net.JarURLConnection;
+30 import java.net.MalformedURLException;
+31 import java.net.URL;
+32 import java.net.URLConnection;
+33 import java.nio.channels.Channel;
+34 import java.text.DecimalFormat;
+35 import java.util.ArrayList;
+36 import java.util.Arrays;
+37 import java.util.Iterator;
+38 import java.util.List;
+39 import java.util.Random;
+40 import java.util.Stack;
+41 import java.util.StringTokenizer;
+42 import java.util.jar.JarFile;
+43 import org.owasp.dependencycheck.org.apache.tools.ant.BuildException;
+44 import org.owasp.dependencycheck.org.apache.tools.ant.PathTokenizer;
+45 import org.owasp.dependencycheck.org.apache.tools.ant.launch.Locator;
+46 import org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition.Os;
+47
+48
+49
+50
+51
+52
+53 public class FileUtils {
+54
+55 private static final int DELETE_RETRY_SLEEP_MILLIS = 10;
+56 private static final int EXPAND_SPACE = 50;
+57 private static final FileUtils PRIMARY_INSTANCE = new FileUtils ();
+58
+59
+60 private static Random rand = new Random(System.currentTimeMillis()
+61 + Runtime.getRuntime().freeMemory());
+62
+63 private static final boolean ON_NETWARE = Os.isFamily("netware" );
+64 private static final boolean ON_DOS = Os.isFamily("dos" );
+65 private static final boolean ON_WIN9X = Os.isFamily("win9x" );
+66 private static final boolean ON_WINDOWS = Os.isFamily("windows" );
+67
+68 static final int BUF_SIZE = 8192;
+69
+70
+71
+72
+73 public static final long FAT_FILE_TIMESTAMP_GRANULARITY = 2000;
+74
+75
+76
+77
+78 public static final long UNIX_FILE_TIMESTAMP_GRANULARITY = 1000;
+79
+80
+81
+82
+83
+84 public static final long NTFS_FILE_TIMESTAMP_GRANULARITY = 1;
+85
+86
+87
+88
+89
+90 private Object cacheFromUriLock = new Object();
+91 private String cacheFromUriRequest = null ;
+92 private String cacheFromUriResponse = null ;
+93
+94
+95
+96
+97
+98
+99
+100 public static FileUtils newFileUtils() {
+101 return new FileUtils ();
+102 }
+103
+104
+105
+106
+107
+108
+109
+110 public static FileUtils getFileUtils() {
+111 return PRIMARY_INSTANCE;
+112 }
+113
+114
+115
+116
+117 protected FileUtils () {
+118 }
+119
+120
+121
+122
+123
+124
+125
+126
+127 public URL getFileURL(File file) throws MalformedURLException {
+128 return new URL(file.toURI().toASCIIString());
+129 }
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580 public File resolveFile(File file, String filename) {
+581 if (!isAbsolutePath(filename)) {
+582 char sep = File.separatorChar;
+583 filename = filename.replace('/', sep).replace('\\', sep);
+584 if (isContextRelativePath(filename)) {
+585 file = null ;
+586
+587
+588 String udir = System.getProperty("user.dir" );
+589 if (filename.charAt(0) == sep && udir.charAt(0) == sep) {
+590 filename = dissect(udir)[0] + filename.substring(1);
+591 }
+592 }
+593 filename = new File(file, filename).getAbsolutePath();
+594 }
+595 return normalize(filename);
+596 }
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608 public static boolean isContextRelativePath(String filename) {
+609 if (!(ON_DOS || ON_NETWARE) || filename.length() == 0) {
+610 return false;
+611 }
+612 char sep = File.separatorChar;
+613 filename = filename.replace('/', sep).replace('\\', sep);
+614 char c = filename.charAt(0);
+615 int len = filename.length();
+616 return (c == sep && (len == 1 || filename.charAt(1) != sep))
+617 || (Character.isLetter(c) && len > 1
+618 && filename.charAt(1) == ':'
+619 && (len == 2 || filename.charAt(2) != sep));
+620 }
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632 public static boolean isAbsolutePath(String filename) {
+633 int len = filename.length();
+634 if (len == 0) {
+635 return false;
+636 }
+637 char sep = File.separatorChar;
+638 filename = filename.replace('/', sep).replace('\\', sep);
+639 char c = filename.charAt(0);
+640 if (!(ON_DOS || ON_NETWARE)) {
+641 return (c == sep);
+642 }
+643 if (c == sep) {
+644
+645 if (!(ON_DOS && len > 4 && filename.charAt(1) == sep)) {
+646 return false;
+647 }
+648
+649 int nextsep = filename.indexOf(sep, 2);
+650 return nextsep > 2 && nextsep + 1 < len;
+651 }
+652 int colon = filename.indexOf(':');
+653 return (Character.isLetter(c) && colon == 1
+654 && filename.length() > 2 && filename.charAt(2) == sep)
+655 || (ON_NETWARE && colon > 0);
+656 }
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671 public static String translatePath(String toProcess) {
+672 if (toProcess == null || toProcess.length() == 0) {
+673 return "" ;
+674 }
+675 StringBuffer path = new StringBuffer(toProcess.length() + EXPAND_SPACE);
+676 PathTokenizer tokenizer = new PathTokenizer (toProcess);
+677 while (tokenizer.hasMoreTokens()) {
+678 String pathComponent = tokenizer.nextToken();
+679 pathComponent = pathComponent.replace('/', File.separatorChar);
+680 pathComponent = pathComponent.replace('\\', File.separatorChar);
+681 if (path.length() != 0) {
+682 path.append(File.pathSeparatorChar);
+683 }
+684 path.append(pathComponent);
+685 }
+686 return path.toString();
+687 }
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707 public File normalize(final String path) {
+708 Stack s = new Stack();
+709 String[] dissect = dissect(path);
+710 s.push(dissect[0]);
+711
+712 StringTokenizer tok = new StringTokenizer(dissect[1], File.separator);
+713 while (tok.hasMoreTokens()) {
+714 String thisToken = tok.nextToken();
+715 if ("." .equals(thisToken)) {
+716 continue ;
+717 }
+718 if (".." .equals(thisToken)) {
+719 if (s.size() < 2) {
+720
+721 return new File(path);
+722 }
+723 s.pop();
+724 } else {
+725 s.push(thisToken);
+726 }
+727 }
+728 StringBuffer sb = new StringBuffer();
+729 final int size = s.size();
+730 for (int i = 0; i < size; i++) {
+731 if (i > 1) {
+732
+733
+734 sb.append(File.separatorChar);
+735 }
+736 sb.append(s.elementAt(i));
+737 }
+738 return new File(sb.toString());
+739 }
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749 public String[] dissect(String path) {
+750 char sep = File.separatorChar;
+751 path = path.replace('/', sep).replace('\\', sep);
+752
+753
+754 if (!isAbsolutePath(path)) {
+755 throw new BuildException (path + " is not an absolute path" );
+756 }
+757 String root = null ;
+758 int colon = path.indexOf(':');
+759 if (colon > 0 && (ON_DOS || ON_NETWARE)) {
+760
+761 int next = colon + 1;
+762 root = path.substring(0, next);
+763 char [] ca = path.toCharArray();
+764 root += sep;
+765
+766 next = (ca[next] == sep) ? next + 1 : next;
+767
+768 StringBuffer sbPath = new StringBuffer();
+769
+770 for (int i = next; i < ca.length; i++) {
+771 if (ca[i] != sep || ca[i - 1] != sep) {
+772 sbPath.append(ca[i]);
+773 }
+774 }
+775 path = sbPath.toString();
+776 } else if (path.length() > 1 && path.charAt(1) == sep) {
+777
+778 int nextsep = path.indexOf(sep, 2);
+779 nextsep = path.indexOf(sep, nextsep + 1);
+780 root = (nextsep > 2) ? path.substring(0, nextsep + 1) : path;
+781 path = path.substring(root.length());
+782 } else {
+783 root = File.separator;
+784 path = path.substring(1);
+785 }
+786 return new String[]{root, path};
+787 }
+788
+789
+790
+791
+792
+793
+794
+795
+796 public String toVMSPath(File f) {
+797
+798 String osPath;
+799 String path = normalize(f.getAbsolutePath()).getPath();
+800 String name = f.getName();
+801 boolean isAbsolute = path.charAt(0) == File.separatorChar;
+802
+803
+804 boolean isDirectory = f.isDirectory()
+805 && !name.regionMatches(true , name.length() - 4, ".DIR" , 0, 4);
+806
+807 String device = null ;
+808 StringBuffer directory = null ;
+809 String file = null ;
+810
+811 int index = 0;
+812
+813 if (isAbsolute) {
+814 index = path.indexOf(File.separatorChar, 1);
+815 if (index == -1) {
+816 return path.substring(1) + ":[000000]" ;
+817 }
+818 device = path.substring(1, index++);
+819 }
+820 if (isDirectory) {
+821 directory = new StringBuffer(path.substring(index).replace(File.separatorChar, '.'));
+822 } else {
+823 int dirEnd = path.lastIndexOf(File.separatorChar, path.length());
+824 if (dirEnd == -1 || dirEnd < index) {
+825 file = path.substring(index);
+826 } else {
+827 directory = new StringBuffer(path.substring(index, dirEnd).
+828 replace(File.separatorChar, '.'));
+829 index = dirEnd + 1;
+830 if (path.length() > index) {
+831 file = path.substring(index);
+832 }
+833 }
+834 }
+835 if (!isAbsolute && directory != null ) {
+836 directory.insert(0, '.');
+837 }
+838 osPath = ((device != null ) ? device + ":" : "" )
+839 + ((directory != null ) ? "[" + directory + "]" : "" )
+840 + ((file != null ) ? file : "" );
+841 return osPath;
+842 }
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862 public File createTempFile(String prefix, String suffix, File parentDir) {
+863 return createTempFile(prefix, suffix, parentDir, false, false);
+864 }
+865
+866 private static final String NULL_PLACEHOLDER = "null" ;
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886 public File createTempFile(String prefix, String suffix, File parentDir,
+887 boolean deleteOnExit, boolean createFile) {
+888 File result = null ;
+889 String parent = (parentDir == null )
+890 ? System.getProperty("java.io.tmpdir" )
+891 : parentDir.getPath();
+892 if (prefix == null ) {
+893 prefix = NULL_PLACEHOLDER;
+894 }
+895 if (suffix == null ) {
+896 suffix = NULL_PLACEHOLDER;
+897 }
+898
+899 if (createFile) {
+900 try {
+901 result = File.createTempFile(prefix, suffix, new File(parent));
+902 } catch (IOException e) {
+903 throw new BuildException ("Could not create tempfile in "
+904 + parent, e);
+905 }
+906 } else {
+907 DecimalFormat fmt = new DecimalFormat("#####" );
+908 synchronized (rand) {
+909 do {
+910 result = new File(parent, prefix
+911 + fmt.format(rand.nextInt(Integer.MAX_VALUE)) + suffix);
+912 } while (result.exists());
+913 }
+914 }
+915
+916 if (deleteOnExit) {
+917 result.deleteOnExit();
+918 }
+919 return result;
+920 }
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941 public File createTempFile(String prefix, String suffix,
+942 File parentDir, boolean deleteOnExit) {
+943 return createTempFile(prefix, suffix, parentDir, deleteOnExit, false);
+944 }
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985 public File getParentFile(File f) {
+986 return (f == null ) ? null : f.getParentFile();
+987 }
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997 public static String readFully(Reader rdr) throws IOException {
+998 return readFully(rdr, BUF_SIZE);
+999 }
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011 public static String readFully(Reader rdr, int bufferSize)
+1012 throws IOException {
+1013 if (bufferSize <= 0) {
+1014 throw new IllegalArgumentException("Buffer size must be greater "
+1015 + "than 0" );
+1016 }
+1017 final char [] buffer = new char [bufferSize];
+1018 int bufferLength = 0;
+1019 StringBuffer textBuffer = null ;
+1020 while (bufferLength != -1) {
+1021 bufferLength = rdr.read(buffer);
+1022 if (bufferLength > 0) {
+1023 textBuffer = (textBuffer == null ) ? new StringBuffer() : textBuffer;
+1024 textBuffer.append(new String(buffer, 0, bufferLength));
+1025 }
+1026 }
+1027 return (textBuffer == null ) ? null : textBuffer.toString();
+1028 }
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038 public static String safeReadFully(Reader reader) throws IOException {
+1039 String ret = readFully(reader);
+1040 return ret == null ? "" : ret;
+1041 }
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056 public boolean createNewFile(File f) throws IOException {
+1057 return f.createNewFile();
+1058 }
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069 public boolean createNewFile(File f, boolean mkdirs) throws IOException {
+1070 File parent = f.getParentFile();
+1071 if (mkdirs && !(parent.exists())) {
+1072 parent.mkdirs();
+1073 }
+1074 return f.createNewFile();
+1075 }
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092 public boolean isSymbolicLink(File parent, String name)
+1093 throws IOException {
+1094 SymbolicLinkUtils u = SymbolicLinkUtils.getSymbolicLinkUtils();
+1095 if (parent == null ) {
+1096 return u.isSymbolicLink(name);
+1097 }
+1098 return u.isSymbolicLink(parent, name);
+1099 }
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112 public String removeLeadingPath(File leading, File path) {
+1113 String l = normalize(leading.getAbsolutePath()).getAbsolutePath();
+1114 String p = normalize(path.getAbsolutePath()).getAbsolutePath();
+1115 if (l.equals(p)) {
+1116 return "" ;
+1117 }
+1118
+1119
+1120 if (!l.endsWith(File.separator)) {
+1121 l += File.separator;
+1122 }
+1123 return (p.startsWith(l)) ? p.substring(l.length()) : p;
+1124 }
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134 public boolean isLeadingPath(File leading, File path) {
+1135 String l = normalize(leading.getAbsolutePath()).getAbsolutePath();
+1136 String p = normalize(path.getAbsolutePath()).getAbsolutePath();
+1137 if (l.equals(p)) {
+1138 return true ;
+1139 }
+1140
+1141
+1142 if (!l.endsWith(File.separator)) {
+1143 l += File.separator;
+1144 }
+1145 return p.startsWith(l);
+1146 }
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167 public String toURI(String path) {
+1168 return new File(path).toURI().toASCIIString();
+1169 }
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184 public String fromURI(String uri) {
+1185 synchronized (cacheFromUriLock) {
+1186 if (uri.equals(cacheFromUriRequest)) {
+1187 return cacheFromUriResponse;
+1188 }
+1189 String path = Locator.fromURI(uri);
+1190 String ret = isAbsolutePath(path) ? normalize(path).getAbsolutePath() : path;
+1191 cacheFromUriRequest = uri;
+1192 cacheFromUriResponse = ret;
+1193 return ret;
+1194 }
+1195 }
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211 public boolean fileNameEquals(File f1, File f2) {
+1212 return normalize(f1.getAbsolutePath()).getAbsolutePath().equals(
+1213 normalize(f2.getAbsolutePath()).getAbsolutePath());
+1214 }
+1215
+1216
+1217
+1218
+1219
+1220
+1221 public boolean areSame(File f1, File f2) throws IOException {
+1222 if (f1 == null && f2 == null ) {
+1223 return true ;
+1224 }
+1225 if (f1 == null || f2 == null ) {
+1226 return false;
+1227 }
+1228 File f1Normalized = normalize(f1.getAbsolutePath());
+1229 File f2Normalized = normalize(f2.getAbsolutePath());
+1230 return f1Normalized.equals(f2Normalized)
+1231 || f1Normalized.getCanonicalFile().equals(f2Normalized
+1232 .getCanonicalFile());
+1233 }
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287 public long getFileTimestampGranularity() {
+1288 if (ON_WIN9X) {
+1289 return FAT_FILE_TIMESTAMP_GRANULARITY;
+1290 }
+1291 if (ON_WINDOWS) {
+1292 return NTFS_FILE_TIMESTAMP_GRANULARITY;
+1293 }
+1294 if (ON_DOS) {
+1295 return FAT_FILE_TIMESTAMP_GRANULARITY;
+1296 }
+1297 return UNIX_FILE_TIMESTAMP_GRANULARITY;
+1298 }
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320 public boolean hasErrorInCase(File localFile) {
+1321 localFile = normalize(localFile.getAbsolutePath());
+1322 if (!localFile.exists()) {
+1323 return false;
+1324 }
+1325 final String localFileName = localFile.getName();
+1326 FilenameFilter ff = new FilenameFilter() {
+1327 public boolean accept(File dir, String name) {
+1328 return name.equalsIgnoreCase(localFileName) && (!name.equals(localFileName));
+1329 }
+1330 };
+1331 String[] names = localFile.getParentFile().list(ff);
+1332 return names != null && names.length == 1;
+1333 }
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345 public boolean isUpToDate(File source, File dest, long granularity) {
+1346
+1347 if (!dest.exists()) {
+1348
+1349 return false;
+1350 }
+1351 long sourceTime = source.lastModified();
+1352 long destTime = dest.lastModified();
+1353 return isUpToDate(sourceTime, destTime, granularity);
+1354 }
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364 public boolean isUpToDate(File source, File dest) {
+1365 return isUpToDate(source, dest, getFileTimestampGranularity());
+1366 }
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376 public boolean isUpToDate(long sourceTime, long destTime, long granularity) {
+1377 return destTime != -1 && destTime >= sourceTime + granularity;
+1378 }
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387 public boolean isUpToDate(long sourceTime, long destTime) {
+1388 return isUpToDate(sourceTime, destTime, getFileTimestampGranularity());
+1389 }
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397 public static void close(Writer device) {
+1398 if (null != device) {
+1399 try {
+1400 device.close();
+1401 } catch (IOException e) {
+1402
+1403 }
+1404 }
+1405 }
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413 public static void close(Reader device) {
+1414 if (null != device) {
+1415 try {
+1416 device.close();
+1417 } catch (IOException e) {
+1418
+1419 }
+1420 }
+1421 }
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429 public static void close(OutputStream device) {
+1430 if (null != device) {
+1431 try {
+1432 device.close();
+1433 } catch (IOException e) {
+1434
+1435 }
+1436 }
+1437 }
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445 public static void close(InputStream device) {
+1446 if (null != device) {
+1447 try {
+1448 device.close();
+1449 } catch (IOException e) {
+1450
+1451 }
+1452 }
+1453 }
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462 public static void close(Channel device) {
+1463 if (null != device) {
+1464 try {
+1465 device.close();
+1466 } catch (IOException e) {
+1467
+1468 }
+1469 }
+1470 }
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478 public static void close(URLConnection conn) {
+1479 if (conn != null ) {
+1480 try {
+1481 if (conn instanceof JarURLConnection) {
+1482 JarURLConnection juc = (JarURLConnection) conn;
+1483 JarFile jf = juc.getJarFile();
+1484 jf.close();
+1485 jf = null ;
+1486 } else if (conn instanceof HttpURLConnection) {
+1487 ((HttpURLConnection) conn).disconnect();
+1488 }
+1489 } catch (IOException exc) {
+1490
+1491 }
+1492 }
+1493 }
+1494
+1495
+1496
+1497
+1498
+1499
+1500 public static void delete(File file) {
+1501 if (file != null ) {
+1502 file.delete();
+1503 }
+1504 }
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513 public boolean tryHardToDelete(File f) {
+1514 return tryHardToDelete(f, ON_WINDOWS);
+1515 }
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523 public boolean tryHardToDelete(File f, boolean runGC) {
+1524 if (!f.delete()) {
+1525 if (runGC) {
+1526 System.gc();
+1527 }
+1528 try {
+1529 Thread.sleep(DELETE_RETRY_SLEEP_MILLIS);
+1530 } catch (InterruptedException ex) {
+1531
+1532 }
+1533 return f.delete();
+1534 }
+1535 return true ;
+1536 }
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553 public static String getRelativePath(File fromFile, File toFile) throws Exception {
+1554 String fromPath = fromFile.getCanonicalPath();
+1555 String toPath = toFile.getCanonicalPath();
+1556
+1557
+1558 String[] fromPathStack = getPathStack(fromPath);
+1559 String[] toPathStack = getPathStack(toPath);
+1560
+1561 if (0 < toPathStack.length && 0 < fromPathStack.length) {
+1562 if (!fromPathStack[0].equals(toPathStack[0])) {
+1563
+1564
+1565 return getPath(Arrays.asList(toPathStack));
+1566 }
+1567 } else {
+1568
+1569 return getPath(Arrays.asList(toPathStack));
+1570 }
+1571
+1572 int minLength = Math.min(fromPathStack.length, toPathStack.length);
+1573 int same = 1;
+1574
+1575
+1576 for (;
+1577 same < minLength && fromPathStack[same].equals(toPathStack[same]);
+1578 same++) {
+1579
+1580 }
+1581
+1582 List relativePathStack = new ArrayList();
+1583
+1584
+1585
+1586 for (int i = same; i < fromPathStack.length; i++) {
+1587 relativePathStack.add(".." );
+1588 }
+1589
+1590
+1591 for (int i = same; i < toPathStack.length; i++) {
+1592 relativePathStack.add(toPathStack[i]);
+1593 }
+1594
+1595 return getPath(relativePathStack);
+1596 }
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606 public static String[] getPathStack(String path) {
+1607 String normalizedPath = path.replace(File.separatorChar, '/');
+1608
+1609 return normalizedPath.split("/" );
+1610 }
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620 public static String getPath(List pathStack) {
+1621
+1622 return getPath(pathStack, '/');
+1623 }
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634 public static String getPath(final List pathStack, final char separatorChar) {
+1635 final StringBuffer buffer = new StringBuffer();
+1636
+1637 final Iterator iter = pathStack.iterator();
+1638 if (iter.hasNext()) {
+1639 buffer.append(iter.next());
+1640 }
+1641 while (iter.hasNext()) {
+1642 buffer.append(separatorChar);
+1643 buffer.append(iter.next());
+1644 }
+1645 return buffer.toString();
+1646 }
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654 public String getDefaultEncoding() {
+1655 InputStreamReader is = new InputStreamReader(
+1656 new InputStream() {
+1657 public int read() {
+1658 return -1;
+1659 }
+1660 });
+1661 try {
+1662 return is.getEncoding();
+1663 } finally {
+1664 close(is);
+1665 }
+1666 }
+1667 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/SymbolicLinkUtils.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/SymbolicLinkUtils.html
new file mode 100644
index 000000000..54d70de43
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/SymbolicLinkUtils.html
@@ -0,0 +1,304 @@
+
+
+
+SymbolicLinkUtils xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.util;
+19
+20 import java.io.File;
+21 import java.io.FilenameFilter;
+22 import java.io.IOException;
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32 public class SymbolicLinkUtils {
+33
+34 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+35
+36
+37
+38
+39 private static final SymbolicLinkUtils PRIMARY_INSTANCE
+40 = new SymbolicLinkUtils ();
+41
+42
+43
+44
+45
+46
+47 public static SymbolicLinkUtils getSymbolicLinkUtils() {
+48
+49
+50 return PRIMARY_INSTANCE;
+51 }
+52
+53
+54
+55
+56 protected SymbolicLinkUtils () {
+57 }
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71 public boolean isSymbolicLink(File file) throws IOException {
+72 return isSymbolicLink(file.getParentFile(), file.getName());
+73 }
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87 public boolean isSymbolicLink(String name) throws IOException {
+88 return isSymbolicLink(new File(name));
+89 }
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104 public boolean isSymbolicLink(File parent, String name)
+105 throws IOException {
+106 File toTest = parent != null
+107 ? new File(parent.getCanonicalPath(), name)
+108 : new File(name);
+109 return !toTest.getAbsolutePath().equals(toTest.getCanonicalPath());
+110 }
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128 public boolean isDanglingSymbolicLink(String name) throws IOException {
+129 return isDanglingSymbolicLink(new File(name));
+130 }
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148 public boolean isDanglingSymbolicLink(File file) throws IOException {
+149 return isDanglingSymbolicLink(file.getParentFile(), file.getName());
+150 }
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169 public boolean isDanglingSymbolicLink(File parent, String name)
+170 throws IOException {
+171 File f = new File(parent, name);
+172 if (!f.exists()) {
+173 final String localName = f.getName();
+174 String[] c = parent.list(new FilenameFilter() {
+175 public boolean accept(File d, String n) {
+176 return localName.equals(n);
+177 }
+178 });
+179 return c != null && c.length > 0;
+180 }
+181 return false;
+182 }
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/VectorSet.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/VectorSet.html
new file mode 100644
index 000000000..501d23a0a
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/VectorSet.html
@@ -0,0 +1,255 @@
+
+
+
+VectorSet xref
+
+
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18 package org.owasp.dependencycheck.org.apache.tools.ant.util;
+19
+20 import java.util.Collection;
+21 import java.util.HashSet;
+22 import java.util.LinkedList;
+23 import java.util.Set;
+24 import java.util.Vector;
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40 public final class VectorSet<E> extends Vector<E> {
+41 private static final long serialVersionUID = 1L;
+42
+43 private final HashSet<E> set = new HashSet<E>();
+44
+45 public VectorSet () { super (); }
+46
+47 public VectorSet (int initialCapacity) { super (initialCapacity); }
+48
+49 public VectorSet (int initialCapacity, int capacityIncrement) {
+50 super (initialCapacity, capacityIncrement);
+51 }
+52
+53 public VectorSet (Collection<? extends E> c) {
+54 if (c != null ) {
+55 for (E e : c) {
+56 add(e);
+57 }
+58 }
+59 }
+60
+61 public synchronized boolean add(E o) {
+62 if (!set.contains(o)) {
+63 doAdd(size(), o);
+64 return true ;
+65 }
+66 return false;
+67 }
+68
+69
+70
+71
+72
+73 public void add(int index, E o) {
+74 doAdd(index, o);
+75 }
+76
+77 private synchronized void doAdd(int index, E o) {
+78
+79
+80 if (set.add(o)) {
+81 int count = size();
+82 ensureCapacity(count + 1);
+83 if (index != count) {
+84 System.arraycopy(elementData, index, elementData, index + 1,
+85 count - index);
+86 }
+87 elementData[index] = o;
+88 elementCount++;
+89 }
+90 }
+91
+92 public synchronized void addElement(E o) {
+93 doAdd(size(), o);
+94 }
+95
+96 public synchronized boolean addAll(Collection<? extends E> c) {
+97 boolean changed = false;
+98 for (E e : c) {
+99 changed |= add(e);
+100 }
+101 return changed;
+102 }
+103
+104
+105
+106
+107
+108 public synchronized boolean addAll(int index, Collection<? extends E> c) {
+109 LinkedList toAdd = new LinkedList();
+110 for (E e : c) {
+111 if (set.add(e)) {
+112 toAdd.add(e);
+113 }
+114 }
+115 if (toAdd.isEmpty()) {
+116 return false;
+117 }
+118 int count = size();
+119 ensureCapacity(count + toAdd.size());
+120 if (index != count) {
+121 System.arraycopy(elementData, index, elementData, index + toAdd.size(),
+122 count - index);
+123 }
+124 for (Object o : toAdd) {
+125 elementData[index++] = o;
+126 }
+127 elementCount += toAdd.size();
+128 return true ;
+129 }
+130
+131 public synchronized void clear() {
+132 super .clear();
+133 set.clear();
+134 }
+135
+136 public Object clone() {
+137 @SuppressWarnings("unchecked" )
+138 final VectorSet<E> vs = (VectorSet<E>) super .clone();
+139 vs.set.addAll(set);
+140 return vs;
+141 }
+142
+143 public synchronized boolean contains(Object o) {
+144 return set.contains(o);
+145 }
+146
+147 public synchronized boolean containsAll(Collection<?> c) {
+148 return set.containsAll(c);
+149 }
+150
+151 public void insertElementAt(E o, int index) {
+152 doAdd(index, o);
+153 }
+154
+155 public synchronized E remove(int index) {
+156 E o = get(index);
+157 remove(o);
+158 return o;
+159 }
+160
+161 public boolean remove(Object o) {
+162 return doRemove(o);
+163 }
+164
+165 private synchronized boolean doRemove(Object o) {
+166
+167
+168 if (set.remove(o)) {
+169 int index = indexOf(o);
+170 if (index < elementData.length - 1) {
+171 System.arraycopy(elementData, index + 1, elementData, index,
+172 elementData.length - index - 1);
+173 }
+174 elementCount--;
+175 return true ;
+176 }
+177 return false;
+178 }
+179
+180 public synchronized boolean removeAll(Collection<?> c) {
+181 boolean changed = false;
+182 for (Object o : c) {
+183 changed |= remove(o);
+184 }
+185 return changed;
+186 }
+187
+188 public synchronized void removeAllElements() {
+189 set.clear();
+190 super .removeAllElements();
+191 }
+192
+193 public boolean removeElement(Object o) {
+194 return doRemove(o);
+195 }
+196
+197 public synchronized void removeElementAt(int index) {
+198 remove(get(index));
+199 }
+200
+201 public synchronized void removeRange(final int fromIndex, int toIndex) {
+202 while (toIndex > fromIndex) {
+203 remove(--toIndex);
+204 }
+205 }
+206
+207 public synchronized boolean retainAll(Collection<?> c) {
+208 if (!(c instanceof Set)) {
+209 c = new HashSet<Object>(c);
+210 }
+211 LinkedList<E> l = new LinkedList<E>();
+212 for (E o : this ) {
+213 if (!c.contains(o)) {
+214 l.addLast(o);
+215 }
+216 }
+217 if (!l.isEmpty()) {
+218 removeAll(l);
+219 return true ;
+220 }
+221 return false;
+222 }
+223
+224 public synchronized E set(int index, E o) {
+225 E orig = get(index);
+226 if (set.add(o)) {
+227 elementData[index] = o;
+228 set.remove(orig);
+229 } else {
+230 int oldIndexOfO = indexOf(o);
+231 remove(o);
+232 remove(orig);
+233 add(oldIndexOfO > index ? index : index - 1, o);
+234 }
+235 return orig;
+236 }
+237
+238 public void setElementAt(E o, int index) {
+239 set(index, o);
+240 }
+241
+242 }
+
+
+
+
+
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/package-frame.html
new file mode 100644
index 000000000..ffbfa63f9
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/package-frame.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+
+
+
+
+ Classes
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/package-summary.html
new file mode 100644
index 000000000..3cc0f398c
--- /dev/null
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/org/apache/tools/ant/util/package-summary.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+
+
+
+
+ Package org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/FileUtils.html b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/FileUtils.html
index 1b06f62aa..a6c491774 100644
--- a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/FileUtils.html
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/FileUtils.html
@@ -86,7 +86,7 @@
78 if (!org.apache.commons.io.FileUtils.deleteQuietly(file)) {
79 success = false;
80 final String msg = String.format("Failed to delete file: %s; attempting to delete on exit." , file.getPath());
-81 LOGGER.log(Level.FINE, msg);
+81 LOGGER.log(Level.INFO, msg);
82 file.deleteOnExit();
83 }
84 return success;
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/Settings.html b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/Settings.html
index 598f7718c..45171a101 100644
--- a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/Settings.html
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/Settings.html
@@ -197,581 +197,589 @@
189
190 public static final String ANALYZER_NEXUS_PROXY = "analyzer.nexus.proxy" ;
191
-192
+192
193
-194 public static final String ANALYZER_ASSEMBLY_MONO_PATH = "analyzer.assembly.mono.path" ;
+194 public static final String ANALYZER_CENTRAL_ENABLED = "analyzer.central.enabled" ;
195
-196
+196
197
-198 public static final String ADDITIONAL_ZIP_EXTENSIONS = "extensions.zip" ;
+198 public static final String ANALYZER_CENTRAL_URL = "analyzer.central.url" ;
199
-200
+200
201
-202 public static final String SKIP_TEST_SCOPE = "skip.test.scope" ;
+202 public static final String ANALYZER_ASSEMBLY_MONO_PATH = "analyzer.assembly.mono.path" ;
203
-204
+204
205
-206 public static final String SKIP_RUNTIME_SCOPE = "skip.runtime.scope" ;
+206 public static final String ADDITIONAL_ZIP_EXTENSIONS = "extensions.zip" ;
207
-208
+208
209
-210 public static final String SKIP_PROVIDED_SCOPE = "skip.provided.scope" ;
-211
-212
-213
-214
-215 public static final String VFEED_DATA_FILE = "vfeed.data_file" ;
-216
-217
-218
-219 public static final String VFEED_CONNECTION_STRING = "vfeed.connection_string" ;
-220
-221
-222
-223
-224 public static final String VFEED_DOWNLOAD_URL = "vfeed.download_url" ;
-225
-226
-227
-228 public static final String VFEED_DOWNLOAD_FILE = "vfeed.download_file" ;
+210 public static final String SKIP_TEST_SCOPE = "skip.test.scope" ;
+211
+212
+213
+214 public static final String SKIP_RUNTIME_SCOPE = "skip.runtime.scope" ;
+215
+216
+217
+218 public static final String SKIP_PROVIDED_SCOPE = "skip.provided.scope" ;
+219
+220
+221
+222
+223 public static final String VFEED_DATA_FILE = "vfeed.data_file" ;
+224
+225
+226
+227 public static final String VFEED_CONNECTION_STRING = "vfeed.connection_string" ;
+228
229
-230
+230
231
-232 public static final String VFEED_UPDATE_STATUS = "vfeed.update_status" ;
-233 }
-234
-235
-236
-237
-238
-239 private static final Logger LOGGER = Logger.getLogger(Settings.class .getName());
-240
-241
-242
-243 private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
+232 public static final String VFEED_DOWNLOAD_URL = "vfeed.download_url" ;
+233
+234
+235
+236 public static final String VFEED_DOWNLOAD_FILE = "vfeed.download_file" ;
+237
+238
+239
+240 public static final String VFEED_UPDATE_STATUS = "vfeed.update_status" ;
+241 }
+242
+243
244
-245
+245
246
-247 private static ThreadLocal<Settings> localSettings = new ThreadLocal();
+247 private static final Logger LOGGER = Logger.getLogger(Settings.class .getName());
248
-249
+249
250
-251 private Properties props = null ;
-252
-253
-254
-255
-256
-257
-258 private Settings (String propertiesFilePath) {
-259 InputStream in = null ;
-260 props = new Properties();
-261 try {
-262 in = this .getClass().getClassLoader().getResourceAsStream(propertiesFilePath);
-263 props.load(in);
-264 } catch (IOException ex) {
-265 LOGGER.log(Level.SEVERE, "Unable to load default settings." );
-266 LOGGER.log(Level.FINE, null , ex);
-267 } finally {
-268 if (in != null ) {
-269 try {
-270 in.close();
-271 } catch (IOException ex) {
-272 LOGGER.log(Level.FINEST, null , ex);
-273 }
-274 }
-275 }
-276 logProperties("Properties loaded" , props);
-277 }
-278
-279
-280
-281
-282
-283 public static void initialize() {
-284 localSettings.set(new Settings (PROPERTIES_FILE));
+251 private static final String PROPERTIES_FILE = "dependencycheck.properties" ;
+252
+253
+254
+255 private static ThreadLocal<Settings> localSettings = new ThreadLocal();
+256
+257
+258
+259 private Properties props = null ;
+260
+261
+262
+263
+264
+265
+266 private Settings (String propertiesFilePath) {
+267 InputStream in = null ;
+268 props = new Properties();
+269 try {
+270 in = this .getClass().getClassLoader().getResourceAsStream(propertiesFilePath);
+271 props.load(in);
+272 } catch (IOException ex) {
+273 LOGGER.log(Level.SEVERE, "Unable to load default settings." );
+274 LOGGER.log(Level.FINE, null , ex);
+275 } finally {
+276 if (in != null ) {
+277 try {
+278 in.close();
+279 } catch (IOException ex) {
+280 LOGGER.log(Level.FINEST, null , ex);
+281 }
+282 }
+283 }
+284 logProperties("Properties loaded" , props);
285 }
286
287
288
289
-290
-291
-292
-293 public static void initialize(String propertiesFilePath) {
-294 localSettings.set(new Settings (propertiesFilePath));
-295 }
-296
-297
-298
-299
+290
+291 public static void initialize() {
+292 localSettings.set(new Settings (PROPERTIES_FILE));
+293 }
+294
+295
+296
+297
+298
+299
300
-301 public static void cleanup() {
-302 cleanup(true );
+301 public static void initialize(String propertiesFilePath) {
+302 localSettings.set(new Settings (propertiesFilePath));
303 }
304
305
306
307
-308
-309
-310 public static void cleanup(boolean deleteTemporary) {
-311 if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
-312 FileUtils.delete(tempDirectory);
-313 }
-314 try {
-315 localSettings.remove();
-316 } catch (Throwable ex) {
-317 LOGGER.log(Level.FINE, "Error cleaning up Settings" , ex);
-318 }
-319 }
-320
-321
-322
-323
-324
-325
-326 public static Settings getInstance() {
-327 return localSettings.get();
-328 }
-329
-330
-331
-332
-333
-334
-335 public static void setInstance(Settings instance) {
-336 localSettings.set(instance);
-337 }
-338
-339
-340
-341
-342
-343
-344
-345 private static void logProperties(String header, Properties properties) {
-346 if (LOGGER.isLoggable(Level.FINE)) {
-347 final StringWriter sw = new StringWriter();
-348 PrintWriter pw = null ;
-349 try {
-350 pw = new PrintWriter(sw);
-351 pw.format("%s:%n%n" , header);
-352 final Enumeration e = properties.propertyNames();
-353 while (e.hasMoreElements()) {
-354 final String key = (String) e.nextElement();
-355 if (key.contains("password" )) {
-356 pw.format("%s='*****'%n" , key);
-357 } else {
-358 final String value = properties.getProperty(key);
-359 if (value != null ) {
-360 pw.format("%s='%s'%n" , key, value);
-361 }
-362 }
-363 }
-364 pw.flush();
-365 LOGGER.fine(sw.toString());
-366 } finally {
-367 if (pw != null ) {
-368 pw.close();
-369 }
-370 }
-371
-372 }
-373 }
-374
-375
-376
-377
-378
-379
-380
-381 public static void setString(String key, String value) {
-382 localSettings.get().props.setProperty(key, value);
-383 if (LOGGER.isLoggable(Level.FINE)) {
-384 LOGGER.fine(String.format("Setting: %s='%s'" , key, value));
-385 }
-386 }
-387
-388
-389
-390
-391
-392
-393
-394 public static void setBoolean(String key, boolean value) {
-395 if (value) {
-396 localSettings.get().props.setProperty(key, Boolean.TRUE.toString());
-397 } else {
-398 localSettings.get().props.setProperty(key, Boolean.FALSE.toString());
-399 }
-400 if (LOGGER.isLoggable(Level.FINE)) {
-401 LOGGER.fine(String.format("Setting: %s='%b'" , key, value));
-402 }
-403 }
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414 public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
-415 FileInputStream fis = null ;
-416 try {
-417 fis = new FileInputStream(filePath);
-418 mergeProperties(fis);
-419 } finally {
-420 if (fis != null ) {
-421 try {
-422 fis.close();
-423 } catch (IOException ex) {
-424 LOGGER.log(Level.FINEST, "close error" , ex);
-425 }
-426 }
-427 }
-428 }
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439 public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
-440 FileInputStream fis = null ;
-441 try {
-442 fis = new FileInputStream(filePath);
-443 mergeProperties(fis);
-444 } finally {
-445 if (fis != null ) {
-446 try {
-447 fis.close();
-448 } catch (IOException ex) {
-449 LOGGER.log(Level.FINEST, "close error" , ex);
-450 }
-451 }
-452 }
-453 }
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463 public static void mergeProperties(InputStream stream) throws IOException {
-464 localSettings.get().props.load(stream);
-465 logProperties("Properties updated via merge" , localSettings.get().props);
-466 }
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476 public static File getFile(String key) {
-477 final String file = getString(key);
-478 if (file == null ) {
-479 return null ;
-480 }
-481 return new File(file);
-482 }
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496 protected static File getDataFile(String key) {
-497 final String file = getString(key);
-498 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - file: '%s'" , file));
-499 if (file == null ) {
-500 return null ;
-501 }
-502 if (file.startsWith("[JAR]" )) {
-503 LOGGER.log(Level.FINE, "Settings.getDataFile() - transforming filename" );
-504 final File jarPath = getJarPath();
-505 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - jar file: '%s'" , jarPath.toString()));
-506 final File retVal = new File(jarPath, file.substring(6));
-507 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - returning: '%s'" , retVal.toString()));
-508 return retVal;
+308
+309 public static void cleanup() {
+310 cleanup(true );
+311 }
+312
+313
+314
+315
+316
+317
+318 public static void cleanup(boolean deleteTemporary) {
+319 if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
+320 FileUtils.delete(tempDirectory);
+321 }
+322 try {
+323 localSettings.remove();
+324 } catch (Throwable ex) {
+325 LOGGER.log(Level.FINE, "Error cleaning up Settings" , ex);
+326 }
+327 }
+328
+329
+330
+331
+332
+333
+334 public static Settings getInstance() {
+335 return localSettings.get();
+336 }
+337
+338
+339
+340
+341
+342
+343 public static void setInstance(Settings instance) {
+344 localSettings.set(instance);
+345 }
+346
+347
+348
+349
+350
+351
+352
+353 private static void logProperties(String header, Properties properties) {
+354 if (LOGGER.isLoggable(Level.FINE)) {
+355 final StringWriter sw = new StringWriter();
+356 PrintWriter pw = null ;
+357 try {
+358 pw = new PrintWriter(sw);
+359 pw.format("%s:%n%n" , header);
+360 final Enumeration e = properties.propertyNames();
+361 while (e.hasMoreElements()) {
+362 final String key = (String) e.nextElement();
+363 if (key.contains("password" )) {
+364 pw.format("%s='*****'%n" , key);
+365 } else {
+366 final String value = properties.getProperty(key);
+367 if (value != null ) {
+368 pw.format("%s='%s'%n" , key, value);
+369 }
+370 }
+371 }
+372 pw.flush();
+373 LOGGER.fine(sw.toString());
+374 } finally {
+375 if (pw != null ) {
+376 pw.close();
+377 }
+378 }
+379
+380 }
+381 }
+382
+383
+384
+385
+386
+387
+388
+389 public static void setString(String key, String value) {
+390 localSettings.get().props.setProperty(key, value);
+391 if (LOGGER.isLoggable(Level.FINE)) {
+392 LOGGER.fine(String.format("Setting: %s='%s'" , key, value));
+393 }
+394 }
+395
+396
+397
+398
+399
+400
+401
+402 public static void setBoolean(String key, boolean value) {
+403 if (value) {
+404 localSettings.get().props.setProperty(key, Boolean.TRUE.toString());
+405 } else {
+406 localSettings.get().props.setProperty(key, Boolean.FALSE.toString());
+407 }
+408 if (LOGGER.isLoggable(Level.FINE)) {
+409 LOGGER.fine(String.format("Setting: %s='%b'" , key, value));
+410 }
+411 }
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422 public static void mergeProperties(File filePath) throws FileNotFoundException, IOException {
+423 FileInputStream fis = null ;
+424 try {
+425 fis = new FileInputStream(filePath);
+426 mergeProperties(fis);
+427 } finally {
+428 if (fis != null ) {
+429 try {
+430 fis.close();
+431 } catch (IOException ex) {
+432 LOGGER.log(Level.FINEST, "close error" , ex);
+433 }
+434 }
+435 }
+436 }
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447 public static void mergeProperties(String filePath) throws FileNotFoundException, IOException {
+448 FileInputStream fis = null ;
+449 try {
+450 fis = new FileInputStream(filePath);
+451 mergeProperties(fis);
+452 } finally {
+453 if (fis != null ) {
+454 try {
+455 fis.close();
+456 } catch (IOException ex) {
+457 LOGGER.log(Level.FINEST, "close error" , ex);
+458 }
+459 }
+460 }
+461 }
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471 public static void mergeProperties(InputStream stream) throws IOException {
+472 localSettings.get().props.load(stream);
+473 logProperties("Properties updated via merge" , localSettings.get().props);
+474 }
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484 public static File getFile(String key) {
+485 final String file = getString(key);
+486 if (file == null ) {
+487 return null ;
+488 }
+489 return new File(file);
+490 }
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504 protected static File getDataFile(String key) {
+505 final String file = getString(key);
+506 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - file: '%s'" , file));
+507 if (file == null ) {
+508 return null ;
509 }
-510 return new File(file);
-511 }
-512
-513
-514
-515
-516
-517
-518 private static File getJarPath() {
-519 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
-520 String decodedPath = "." ;
-521 try {
-522 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
-523 } catch (UnsupportedEncodingException ex) {
-524 LOGGER.log(Level.FINEST, null , ex);
-525 }
-526
-527 final File path = new File(decodedPath);
-528 if (path.getName().toLowerCase().endsWith(".jar" )) {
-529 return path.getParentFile();
-530 } else {
-531 return new File("." );
-532 }
-533 }
+510 if (file.startsWith("[JAR]" )) {
+511 LOGGER.log(Level.FINE, "Settings.getDataFile() - transforming filename" );
+512 final File jarPath = getJarPath();
+513 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - jar file: '%s'" , jarPath.toString()));
+514 final File retVal = new File(jarPath, file.substring(6));
+515 LOGGER.log(Level.FINE, String.format("Settings.getDataFile() - returning: '%s'" , retVal.toString()));
+516 return retVal;
+517 }
+518 return new File(file);
+519 }
+520
+521
+522
+523
+524
+525
+526 private static File getJarPath() {
+527 final String jarPath = Settings.class .getProtectionDomain().getCodeSource().getLocation().getPath();
+528 String decodedPath = "." ;
+529 try {
+530 decodedPath = URLDecoder.decode(jarPath, "UTF-8" );
+531 } catch (UnsupportedEncodingException ex) {
+532 LOGGER.log(Level.FINEST, null , ex);
+533 }
534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544 public static String getString(String key, String defaultValue) {
-545 final String str = System.getProperty(key, localSettings.get().props.getProperty(key, defaultValue));
-546 return str;
-547 }
-548
-549
-550
+535 final File path = new File(decodedPath);
+536 if (path.getName().toLowerCase().endsWith(".jar" )) {
+537 return path.getParentFile();
+538 } else {
+539 return new File("." );
+540 }
+541 }
+542
+543
+544
+545
+546
+547
+548
+549
+550
551
-552 private static File tempDirectory = null ;
-553
-554
-555
-556
-557
-558
+552 public static String getString(String key, String defaultValue) {
+553 final String str = System.getProperty(key, localSettings.get().props.getProperty(key, defaultValue));
+554 return str;
+555 }
+556
+557
+558
559
-560 public static File getTempDirectory() throws IOException {
-561 final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
-562 if (!tmpDir.exists()) {
-563 if (!tmpDir.mkdirs()) {
-564 final String msg = String.format("Unable to make a temporary folder '%s'" , tmpDir.getPath());
-565 throw new IOException(msg);
-566 } else {
-567 tempDirectory = tmpDir;
-568 }
-569 }
-570 return tmpDir;
-571 }
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581 public static String getString(String key) {
-582 return System.getProperty(key, localSettings.get().props.getProperty(key));
-583 }
-584
-585
-586
-587
-588
-589
-590 public static void removeProperty(String key) {
-591 localSettings.get().props.remove(key);
-592 }
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603 public static int getInt(String key) throws InvalidSettingException {
-604 int value;
-605 try {
-606 value = Integer.parseInt(Settings.getString(key));
-607 } catch (NumberFormatException ex) {
-608 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
-609 }
-610 return value;
-611 }
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623 public static int getInt(String key, int defaultValue) {
-624 int value;
-625 try {
-626 value = Integer.parseInt(Settings.getString(key));
-627 } catch (NumberFormatException ex) {
-628 final String msg = String.format("Could not convert property '%s' to an int." , key);
-629 LOGGER.log(Level.FINEST, msg, ex);
-630 value = defaultValue;
-631 }
-632 return value;
-633 }
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644 public static long getLong(String key) throws InvalidSettingException {
-645 long value;
-646 try {
-647 value = Long.parseLong(Settings.getString(key));
-648 } catch (NumberFormatException ex) {
-649 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
-650 }
-651 return value;
-652 }
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663 public static boolean getBoolean(String key) throws InvalidSettingException {
-664 boolean value;
-665 try {
-666 value = Boolean.parseBoolean(Settings.getString(key));
-667 } catch (NumberFormatException ex) {
-668 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
-669 }
-670 return value;
-671 }
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683 public static boolean getBoolean(String key, boolean defaultValue) throws InvalidSettingException {
-684 boolean value;
-685 try {
-686 final String strValue = Settings.getString(key);
-687 if (strValue == null ) {
-688 return defaultValue;
-689 }
-690 value = Boolean.parseBoolean(strValue);
-691 } catch (NumberFormatException ex) {
-692 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
-693 }
-694 return value;
-695 }
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709 public static String getConnectionString(String connectionStringKey, String dbFileNameKey, String dbVersionKey)
-710 throws IOException, InvalidSettingException {
-711 final String connStr = Settings.getString(connectionStringKey);
-712 if (connStr == null ) {
-713 final String msg = String.format("Invalid properties file to get the connection string; '%s' must be defined." ,
-714 connectionStringKey);
-715 throw new InvalidSettingException (msg);
-716 }
-717 if (connStr.contains("%s" )) {
-718 final File directory = getDataDirectory();
-719 String fileName = null ;
-720 if (dbFileNameKey != null ) {
-721 fileName = Settings.getString(dbFileNameKey);
-722 }
-723 if (fileName == null ) {
-724 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
-725 dbFileNameKey);
-726 throw new InvalidSettingException (msg);
-727 }
-728 if (fileName.contains("%s" )) {
-729 String version = null ;
-730 if (dbVersionKey != null ) {
-731 version = Settings.getString(dbVersionKey);
-732 }
-733 if (version == null ) {
-734 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
-735 dbFileNameKey);
-736 throw new InvalidSettingException (msg);
-737 }
-738 fileName = String.format(fileName, version);
-739 }
-740 if (connStr.startsWith("jdbc:h2:file:" ) && fileName.endsWith(".h2.db" )) {
-741 fileName = fileName.substring(0, fileName.length() - 6);
-742 }
-743
-744 final File dbFile = new File(directory, fileName);
-745 final String cString = String.format(connStr, dbFile.getCanonicalPath());
-746 LOGGER.log(Level.FINE, String.format("Connection String: '%s'" , cString));
-747 return cString;
-748 }
-749 return connStr;
-750 }
-751
-752
-753
-754
-755
-756
-757
-758
-759 public static File getDataDirectory() throws IOException {
-760 final File path = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
-761 if (path.exists() || path.mkdirs()) {
-762 return path;
-763 }
-764 throw new IOException(String.format("Unable to create the data directory '%s'" , path.getAbsolutePath()));
-765 }
-766 }
+560 private static File tempDirectory = null ;
+561
+562
+563
+564
+565
+566
+567
+568 public static File getTempDirectory() throws IOException {
+569 final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir" )));
+570 if (!tmpDir.exists()) {
+571 if (!tmpDir.mkdirs()) {
+572 final String msg = String.format("Unable to make a temporary folder '%s'" , tmpDir.getPath());
+573 throw new IOException(msg);
+574 } else {
+575 tempDirectory = tmpDir;
+576 }
+577 }
+578 return tmpDir;
+579 }
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589 public static String getString(String key) {
+590 return System.getProperty(key, localSettings.get().props.getProperty(key));
+591 }
+592
+593
+594
+595
+596
+597
+598 public static void removeProperty(String key) {
+599 localSettings.get().props.remove(key);
+600 }
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611 public static int getInt(String key) throws InvalidSettingException {
+612 int value;
+613 try {
+614 value = Integer.parseInt(Settings.getString(key));
+615 } catch (NumberFormatException ex) {
+616 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
+617 }
+618 return value;
+619 }
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631 public static int getInt(String key, int defaultValue) {
+632 int value;
+633 try {
+634 value = Integer.parseInt(Settings.getString(key));
+635 } catch (NumberFormatException ex) {
+636 final String msg = String.format("Could not convert property '%s' to an int." , key);
+637 LOGGER.log(Level.FINEST, msg, ex);
+638 value = defaultValue;
+639 }
+640 return value;
+641 }
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652 public static long getLong(String key) throws InvalidSettingException {
+653 long value;
+654 try {
+655 value = Long.parseLong(Settings.getString(key));
+656 } catch (NumberFormatException ex) {
+657 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
+658 }
+659 return value;
+660 }
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671 public static boolean getBoolean(String key) throws InvalidSettingException {
+672 boolean value;
+673 try {
+674 value = Boolean.parseBoolean(Settings.getString(key));
+675 } catch (NumberFormatException ex) {
+676 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
+677 }
+678 return value;
+679 }
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691 public static boolean getBoolean(String key, boolean defaultValue) throws InvalidSettingException {
+692 boolean value;
+693 try {
+694 final String strValue = Settings.getString(key);
+695 if (strValue == null ) {
+696 return defaultValue;
+697 }
+698 value = Boolean.parseBoolean(strValue);
+699 } catch (NumberFormatException ex) {
+700 throw new InvalidSettingException ("Could not convert property '" + key + "' to an int." , ex);
+701 }
+702 return value;
+703 }
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717 public static String getConnectionString(String connectionStringKey, String dbFileNameKey, String dbVersionKey)
+718 throws IOException, InvalidSettingException {
+719 final String connStr = Settings.getString(connectionStringKey);
+720 if (connStr == null ) {
+721 final String msg = String.format("Invalid properties file to get the connection string; '%s' must be defined." ,
+722 connectionStringKey);
+723 throw new InvalidSettingException (msg);
+724 }
+725 if (connStr.contains("%s" )) {
+726 final File directory = getDataDirectory();
+727 String fileName = null ;
+728 if (dbFileNameKey != null ) {
+729 fileName = Settings.getString(dbFileNameKey);
+730 }
+731 if (fileName == null ) {
+732 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
+733 dbFileNameKey);
+734 throw new InvalidSettingException (msg);
+735 }
+736 if (fileName.contains("%s" )) {
+737 String version = null ;
+738 if (dbVersionKey != null ) {
+739 version = Settings.getString(dbVersionKey);
+740 }
+741 if (version == null ) {
+742 final String msg = String.format("Invalid properties file to get a file based connection string; '%s' must be defined." ,
+743 dbFileNameKey);
+744 throw new InvalidSettingException (msg);
+745 }
+746 fileName = String.format(fileName, version);
+747 }
+748 if (connStr.startsWith("jdbc:h2:file:" ) && fileName.endsWith(".h2.db" )) {
+749 fileName = fileName.substring(0, fileName.length() - 6);
+750 }
+751
+752 final File dbFile = new File(directory, fileName);
+753 final String cString = String.format(connStr, dbFile.getCanonicalPath());
+754 LOGGER.log(Level.FINE, String.format("Connection String: '%s'" , cString));
+755 return cString;
+756 }
+757 return connStr;
+758 }
+759
+760
+761
+762
+763
+764
+765
+766
+767 public static File getDataDirectory() throws IOException {
+768 final File path = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
+769 if (path.exists() || path.mkdirs()) {
+770 return path;
+771 }
+772 throw new IOException(String.format("Unable to create the data directory '%s'" , path.getAbsolutePath()));
+773 }
+774 }
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-frame.html b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-frame.html
index 5add21560..2132bf6d6 100644
--- a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-frame.html
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-summary.html b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-summary.html
index 35d5dd1b0..5ffd2cdf6 100644
--- a/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-summary.html
+++ b/dependency-check-utils/xref/org/owasp/dependencycheck/utils/package-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference Package org.owasp.dependencycheck.utils
+ Dependency-Check Utils 1.2.6 Reference Package org.owasp.dependencycheck.utils
diff --git a/dependency-check-utils/xref/overview-frame.html b/dependency-check-utils/xref/overview-frame.html
index 879cf6ab8..18e83d47d 100644
--- a/dependency-check-utils/xref/overview-frame.html
+++ b/dependency-check-utils/xref/overview-frame.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
@@ -16,6 +16,27 @@
diff --git a/dependency-check-utils/xref/overview-summary.html b/dependency-check-utils/xref/overview-summary.html
index 2cb4f6f35..8728b53ef 100644
--- a/dependency-check-utils/xref/overview-summary.html
+++ b/dependency-check-utils/xref/overview-summary.html
@@ -3,7 +3,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
@@ -24,7 +24,7 @@
- Dependency-Check Utils 1.2.5 Reference
+ Dependency-Check Utils 1.2.6 Reference
@@ -34,6 +34,41 @@
+
+ org.owasp.dependencycheck.org.apache.tools.ant
+
+
+
+
+ org.owasp.dependencycheck.org.apache.tools.ant.launch
+
+
+
+
+ org.owasp.dependencycheck.org.apache.tools.ant.taskdefs.condition
+
+
+
+
+ org.owasp.dependencycheck.org.apache.tools.ant.types
+
+
+
+
+ org.owasp.dependencycheck.org.apache.tools.ant.types.resources
+
+
+
+
+ org.owasp.dependencycheck.org.apache.tools.ant.types.selectors
+
+
+
+
+ org.owasp.dependencycheck.org.apache.tools.ant.util
+
+
+
org.owasp.dependencycheck.utils
diff --git a/index.html b/index.html
index 3c84fbdd6..4541583c5 100644
--- a/index.html
+++ b/index.html
@@ -1,13 +1,13 @@
-
+
dependency-check - About
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -307,7 +307,7 @@
About
Dependency-check is an open source solution the OWASP Top 10 2013 entry: A9 - Using Components with Known Vulnerabilities . Dependency-check can currently be used to scan Java applications (and their dependent libraries) to identify known vulnerable components.
-The problem with using known vulnerable components was covered in a paper by Jeff Williams and Arshan Dabirsiaghi titled, "The Unfortunate Reality of Insecure Libraries " (registration required). The gist of the paper is that we as a development community include third party libraries in our applications that contain well known published vulnerabilities (such as those at the National Vulnerability Database ).
+The problem with using known vulnerable components was covered in a paper by Jeff Williams and Arshan Dabirsiaghi titled, “The Unfortunate Reality of Insecure Libraries ” (registration required). The gist of the paper is that we as a development community include third party libraries in our applications that contain well known published vulnerabilities (such as those at the National Vulnerability Database ).
More information about dependency-check can be found here:
diff --git a/internals.html b/internals.html
index 2cda21663..a80938ded 100644
--- a/internals.html
+++ b/internals.html
@@ -1,13 +1,13 @@
-
+
dependency-check - How does dependency-check work?
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/issue-tracking.html b/issue-tracking.html
index 805977357..98c4f9ab8 100644
--- a/issue-tracking.html
+++ b/issue-tracking.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Issue Tracking
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/jar-analyzer.html b/jar-analyzer.html
index e83d2ed33..542527344 100644
--- a/jar-analyzer.html
+++ b/jar-analyzer.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Jar Analyzer
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/license.html b/license.html
index 028760503..8c75ced36 100644
--- a/license.html
+++ b/license.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Project License
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/mail-lists.html b/mail-lists.html
index d2084aa5d..9eaa27f87 100644
--- a/mail-lists.html
+++ b/mail-lists.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Project Mailing Lists
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/modules.html b/modules.html
index 7ecc2e4be..d7388dbd5 100644
--- a/modules.html
+++ b/modules.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Project Modules
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/nexus-analyzer.html b/nexus-analyzer.html
index e250d5d48..4a9649330 100644
--- a/nexus-analyzer.html
+++ b/nexus-analyzer.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Nexus Analyzer
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/nuspec-analyzer.html b/nuspec-analyzer.html
index 40138b4d3..4e3817cb2 100644
--- a/nuspec-analyzer.html
+++ b/nuspec-analyzer.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Nuspec Analyzer
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/project-info.html b/project-info.html
index 1e2276eb0..bf1086bf4 100644
--- a/project-info.html
+++ b/project-info.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Project Information
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/project-summary.html b/project-summary.html
index 7e69eb3a9..c68b73623 100644
--- a/project-summary.html
+++ b/project-summary.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Project Summary
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
@@ -348,7 +348,7 @@
dependency-check-parent
Version
-1.2.5
+1.2.6
Type
pom
diff --git a/source-repository.html b/source-repository.html
index 51f7ffb7e..82f9b5168 100644
--- a/source-repository.html
+++ b/source-repository.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Source Repository
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/suppression.html b/suppression.html
index ed4f60074..d509299d6 100644
--- a/suppression.html
+++ b/suppression.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Suppressing False Positives
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/team-list.html b/team-list.html
index 2c23758b5..bd3fe5a6c 100644
--- a/team-list.html
+++ b/team-list.html
@@ -1,13 +1,13 @@
-
+
dependency-check - Team list
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6
diff --git a/thereport.html b/thereport.html
index b010c1723..987b3857f 100644
--- a/thereport.html
+++ b/thereport.html
@@ -1,13 +1,13 @@
-
+
dependency-check - How To Read The Report
@@ -62,9 +62,9 @@
- | Last Published: 2014-09-16
+ | Last Published: 2014-11-16
- Version: 1.2.5
+ Version: 1.2.6