From 9fdf22a475ee35f87d3ca4a650a04082b4ac37fc Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sun, 20 Oct 2013 21:27:18 -0400 Subject: [PATCH] added anoter mergeProperties to take a File object instead of a String path Former-commit-id: efd4a93b47beac16c7005bf8dc62436de4c2cde6 --- .../owasp/dependencycheck/utils/Settings.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java index 6c2b8ac9c..b14b665ac 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/utils/Settings.java @@ -195,6 +195,23 @@ public final class Settings { } } + /** + * Merges a new properties file into the current properties. This method + * allows for the loading of a user provided properties file.

+ * Note: even if using this method - system properties will be loaded before + * properties loaded from files. + * + * @param filePath the path to the properties file to merge. + * @throws FileNotFoundException is thrown when the filePath points to a + * non-existent file + * @throws IOException is thrown when there is an exception loading/merging + * the properties + */ + public static void mergeProperties(File filePath) throws FileNotFoundException, IOException { + final FileInputStream fis = new FileInputStream(filePath); + mergeProperties(fis); + } + /** * Merges a new properties file into the current properties. This method * allows for the loading of a user provided properties file.