Automated merge with https://gss.googlecode.com/hg/
[pithos] / src / gr / ebs / gss / server / rest / RequestHandler.java
index c51b5c1..84270b6 100644 (file)
@@ -108,17 +108,17 @@ public class RequestHandler extends Webdav {
        /**
         * The GSS-specific header for the request timestamp.
         */
-       private static final String GSS_DATE_HEADER = "X-GSS-Date";
+       protected static final String GSS_DATE_HEADER = "X-GSS-Date";
 
        /**
         * The RFC 2616 date header.
         */
-       private static final String DATE_HEADER = "Date";
+       protected static final String DATE_HEADER = "Date";
 
        /**
         * The Authorization HTTP header.
         */
-       private static final String AUTHORIZATION_HEADER = "Authorization";
+       protected static final String AUTHORIZATION_HEADER = "Authorization";
 
        /**
         * The group parameter name.
@@ -742,4 +742,13 @@ public class RequestHandler extends Webdav {
                return result;
 
        }
+
+       /**
+        * Reject illegal resource names, like '.' or '..' or resource names containing '/'.
+        */
+       protected boolean isValidResourceName(String name) {
+               if (".".equals(name) || "..".equals(name) || name.contains("/"))
+                       return false;
+               return true;
+       }
 }