incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r1528788 - /sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
Date Thu, 03 Oct 2013 10:27:22 GMT
Author: olli
Date: Thu Oct  3 10:27:22 2013
New Revision: 1528788

URL: http://svn.apache.org/r1528788
Log:
SLING-2917 fix parent descriptor and improve building path

Modified:
    sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java

Modified: sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java?rev=1528788&r1=1528787&r2=1528788&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
(original)
+++ sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
Thu Oct  3 10:27:22 2013
@@ -53,7 +53,7 @@ import static javax.jcr.ImportUUIDBehavi
  */
 public class Loader extends BaseImportLoader {
 
-    public static final String PARENT_DESCRIPTOR = "/ROOT";
+    public static final String PARENT_DESCRIPTOR = "ROOT";
 
     private final Logger log = LoggerFactory.getLogger(Loader.class);
 
@@ -737,7 +737,14 @@ public class Loader extends BaseImportLo
 
         for (Map.Entry<String, ImportProvider> entry : contentCreator.getImportProviders().entrySet())
{
             if (entry.getValue() != null) {
-                URL url = bundle.getEntry(path + PARENT_DESCRIPTOR + entry.getKey());
+                final StringBuilder filePath = new StringBuilder(path);
+                if (!path.endsWith("/")) {
+                    filePath.append("/");
+                }
+                filePath.append(PARENT_DESCRIPTOR);
+                // add file extension, e.g. .jcr.xml, .xml, .zip (see BaseImportLoader)
+                filePath.append(entry.getKey());
+                URL url = bundle.getEntry(filePath.toString());
                 if (url != null) {
                     try {
                         final Descriptor descriptor = new Descriptor();



Mime
View raw message