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 classHeaders.IfHeaderstatic classHeaders.IfHeadersThe following is instantiated for If headers
-
Field Summary
Fields Modifier and Type Field Description static intdepthInfinitystatic intdepthNone
-
Constructor Summary
Constructors Constructor Description Headers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
depthInfinity
public static final int depthInfinity
- See Also:
- Constant Field Values
-
depthNone
public static final int depthNone
- See Also:
- Constant Field Values
-
-
Method Detail
-
depth
public static int depth(javax.servlet.http.HttpServletRequest req) throws WebdavExceptionGet the depth header- Parameters:
req- HttpServletRequest- Returns:
- int depth - depthInfinity if absent
- Throws:
WebdavException
-
depth
public static int depth(javax.servlet.http.HttpServletRequest req, int def) throws WebdavExceptionGet the depth header- Parameters:
req- HttpServletRequestdef- int default if no header- Returns:
- int depth -
- Throws:
WebdavException
-
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) throws WebdavException
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
- Throws:
WebdavException
-
ifNoneMatchAny
public static boolean ifNoneMatchAny(javax.servlet.http.HttpServletRequest req) throws WebdavExceptionLook for the If-None-Match * header- Parameters:
req- HttpServletRequest- Returns:
- boolean true if present
- Throws:
WebdavException
-
ifNoneMatch
public static String ifNoneMatch(javax.servlet.http.HttpServletRequest req) throws WebdavException
Look for the If-None-Match header- Parameters:
req- HttpServletRequest- Returns:
- String null if not present
- Throws:
WebdavException
-
ifMatch
public static String ifMatch(javax.servlet.http.HttpServletRequest req) throws WebdavException
Look for the If-Match header- Parameters:
req- HttpServletRequest- Returns:
- String null if not present
- Throws:
WebdavException
-
ifScheduleTagMatch
public static String ifScheduleTagMatch(javax.servlet.http.HttpServletRequest req) throws WebdavException
Look for the If-Schedule-Tag-Match header- Parameters:
req- HttpServletRequest- Returns:
- String null if not present
- Throws:
WebdavException
-
processIfHeaders
public static Headers.IfHeaders processIfHeaders(javax.servlet.http.HttpServletRequest req) throws WebdavException
- Parameters:
req-- Returns:
- populated Ifheaders object
- Throws:
WebdavException
-
-