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/01/06 16:56:23 UTC

[sling-org-apache-sling-installer-provider-jcr] branch master updated: SLING-8419 write back with correct extension

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-jcr.git


The following commit(s) were added to refs/heads/master by this push:
     new f5ecaeb  SLING-8419 write back with correct extension
f5ecaeb is described below

commit f5ecaebce3c4f7bfcee2e75b9069de1d8f584277
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Jan 6 17:56:12 2020 +0100

    SLING-8419 write back with correct extension
---
 .../apache/sling/installer/provider/jcr/impl/JcrInstaller.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java b/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
index f16c567..a6879f5 100644
--- a/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
+++ b/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
@@ -105,6 +105,8 @@ public class JcrInstaller implements UpdateHandler, ManagedService {
     private static final String PROP_MIME = "jcr:mimeType";
     private static final String MIME_TXT = "text/plain";
     private static final String ENCODING = "UTF-8";
+    
+    private static final String CONFIG_FILE_EXTENSION = ".cfg.json";
 
     /** Default regexp for watched folders */
     public static final String DEFAULT_FOLDER_NAME_REGEXP = ".*/(install|config)$";
@@ -750,14 +752,14 @@ public class JcrInstaller implements UpdateHandler, ManagedService {
                     } else {
                         name = url.substring(lastSlash + 1, lastPos);
                     }
-                    nodePath = getPathWithHighestPrio(cfg, cfg.getNewConfigPath() + name + ".config");
+                    nodePath = getPathWithHighestPrio(cfg, cfg.getNewConfigPath() + name + CONFIG_FILE_EXTENSION);
                 }
                 // ensure extension 'config'
-                if ( !nodePath.endsWith(".config") ) {
+                if ( !nodePath.endsWith(CONFIG_FILE_EXTENSION) ) {
                     if ( session.itemExists(nodePath) ) {
                         session.getItem(nodePath).remove();
                     }
-                    path = nodePath + ".config";
+                    path = nodePath + CONFIG_FILE_EXTENSION;
                 } else {
                     path = nodePath;
                 }
@@ -772,7 +774,7 @@ public class JcrInstaller implements UpdateHandler, ManagedService {
                 } else {
                     name = id;
                 }
-                path = cfg.getNewConfigPath() + name + ".config";
+                path = cfg.getNewConfigPath() + name + CONFIG_FILE_EXTENSION;
                 logger.debug("Add of {} at {}", resourceType, path);
             }