ConfigRepository uses felix.fileinstall.filename property if provided
@@ -69,7 +69,12 @@ public class ConfigRepositoryImpl implements ConfigRepository {
props.load(file);
props.put(FILEINSTALL_FILE_NAME, file.toURI().toString());
} else {
+ if (properties.containsKey(FILEINSTALL_FILE_NAME)) {
+ file = getCfgFileFromProperty(properties.get(FILEINSTALL_FILE_NAME));
+ }
+ if (file == null) {
file = new File(System.getProperty("karaf.etc"), pid + ".cfg");
+ }
props.putAll(properties);
props.keySet().retainAll(properties.keySet());
props.save(file);
@@ -135,7 +140,7 @@ public class ConfigRepositoryImpl implements ConfigRepository {
} catch (URISyntaxException e) {
throw new IOException(e);
}
- if (file != null) {
+ if (file != null && file.exists()) {
tp.load(file);
} else {
for (Enumeration<String> e = props.keys(); e.hasMoreElements();) {
