You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2020/03/19 11:50:22 UTC
[sling-org-apache-sling-installer-provider-file] branch master
updated: SLING-9218 configuration writeback must emit comments starting
with correct prefix
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-provider-file.git
The following commit(s) were added to refs/heads/master by this push:
new 678c9fb SLING-9218 configuration writeback must emit comments starting with correct prefix
678c9fb is described below
commit 678c9fb1063bfe9359e6f96cce97261a31cdb8be
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Mar 19 12:50:09 2020 +0100
SLING-9218 configuration writeback must emit comments starting with
correct prefix
---
.../org/apache/sling/installer/provider/file/impl/FileInstaller.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java b/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java
index c074f84..44c02b1 100644
--- a/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java
+++ b/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java
@@ -205,7 +205,8 @@ public class FileInstaller
final File file = new File(path);
file.getParentFile().mkdirs();
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(file))) {
- fos.write("# Configuration created by Apache Sling File Installer\n".getBytes(StandardCharsets.UTF_8));
+ // comments starting with "//" allowed according to https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html#d0e131566
+ fos.write("// Configuration created by Apache Sling File Installer\n".getBytes(StandardCharsets.UTF_8));
ConfigurationSerializer serializer = ConfigurationSerializerFactory.create(ConfigurationSerializerFactory.Format.JSON);
serializer.serialize(dict, fos);
}