Class Headers

java.lang.Object
org.bedework.webdav.servlet.common.Headers

public class Headers extends Object
Retrieve and process Webdav header values
Author:
Mike Douglass douglm rpi.edu
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
    The following is instantiated for If headers
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    brief(javax.servlet.http.HttpServletRequest req)
     
    static int
    depth(javax.servlet.http.HttpServletRequest req)
    Get the depth header
    static int
    depth(javax.servlet.http.HttpServletRequest req, int def)
    Get the depth header
    static String
    ifMatch(javax.servlet.http.HttpServletRequest req)
    Look for the If-Match header
    static String
    ifNoneMatch(javax.servlet.http.HttpServletRequest req)
    Look for the If-None-Match header
    static boolean
    ifNoneMatchAny(javax.servlet.http.HttpServletRequest req)
    Look for the If-None-Match * header
    static String
    ifScheduleTagMatch(javax.servlet.http.HttpServletRequest req)
    Look for the If-Schedule-Tag-Match header
    static void
    makeLocation(javax.servlet.http.HttpServletResponse resp, String url)
    Create a location header
    processIfHeaders(javax.servlet.http.HttpServletRequest req)
     
    static boolean
    returnRepresentation(javax.servlet.http.HttpServletRequest req)
     
    testIfHeader(javax.servlet.http.HttpServletRequest req)
    From Webdav RFC4918 Section 10.4

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Headers

      public Headers()
  • Method Details

    • depth

      public static int depth(javax.servlet.http.HttpServletRequest req)
      Get the depth header
      Parameters:
      req - HttpServletRequest
      Returns:
      int depth - depthInfinity if absent
    • depth

      public static int depth(javax.servlet.http.HttpServletRequest req, int def)
      Get the depth header
      Parameters:
      req - HttpServletRequest
      def - int default if no header
      Returns:
      int depth -
    • brief

      public static boolean brief(javax.servlet.http.HttpServletRequest req)
      Parameters:
      req -
      Returns:
      true if we have a (MS) "brief" header or the Prefer header with "return-minimal" or "return=minimal"
    • returnRepresentation

      public static boolean returnRepresentation(javax.servlet.http.HttpServletRequest req)
      Parameters:
      req -
      Returns:
      true if we have a Prefer header with "return-representation" or "return=representation"
    • makeLocation

      public static void makeLocation(javax.servlet.http.HttpServletResponse resp, String url)
      Create a location header
      Parameters:
      resp -
      url -
    • testIfHeader

      public static Headers.IfHeader testIfHeader(javax.servlet.http.HttpServletRequest req)
      From Webdav RFC4918 Section 10.4
        If = "If" ":" ( 1*No-tag-list | 1*Tagged-list )
      
        No-tag-list = List
        Tagged-list = Resource-Tag 1*List
      
        List = "(" 1*Condition ")"
        Condition = ["Not"] (State-token | "[" entity-tag "]")
        ; entity-tag: see Section 3.11 of [RFC2616]
        ; No LWS allowed between "[", entity-tag and "]"
      
        State-token = Coded-URL
      
        Resource-Tag = "<" Simple-ref ">"
        ; Simple-ref: see Section 8.3
        ; No LWS allowed in Resource-Tag
       
      Parameters:
      req -
      Returns:
      populated IfHeader or null
    • ifNoneMatchAny

      public static boolean ifNoneMatchAny(javax.servlet.http.HttpServletRequest req)
      Look for the If-None-Match * header
      Parameters:
      req - HttpServletRequest
      Returns:
      boolean true if present
    • ifNoneMatch

      public static String ifNoneMatch(javax.servlet.http.HttpServletRequest req)
      Look for the If-None-Match header
      Parameters:
      req - HttpServletRequest
      Returns:
      String null if not present
    • ifMatch

      public static String ifMatch(javax.servlet.http.HttpServletRequest req)
      Look for the If-Match header
      Parameters:
      req - HttpServletRequest
      Returns:
      String null if not present
    • ifScheduleTagMatch

      public static String ifScheduleTagMatch(javax.servlet.http.HttpServletRequest req)
      Look for the If-Schedule-Tag-Match header
      Parameters:
      req - HttpServletRequest
      Returns:
      String null if not present
    • processIfHeaders

      public static Headers.IfHeaders processIfHeaders(javax.servlet.http.HttpServletRequest req)
      Parameters:
      req -
      Returns:
      populated Ifheaders object