incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r691226 - in /incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers: HtmlRendererServlet.java JsonRendererServlet.java PlainTextRendererServlet.java StreamRendererServlet.java
Date Tue, 02 Sep 2008 12:58:00 GMT
Author: cziegeler
Date: Tue Sep  2 05:58:00 2008
New Revision: 691226

URL: http://svn.apache.org/viewvc?rev=691226&view=rev
Log:
Don't render synthetic resources.

Modified:
    incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/HtmlRendererServlet.java
    incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/JsonRendererServlet.java
    incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/PlainTextRendererServlet.java
    incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/StreamRendererServlet.java

Modified: incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/HtmlRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/HtmlRendererServlet.java?rev=691226&r1=691225&r2=691226&view=diff
==============================================================================
--- incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/HtmlRendererServlet.java
(original)
+++ incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/HtmlRendererServlet.java
Tue Sep  2 05:58:00 2008
@@ -25,9 +25,9 @@
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.resource.NonExistingResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
+import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
 
 /**
@@ -47,8 +47,8 @@
             SlingHttpServletResponse resp) throws ServletException, IOException {
         final Resource r = req.getResource();
 
-        if (r instanceof NonExistingResource) {
-            throw new ResourceNotFoundException("Resource not found at " + r.getPath());
+        if (ResourceUtil.isSyntheticResource(r)) {
+            throw new ResourceNotFoundException("No data to render.");
         }
 
         resp.setContentType(responseContentType);

Modified: incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/JsonRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/JsonRendererServlet.java?rev=691226&r1=691225&r2=691226&view=diff
==============================================================================
--- incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/JsonRendererServlet.java
(original)
+++ incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/JsonRendererServlet.java
Tue Sep  2 05:58:00 2008
@@ -23,9 +23,9 @@
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.resource.NonExistingResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
+import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
 import org.apache.sling.commons.json.JSONException;
 import org.slf4j.Logger;
@@ -61,8 +61,8 @@
             SlingHttpServletResponse resp) throws IOException {
         // Access and check our data
         final Resource r = req.getResource();
-        if (r instanceof NonExistingResource) {
-            throw new ResourceNotFoundException("No data to dump");
+        if (ResourceUtil.isSyntheticResource(r)) {
+            throw new ResourceNotFoundException("No data to render.");
         }
 
         // SLING-167: the last selector, if present, gives the number of

Modified: incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/PlainTextRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/PlainTextRendererServlet.java?rev=691226&r1=691225&r2=691226&view=diff
==============================================================================
--- incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/PlainTextRendererServlet.java
(original)
+++ incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/PlainTextRendererServlet.java
Tue Sep  2 05:58:00 2008
@@ -25,7 +25,6 @@
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.resource.NonExistingResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.resource.ResourceUtil;
@@ -48,8 +47,8 @@
     protected void doGet(SlingHttpServletRequest req,
             SlingHttpServletResponse resp) throws ServletException, IOException {
         final Resource r = req.getResource();
-        if (r instanceof NonExistingResource) {
-            throw new ResourceNotFoundException("Resource not found at " + r.getPath());
+        if (ResourceUtil.isSyntheticResource(r)) {
+            throw new ResourceNotFoundException("No data to render.");
         }
 
         /*

Modified: incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/StreamRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/StreamRendererServlet.java?rev=691226&r1=691225&r2=691226&view=diff
==============================================================================
--- incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/StreamRendererServlet.java
(original)
+++ incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/helpers/StreamRendererServlet.java
Tue Sep  2 05:58:00 2008
@@ -30,10 +30,10 @@
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.resource.NonExistingResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 import org.apache.sling.api.resource.ResourceNotFoundException;
+import org.apache.sling.api.resource.ResourceUtil;
 
 /**
  * The <code>StreamRendererServlet</code> streams the current resource to the
@@ -61,8 +61,8 @@
         }
 
         final Resource resource = request.getResource();
-        if (resource instanceof NonExistingResource) {
-            throw new ResourceNotFoundException("Resource not found at " + resource.getPath());
+        if (ResourceUtil.isSyntheticResource(resource)) {
+            throw new ResourceNotFoundException("No data to render.");
         }
 
         // check the last modification time and If-Modified-Since header



Mime
View raw message