aboutsummaryrefslogtreecommitdiffstats
path: root/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
diff options
context:
space:
mode:
authorRich Tabedzki <richard.tabedzki@att.com>2018-01-05 20:26:58 +0000
committerRich Tabedzki <richard.tabedzki@att.com>2018-01-06 17:11:58 +0000
commitd3cd4dd5d5f300684be256eb1bf70d750a9a957e (patch)
treec347d5c84fe597cf2232de529a8219f4f0a7b16f /utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
parent50e04450a21eb584fb843fbe009b29798b94a413 (diff)
Generalization of CCSDK core/utils frameworkdev/nitrogen
Changes made: * Created generalized version of core/utils/dblib as core/utils/common * Deprecated core/utils/dblib package Change-Id: I0992c43910278fbe254674d1e39d7e4fcad0a592 Issue-ID: CCSDK-168 Signed-off-by: Rich Tabedzki <richard.tabedzki@att.com>
Diffstat (limited to 'utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java')
-rwxr-xr-x[-rw-r--r--]utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java b/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
index 5cd6c360..844c6949 100644..100755
--- a/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
+++ b/utils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java
@@ -23,13 +23,15 @@ package org.onap.ccsdk.sli.core.utils;
import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
+import java.nio.file.FileSystemNotFoundException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
import org.osgi.framework.FrameworkUtil;
+import org.slf4j.LoggerFactory;
/**
- * Resolves dblib properties files relative to the directory identified by the JRE property
+ * Resolves project properties files relative to the directory identified by the JRE property
* <code>dblib.properties</code>.
*/
public class JREFileResolver implements PropertiesFileResolver {
@@ -37,7 +39,6 @@ public class JREFileResolver implements PropertiesFileResolver {
/**
* Key for JRE argument representing the configuration directory
*/
- private static final String DBLIB_JRE_PROPERTY_KEY = "dblib.properties";
private final String successMessage;
private final Class clazz;
@@ -55,14 +56,15 @@ public class JREFileResolver implements PropertiesFileResolver {
@Override
public Optional<File> resolveFile(final String filename) {
final URL jreArgumentUrl = FrameworkUtil.getBundle(this.clazz)
- .getResource(DBLIB_JRE_PROPERTY_KEY);
+ .getResource(filename);
try {
if (jreArgumentUrl == null) {
return Optional.empty();
}
final Path dblibPath = Paths.get(jreArgumentUrl.toURI());
return Optional.of(dblibPath.resolve(filename).toFile());
- } catch(final URISyntaxException e) {
+ } catch(final URISyntaxException | FileSystemNotFoundException e) {
+ LoggerFactory.getLogger(this.getClass()).error("", e);
return Optional.empty();
}
}