This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/main by this push:
new e8bff81 [KARAF-6924] Don't create json configuration file by default
new 4ad3e27 Merge pull request #1338 from jbonofre/KARAF-6924
e8bff81 is described below
commit e8bff815940c457a43224fa92b1e0d5e502eb544
Author: jbonofre <[email protected]>
AuthorDate: Thu Mar 25 18:04:30 2021 +0100
[KARAF-6924] Don't create json configuration file by default
---
.../java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/config/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java
b/config/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java
index fc11a32..0466142 100644
---
a/config/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java
+++
b/config/src/main/java/org/apache/karaf/config/core/impl/JsonConfigInstaller.java
@@ -111,13 +111,11 @@ public class JsonConfigInstaller implements
ArtifactInstaller, ConfigurationList
try {
Configuration configuration =
configurationAdmin.getConfiguration(event.getPid(), null);
Dictionary<String, Object> dictionary =
configuration.getProcessedProperties(null);
- File file;
+ File file = null;
if (dictionary.get(DirectoryWatcher.FILENAME) != null) {
file =
getCfgFileFromProperty(configuration.getProperties().get(DirectoryWatcher.FILENAME));
- } else {
- file = new File(System.getProperty("karaf.etc"),
event.getPid() + ".json");
}
- if (canHandle(file)) {
+ if (file != null && canHandle(file)) {
dictionary.remove(DirectoryWatcher.FILENAME);
dictionary.remove(Constants.SERVICE_PID);
dictionary.remove(ConfigurationAdmin.SERVICE_FACTORYPID);