sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r935816 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/WorkspaceDecoratedResource.java
Date Tue, 20 Apr 2010 06:50:49 GMT
Author: cziegeler
Date: Tue Apr 20 06:50:49 2010
New Revision: 935816

URL: http://svn.apache.org/viewvc?rev=935816&view=rev
Log:
Clean up code and use resource wrapper

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/WorkspaceDecoratedResource.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/WorkspaceDecoratedResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/WorkspaceDecoratedResource.java?rev=935816&r1=935815&r2=935816&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/WorkspaceDecoratedResource.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/WorkspaceDecoratedResource.java
Tue Apr 20 06:50:49 2010
@@ -17,53 +17,25 @@
 package org.apache.sling.jcr.resource.internal;
 
 import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceMetadata;
-import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceWrapper;
 
 /**
  * Decorated resource which prepends the workspace name to
  * a delegate resource's path.
  */
-class WorkspaceDecoratedResource implements Resource {
+class WorkspaceDecoratedResource extends ResourceWrapper {
 
-    private final Resource delegate;
     private final String workspaceName;
 
     WorkspaceDecoratedResource(Resource resource, String workspaceName) {
-        this.delegate = resource;
+        super(resource);
         this.workspaceName = workspaceName;
     }
 
-    public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
-        return delegate.adaptTo(type);
-    }
-
     public String getPath() {
         if (workspaceName != null) {
-            return workspaceName + ":" + delegate.getPath();
-        } else {
-            return delegate.getPath();
+            return workspaceName + ":" + super.getPath();
         }
+        return super.getPath();
     }
-
-    public ResourceMetadata getResourceMetadata() {
-        return delegate.getResourceMetadata();
-    }
-
-    public ResourceResolver getResourceResolver() {
-        return delegate.getResourceResolver();
-    }
-
-    public String getResourceSuperType() {
-        return delegate.getResourceSuperType();
-    }
-
-    public String getResourceType() {
-        return delegate.getResourceType();
-    }
-
-    public String toString() {
-        return delegate.toString();
-    }
-
 }



Mime
View raw message