incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r586447 - in /incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling: helpers/constants/HttpConstants.java slingservlets/StreamServlet.java
Date Fri, 19 Oct 2007 13:38:42 GMT
Author: fmeschbe
Date: Fri Oct 19 06:38:41 2007
New Revision: 586447

URL: http://svn.apache.org/viewvc?rev=586447&view=rev
Log:
SLING-70 Add constants for the If-Modified-Since and Last-Modified headers

Modified:
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/helpers/constants/HttpConstants.java
    incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/StreamServlet.java

Modified: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/helpers/constants/HttpConstants.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/helpers/constants/HttpConstants.java?rev=586447&r1=586446&r2=586447&view=diff
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/helpers/constants/HttpConstants.java
(original)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/helpers/constants/HttpConstants.java
Fri Oct 19 06:38:41 2007
@@ -18,12 +18,16 @@
 
 /** HTTP-related constants */
 public interface HttpConstants {
-    String METHOD_OPTIONS = "OPTIONS";
-    String METHOD_GET = "GET";
-    String METHOD_HEAD = "HEAD";
-    String METHOD_POST = "POST";
-    String METHOD_PUT = "PUT";
-    String METHOD_DELETE = "DELETE";
-    String METHOD_TRACE = "TRACE";
-    String METHOD_CONNECT = "CONNECT";
+    public static final String METHOD_OPTIONS = "OPTIONS";
+    public static final String METHOD_GET = "GET";
+    public static final String METHOD_HEAD = "HEAD";
+    public static final String METHOD_POST = "POST";
+    public static final String METHOD_PUT = "PUT";
+    public static final String METHOD_DELETE = "DELETE";
+    public static final String METHOD_TRACE = "TRACE";
+    public static final String METHOD_CONNECT = "CONNECT";
+
+    public static final String HEADER_IF_MODIFIED_SINCE = "If-Modified-Since";
+    public static final String HEADER_LAST_MODIFIED = "Last-Modified";
+
 }

Modified: incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/StreamServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/StreamServlet.java?rev=586447&r1=586446&r2=586447&view=diff
==============================================================================
--- incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/StreamServlet.java
(original)
+++ incubator/sling/whiteboard/microsling/src/main/java/org/apache/sling/microsling/slingservlets/StreamServlet.java
Fri Oct 19 06:38:41 2007
@@ -74,7 +74,7 @@
                 if (content.isNodeType("nt:resource")) {
 
                     // check for if last modified
-                    long ifModified = request.getDateHeader(HttpConstants.HEADER_IFMODSINCE);
+                    long ifModified = request.getDateHeader(HttpConstants.HEADER_IF_MODIFIED_SINCE);
                     long lastModified = getLastModified(content);
                     if (ifModified < 0 || lastModified > ifModified) {
 
@@ -125,7 +125,7 @@
         }
 
         if (lastModified > 0) {
-            response.setDateHeader(HttpConstants.HEADER_LASTMOD, lastModified);
+            response.setDateHeader(HttpConstants.HEADER_LAST_MODIFIED, lastModified);
         }
 
         // only set the content length if the property is a binary



Mime
View raw message