tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1384090 - in /tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources: FileResource.java JarResource.java ResourceBase.java
Date Wed, 12 Sep 2012 19:14:08 GMT
Author: markt
Date: Wed Sep 12 19:14:07 2012
New Revision: 1384090

URL: http://svn.apache.org/viewvc?rev=1384090&view=rev
Log:
Pull up the existing common code

Modified:
    tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
    tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/JarResource.java
    tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/ResourceBase.java

Modified: tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java?rev=1384090&r1=1384089&r2=1384090&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
(original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/FileResource.java
Wed Sep 12 19:14:07 2012
@@ -28,13 +28,11 @@ import org.apache.catalina.WebResourceRo
 
 public class FileResource extends ResourceBase {
 
-    private final WebResourceRoot root;
-    private final String webAppPath;
     private final File resource;
 
-    public FileResource(WebResourceRoot root, File resource, String webAppPath) {
-        this.root = root;
-        this.webAppPath = webAppPath;
+    public FileResource(WebResourceRoot root, File resource,
+            String webAppPath) {
+        super(root,webAppPath);
         this.resource = resource;
     }
 
@@ -95,11 +93,6 @@ public class FileResource extends Resour
     }
 
     @Override
-    public String getWebappPath() {
-        return webAppPath;
-    }
-
-    @Override
     public String getETag() {
         // TODO Auto-generated method stub
         return null;
@@ -157,11 +150,6 @@ public class FileResource extends Resour
         }
     }
 
-    @Override
-    public WebResourceRoot getWebResourceRoot() {
-        return root;
-    }
-
     protected File getResourceInternal() {
         return resource;
     }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/JarResource.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/JarResource.java?rev=1384090&r1=1384089&r2=1384090&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/JarResource.java
(original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/JarResource.java
Wed Sep 12 19:14:07 2012
@@ -27,19 +27,16 @@ import org.apache.catalina.WebResourceRo
 
 public class JarResource extends ResourceBase {
 
-    private final WebResourceRoot root;
     private final JarFile base;
     private final String baseUrl;
     private final JarEntry resource;
-    private final String webAppPath;
 
     public JarResource(WebResourceRoot root, JarFile base, String baseUrl,
             JarEntry jarEntry, String webAppPath) {
-        this.root = root;
+        super(root, webAppPath);
         this.base = base;
         this.baseUrl = "jar:" + baseUrl;
         this.resource = jarEntry;
-        this.webAppPath = webAppPath;
     }
 
     @Override
@@ -100,11 +97,6 @@ public class JarResource extends Resourc
     }
 
     @Override
-    public String getWebappPath() {
-        return webAppPath;
-    }
-
-    @Override
     public String getETag() {
         // TODO Auto-generated method stub
         return null;
@@ -152,9 +144,4 @@ public class JarResource extends Resourc
             return null;
         }
     }
-
-    @Override
-    public WebResourceRoot getWebResourceRoot() {
-        return root;
-    }
 }

Modified: tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/ResourceBase.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/ResourceBase.java?rev=1384090&r1=1384089&r2=1384090&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/ResourceBase.java
(original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/ResourceBase.java
Wed Sep 12 19:14:07 2012
@@ -17,7 +17,28 @@
 package org.apache.catalina.webresources;
 
 import org.apache.catalina.WebResource;
+import org.apache.catalina.WebResourceRoot;
 
 public abstract class ResourceBase implements WebResource {
 
+    private final WebResourceRoot root;
+    private final String webAppPath;
+
+
+    protected ResourceBase(WebResourceRoot root, String webAppPath) {
+        this.root = root;
+        this.webAppPath = webAppPath;
+    }
+
+
+    @Override
+    public final WebResourceRoot getWebResourceRoot() {
+        return root;
+    }
+
+
+    @Override
+    public final String getWebappPath() {
+        return webAppPath;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message