incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1060238 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
Date Tue, 18 Jan 2011 08:41:32 GMT
Author: cziegeler
Date: Tue Jan 18 08:41:32 2011
New Revision: 1060238

URL: http://svn.apache.org/viewvc?rev=1060238&view=rev
Log:
Readd missing behaviour for properties and config files.

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java?rev=1060238&r1=1060237&r2=1060238&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
Tue Jan 18 08:41:32 2011
@@ -69,7 +69,9 @@ public class InternalResource extends In
             type = InstallableResource.TYPE_PROPERTIES;
         }
 
-        if ( is != null && InstallableResource.TYPE_PROPERTIES.equals(type) ) {
+        if ( is != null &&
+             (InstallableResource.TYPE_PROPERTIES.equals(type) ||
+              type == null && isConfigExtension(resource.getId()))) {
             dict = readDictionary(is, getExtension(resource.getId()));
             if ( dict == null ) {
                 throw new IOException("Unable to read dictionary from input stream: " + resource.getId());
@@ -240,6 +242,11 @@ public class InternalResource extends In
         return ht;
     }
 
+    private static boolean isConfigExtension(final String url) {
+        final String ext = getExtension(url);
+        return "config".equals(ext) || "properties".equals(ext) || "cfg".equals(ext);
+    }
+
     /** Digest is needed to detect changes in data */
     private static String computeDigest(final File data) throws IOException {
         try {



Mime
View raw message