Class Headers
java.lang.Object
org.bedework.webdav.servlet.common.Headers
Retrieve and process Webdav header values
- Author:
- Mike Douglass douglm rpi.edu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classThe following is instantiated for If headers -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbrief(javax.servlet.http.HttpServletRequest req) static intdepth(javax.servlet.http.HttpServletRequest req) Get the depth headerstatic intdepth(javax.servlet.http.HttpServletRequest req, int def) Get the depth headerstatic StringifMatch(javax.servlet.http.HttpServletRequest req) Look for the If-Match headerstatic StringifNoneMatch(javax.servlet.http.HttpServletRequest req) Look for the If-None-Match headerstatic booleanifNoneMatchAny(javax.servlet.http.HttpServletRequest req) Look for the If-None-Match * headerstatic StringifScheduleTagMatch(javax.servlet.http.HttpServletRequest req) Look for the If-Schedule-Tag-Match headerstatic voidmakeLocation(javax.servlet.http.HttpServletResponse resp, String url) Create a location headerstatic Headers.IfHeadersprocessIfHeaders(javax.servlet.http.HttpServletRequest req) static booleanreturnRepresentation(javax.servlet.http.HttpServletRequest req) static Headers.IfHeadertestIfHeader(javax.servlet.http.HttpServletRequest req) From Webdav RFC4918 Section 10.4
-
Field Details
-
depthInfinity
public static final int depthInfinity- See Also:
-
depthNone
public static final int depthNone- See Also:
-
-
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- HttpServletRequestdef- 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
Create a location header- Parameters:
resp-url-
-
testIfHeader
From Webdav RFC4918 Section 10.4If = "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
Look for the If-None-Match header- Parameters:
req- HttpServletRequest- Returns:
- String null if not present
-
ifMatch
Look for the If-Match header- Parameters:
req- HttpServletRequest- Returns:
- String null if not present
-
ifScheduleTagMatch
Look for the If-Schedule-Tag-Match header- Parameters:
req- HttpServletRequest- Returns:
- String null if not present
-
processIfHeaders
- Parameters:
req-- Returns:
- populated Ifheaders object
-