sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r631204 - in /incubator/sling/trunk/sling/servlets-default/src: main/java/org/apache/sling/servlets/ test/java/org/apache/sling/servlets/
Date Tue, 26 Feb 2008 12:49:37 GMT
Author: cziegeler
Date: Tue Feb 26 04:49:35 2008
New Revision: 631204

URL: http://svn.apache.org/viewvc?rev=631204&view=rev
Log:
Clean up code and javadocs.

Modified:
    incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/DefaultHtmlRendererServlet.java
    incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/JsonRendererServlet.java
    incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/PlainTextRendererServlet.java
    incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/RedirectServlet.java
    incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/StreamRendererServlet.java
    incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/MockSlingHttpServletRequest.java
    incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/RedirectServletTest.java

Modified: incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/DefaultHtmlRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/DefaultHtmlRendererServlet.java?rev=631204&r1=631203&r2=631204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/DefaultHtmlRendererServlet.java
(original)
+++ incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/DefaultHtmlRendererServlet.java
Tue Feb 26 04:49:35 2008
@@ -31,25 +31,25 @@
 
 /**
  * A SlingSafeMethodsServlet that renders the current Resource as simple HTML
- * 
+ *
  * @scr.service
  *  interface="javax.servlet.Servlet"
- *  
- * @scr.component 
- *  immediate="true" 
+ *
+ * @scr.component
+ *  immediate="true"
  *  metatype="false"
- *  
- * @scr.property 
+ *
+ * @scr.property
  *  name="service.description"
  *  value="Default HTML Renderer Servlet"
- *  
- * @scr.property 
- *  name="service.vendor" 
+ *
+ * @scr.property
+ *  name="service.vendor"
  *  value="The Apache Software Foundation"
  *
- * Use this as the default servlet for POST requests for Sling 
- * @scr.property 
- *  name="sling.servlet.resourceTypes" 
+ * Use this as the default servlet for html get requests for Sling
+ * @scr.property
+ *  name="sling.servlet.resourceTypes"
  *  value="sling/servlet/default"
  * @scr.property
  *  name="sling.servlet.extensions"

Modified: incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/JsonRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/JsonRendererServlet.java?rev=631204&r1=631203&r2=631204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/JsonRendererServlet.java
(original)
+++ incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/JsonRendererServlet.java
Tue Feb 26 04:49:35 2008
@@ -21,7 +21,6 @@
 import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.RepositoryException;
-import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.sling.api.SlingException;
@@ -39,25 +38,25 @@
 /**
  * A SlingSafeMethodsServlet that renders the current Resource as a JSON data
  * block
- * 
+ *
  * @scr.service
  *  interface="javax.servlet.Servlet"
- *  
- * @scr.component 
- *  immediate="true" 
+ *
+ * @scr.component
+ *  immediate="true"
  *  metatype="false"
- *  
- * @scr.property 
+ *
+ * @scr.property
  *  name="service.description"
  *  value="Default JSON Renderer Servlet"
- *  
- * @scr.property 
- *  name="service.vendor" 
+ *
+ * @scr.property
+ *  name="service.vendor"
  *  value="The Apache Software Foundation"
  *
- * Use this as the default servlet for POST requests for Sling 
- * @scr.property 
- *  name="sling.servlet.resourceTypes" 
+ * Use this as the default servlet for json get requests for Sling
+ * @scr.property
+ *  name="sling.servlet.resourceTypes"
  *  values.0="sling/servlet/default"
  *  values.1="sling:redirect"
  * @scr.property
@@ -66,7 +65,7 @@
  */
 public class JsonRendererServlet extends SlingSafeMethodsServlet {
 
-    private static final Logger log = LoggerFactory.getLogger(JsonRendererServlet.class);
+    private final Logger log = LoggerFactory.getLogger(JsonRendererServlet.class);
 
     private static final long serialVersionUID = 5577121546674133317L;
 

Modified: incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/PlainTextRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/PlainTextRendererServlet.java?rev=631204&r1=631203&r2=631204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/PlainTextRendererServlet.java
(original)
+++ incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/PlainTextRendererServlet.java
Tue Feb 26 04:49:35 2008
@@ -33,25 +33,25 @@
 
 /**
  * A SlingSafeMethodsServlet that renders the current Resource as plain text.
- * 
+ *
  * @scr.service
  *  interface="javax.servlet.Servlet"
- *  
- * @scr.component 
- *  immediate="true" 
+ *
+ * @scr.component
+ *  immediate="true"
  *  metatype="false"
- *  
- * @scr.property 
+ *
+ * @scr.property
  *  name="service.description"
  *  value="Default Plain Text Renderer Servlet"
- *  
- * @scr.property 
- *  name="service.vendor" 
+ *
+ * @scr.property
+ *  name="service.vendor"
  *  value="The Apache Software Foundation"
  *
- * Use this as the default servlet for POST requests for Sling 
- * @scr.property 
- *  name="sling.servlet.resourceTypes" 
+ * Use this as the default servlet for text get requests for Sling
+ * @scr.property
+ *  name="sling.servlet.resourceTypes"
  *  value="sling/servlet/default"
  * @scr.property
  *  name="sling.servlet.extensions"

Modified: incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/RedirectServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/RedirectServlet.java?rev=631204&r1=631203&r2=631204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/RedirectServlet.java
(original)
+++ incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/RedirectServlet.java
Tue Feb 26 04:49:35 2008
@@ -22,7 +22,6 @@
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
-import javax.servlet.Servlet;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletResponse;
 
@@ -31,7 +30,6 @@
 import org.apache.sling.api.request.RequestPathInfo;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
-import org.apache.sling.api.wrappers.SlingRequestPaths;
 
 /**
  * The <code>RedirectServlet</code> implements support for GET requests to
@@ -53,7 +51,7 @@
  * sent where the target is the relative URL from the current resource to the
  * target resource. Selectors, extension, suffix and query string are also
  * appended to the redirect URL.
- * 
+ *
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.component immediate="true" metatype="false"
  * @scr.property name="service.description" value="Request Redirect Servlet"
@@ -140,7 +138,7 @@
         } else {
             postFix = null;
         }
-        
+
 
         StringBuffer pathBuf = new StringBuffer();
 
@@ -148,7 +146,7 @@
         if (postFix != null) {
             basePath += postFix;
         }
-        
+
         makeRelative(pathBuf, basePath, targetPath);
 
         if (postFix != null) {

Modified: incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/StreamRendererServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/StreamRendererServlet.java?rev=631204&r1=631203&r2=631204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/StreamRendererServlet.java
(original)
+++ incubator/sling/trunk/sling/servlets-default/src/main/java/org/apache/sling/servlets/StreamRendererServlet.java
Tue Feb 26 04:49:35 2008
@@ -24,7 +24,6 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -37,32 +36,31 @@
 
 /**
  * The <code>StreamRendererServlet</code> TODO
- * 
+ *
  * @scr.service
  *  interface="javax.servlet.Servlet"
- *  
- * @scr.component 
- *  immediate="true" 
+ *
+ * @scr.component
+ *  immediate="true"
  *  metatype="false"
- *  
- * @scr.property 
+ *
+ * @scr.property
  *  name="service.description"
  *  value="Default Streaming Renderer Servlet"
- *  
- * @scr.property 
- *  name="service.vendor" 
+ *
+ * @scr.property
+ *  name="service.vendor"
  *  value="The Apache Software Foundation"
  *
- * Use this as the default servlet for POST requests for Sling 
- * @scr.property 
- *  name="sling.servlet.resourceTypes" 
+ * @scr.property
+ *  name="sling.servlet.resourceTypes"
  *  value="sling/servlet/default"
- *  
+ *
  * Handler for .res requests
  * @scr.property
  *  name="sling.servlet.extensions"
  *  value="res"
- *  
+ *
  * Generic handler for all get requests
  * @scr.property
  *  name="sling.servlet.methods"
@@ -84,7 +82,7 @@
                 "No default renderer found for extension='" + ext + "'");
             return;
         }
-        
+
         Resource resource = request.getResource();
 
         // cannot handle the request for missing resources
@@ -159,7 +157,7 @@
      * Returns <code>true</code> if the request has a
      * <code>If-Modified-Since</code> header whose date value is later than
      * the last modification time given as <code>modifTime</code>.
-     * 
+     *
      * @param request The <code>ComponentRequest</code> checked for the
      *            <code>If-Modified-Since</code> header.
      * @param modifTime The last modification time to compare the header to.

Modified: incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/MockSlingHttpServletRequest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/MockSlingHttpServletRequest.java?rev=631204&r1=631203&r2=631204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/MockSlingHttpServletRequest.java
(original)
+++ incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/MockSlingHttpServletRequest.java
Tue Feb 26 04:49:35 2008
@@ -19,8 +19,6 @@
 package org.apache.sling.servlets;
 
 import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.security.Principal;
 import java.util.Enumeration;
 import java.util.Locale;

Modified: incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/RedirectServletTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/RedirectServletTest.java?rev=631204&r1=631203&r2=631204&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/RedirectServletTest.java
(original)
+++ incubator/sling/trunk/sling/servlets-default/src/test/java/org/apache/sling/servlets/RedirectServletTest.java
Tue Feb 26 04:49:35 2008
@@ -18,10 +18,10 @@
  */
 package org.apache.sling.servlets;
 
-import org.apache.sling.api.SlingHttpServletRequest;
-
 import junit.framework.TestCase;
 
+import org.apache.sling.api.SlingHttpServletRequest;
+
 public class RedirectServletTest extends TestCase {
 
     public void testSameParent() {
@@ -59,7 +59,7 @@
         String extension = null;
         String suffix = null;
         String queryString = null;
-        assertEquals(expected, base, selectors, extension, suffix, queryString,
+        assertEquals(expected, base, null, extension, suffix, queryString,
             target);
 
         selectors = null;



Mime
View raw message