This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag 
org.apache.sling.installer.provider.file-1.1.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-provider-file.git

commit 9abdde1ccf6cc29bd8fe714e7a83ae531217eb17
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Fri Apr 17 09:46:46 2015 +0000

    SLING-4632 : File installer does not support moving Sling directory
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/installer/providers/file@1674245 
13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/installer/provider/file/impl/FileInstaller.java      | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

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 b0dce00..a646f61 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
@@ -73,9 +73,13 @@ public class FileInstaller
 
     public void start(final OsgiInstaller installer, final 
SlingSettingsService settings) {
         for(final ScanConfiguration config : this.scanConfigurations) {
+            String key = config.directory;
+            if ( key.startsWith(settings.getSlingHomePath() + File.separator) 
) {
+                key = "${sling.home}" + 
key.substring(settings.getSlingHomePath().length());
+            }
             logger.debug("Starting monitor for {}", config.directory);
             this.monitors.add(new FileMonitor(new File(config.directory),
-                    config.scanInterval, new Installer(installer, settings, 
config.directory, hash(config.directory))));
+                    config.scanInterval, new Installer(installer, settings, 
config.directory, hash(key))));
         }
     }
 
@@ -216,13 +220,13 @@ public class FileInstaller
     /**
      * Hash the string
      */
-    private static String hash(String value) {
+    private static String hash(final String value) {
         try {
             final MessageDigest d = MessageDigest.getInstance("MD5");
             d.update(value.getBytes("UTF-8"));
             final BigInteger bigInt = new BigInteger(1, d.digest());
             return new String(bigInt.toString(16));
-        } catch (Exception ignore) {
+        } catch (final Exception ignore) {
             // if anything goes wrong we just return the value
             return value;
         }

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to