summaryrefslogtreecommitdiffstats
path: root/utils/provider
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-02-01 16:57:00 -0500
committerDan Timoney <dtimoney@att.com>2018-02-09 17:08:35 -0500
commit131cb46f6109a6099a445cb8e1b12ff5b68ae6de (patch)
tree783f96f27c1bc9292fdd836c488c4dd8a86aeb2d /utils/provider
parente36be89362fe80a7cd3da69a886c6c1f1c99a65c (diff)
Upgrade sli/core to Nitrogen
Use Apache derby for dblib SingleFeatureTest Change-Id: I6b41f7ede1a98b33824fceea9100e75c1ce8dda4 Issue-ID: CCSDK-175 Signed-off-by: Dan Timoney <dtimoney@att.com> Generalization of CCSDK core/utils framework 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> Use Apache derby for dblib test Use Apache derby for dblib SingleFeatureTest Change-Id: Ie497557f162e203fa5c5c82c17ddc55ba0c11b38 Issue-ID: CCSDK-175 Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'utils/provider')
-rw-r--r--utils/provider/pom.xml35
-rwxr-xr-xutils/provider/src/main/java/org/onap/ccsdk/sli/core/utils/JREFileResolver.java7
2 files changed, 19 insertions, 23 deletions
diff --git a/utils/provider/pom.xml b/utils/provider/pom.xml
index b0adc7d46..7a4e8c9ed 100644
--- a/utils/provider/pom.xml
+++ b/utils/provider/pom.xml
@@ -1,21 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>utils</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <groupId>org.onap.ccsdk.parent</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
- <packaging>bundle</packaging>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>utils-provider</artifactId>
- <name>SLI Core Utilities Package</name>
+ <version>0.2.1-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+ <name>ccsdk-sli-core :: utils :: ${project.artifactId}</name>
<description>
The SLI Core Utilities Package provides common functionality for setting up SLI connectivity.
</description>
+ <organization>
+ <name>ONAP</name>
+ </organization>
<dependencies>
<dependency>
@@ -26,6 +31,7 @@
<groupId>equinoxSDK381</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>${equinox.osgi.version}</version>
+ <scope>provided</scope>
</dependency>
<!-- Testing Dependencies -->
@@ -41,17 +47,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${bundle.plugin.version}</version>
- </plugin>
- </plugins>
- </build>
- <organization>
- <name>Inocybe Technologies and Others</name>
- </organization>
</project>
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 8da9b7ef0..cc164d042 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
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -54,9 +54,11 @@ public class JREFileResolver implements PropertiesFileResolver {
*/
@Override
public Optional<File> resolveFile(final String filename) {
+
final Bundle bundle = FrameworkUtil.getBundle(this.clazz);
final File dataFile;
+
try {
if (bundle == null) {
return Optional.empty();
@@ -67,6 +69,7 @@ public class JREFileResolver implements PropertiesFileResolver {
return Optional.empty();
}
+
dataFile = bundle.getDataFile(filename);
if(dataFile.exists()) {
dataFile.delete();