incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r991880 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal: JcrResourceListener.java JcrResourceResolver.java helper/MapEntries.java
Date Thu, 02 Sep 2010 10:11:12 GMT
Author: fmeschbe
Date: Thu Sep  2 10:11:12 2010
New Revision: 991880

URL: http://svn.apache.org/viewvc?rev=991880&view=rev
Log:
Use ResourceUtil methods instead of new Resource API methods to be friendly for incomplete
Resource implementations ...

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java?rev=991880&r1=991879&r2=991880&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
Thu Sep  2 10:11:12 2010
@@ -36,6 +36,7 @@ import org.apache.sling.api.resource.Log
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.jcr.resource.JcrResourceConstants;
 import org.osgi.service.event.EventAdmin;
 import org.osgi.util.tracker.ServiceTracker;
@@ -199,7 +200,7 @@ public class JcrResourceListener impleme
                 if ( node != null ) {
                     try {
                         if (node.getParent().isNodeType("nt:file") ) {
-                            final Resource parentResource = resource.getParent();
+                            final Resource parentResource = ResourceUtil.getParent(resource);
                             if ( parentResource != null ) {
                                 resource = parentResource;
                             }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java?rev=991880&r1=991879&r2=991880&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver.java
Thu Sep  2 10:11:12 2010
@@ -600,7 +600,7 @@ public class JcrResourceResolver
                 if (alias != null && alias.length() > 0 && !alias.endsWith(":"))
{
                     names.add(alias);
                 }
-                res = res.getParent();
+                res = ResourceUtil.getParent(res);
             }
 
             // build path from segment names

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java?rev=991880&r1=991879&r2=991880&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java
Thu Sep  2 10:11:12 2010
@@ -247,7 +247,7 @@ public class MapEntries implements Event
             Collection<MapEntry> resolveEntries,
             Map<String, MapEntry> mapEntries, Resource parent, String parentPath) {
         // scheme list
-        Iterator<Resource> children = parent.listChildren();
+        Iterator<Resource> children = ResourceUtil.listChildren(parent);
         while (children.hasNext()) {
             Resource child = children.next();
 
@@ -255,7 +255,7 @@ public class MapEntries implements Event
                 JcrResourceResolver.PROP_REG_EXP);
             boolean trailingSlash = false;
             if (name == null) {
-                name = child.getName().concat("/");
+                name = ResourceUtil.getName(child).concat("/");
                 trailingSlash = true;
             }
 



Mime
View raw message