You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2011/01/18 09:41:32 UTC
svn commit: r1060238 -
/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
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 {