org.apache.jackrabbit.webdav
Interface DavServletRequest

All Superinterfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest
All Known Subinterfaces:
DeltaVServletRequest, ObservationDavServletRequest, OrderingDavServletRequest, TransactionDavServletRequest, WebdavRequest
All Known Implementing Classes:
WebdavRequestImpl

public interface DavServletRequest
extends javax.servlet.http.HttpServletRequest

DavServletRequest extends the HttpServletRequest by Webdav specific METHODS.


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Method Summary
 DavSession getDavSession()
          Returns the DavSession created for this request.
 int getDepth()
          Return the integer representation of the given Depth header.
 int getDepth(int defaultValue)
          Returns the integer representation of the Depth header or the given defaultValue, if the Depth header is missing.
 DavResourceLocator getDestinationLocator()
          Parse the Destination header and return the locator of the corresponding resource.
 LockInfo getLockInfo()
          Return the parsed 'lockinfo' request body, the Timeout header and the Depth header of a LOCK request as LockInfo object.
 String getLockToken()
          Returns the token present in the Lock-Token Header or null if no such header is available.
Note: The 'Lock-Token' header is sent with UNLOCK requests and with lock responses only.
 DavPropertyNameSet getPropFindProperties()
          Return the set of properties the client requested with a PROPFIND request or an empty set if the type of PROPFIND request was DavConstants.PROPFIND_ALL_PROP or DavConstants.PROPFIND_PROPERTY_NAMES.
 int getPropFindType()
          Return the type of PROPFIND request as indicated by the PROPFIND request body.
 DavPropertyNameSet getPropPatchRemoveProperties()
          Return the set of property names the client wanted to remove with a PROPPATCH request, i.e.
 DavPropertySet getPropPatchSetProperties()
          Return the set of properties the client wanted to modify / create with a PROPPATCH request, i.e.
 Document getRequestDocument()
          Parse the Xml request body and return a Document.
 DavResourceLocator getRequestLocator()
          Return the locator of the requested resource.
 long getTimeout()
          Return the timeout requested in the Timeout header as long.
 boolean isOverwrite()
          Returns true if the Overwrite header is set to 'T' thus instructing the server to overwrite the state of a non-null destination resource during a COPY or MOVE.
 boolean matchesIfHeader(DavResource resource)
          Returns true, if the If header present with the request matches the given resource.
 boolean matchesIfHeader(String href, String token, String eTag)
          Returns true, if the If header present with the request matches to the given href, token and eTag.
 void setDavSession(DavSession session)
          Sets the DavSession to this request.
 
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Method Detail

setDavSession

public void setDavSession(DavSession session)
Sets the DavSession to this request.

Parameters:
session -

getDavSession

public DavSession getDavSession()
Returns the DavSession created for this request.

Returns:
session for this resource

getRequestLocator

public DavResourceLocator getRequestLocator()
Return the locator of the requested resource.

Returns:
locator of the requested resource.

getDestinationLocator

public DavResourceLocator getDestinationLocator()
Parse the Destination header and return the locator of the corresponding resource.

Returns:
locator of the resource specified with the Destination header.
See Also:
DavConstants.HEADER_DESTINATION

isOverwrite

public boolean isOverwrite()
Returns true if the Overwrite header is set to 'T' thus instructing the server to overwrite the state of a non-null destination resource during a COPY or MOVE. A Overwrite header value of 'F' will return false.

Returns:
true if the Overwrite header is set to 'T', false if it is set to 'F'.
See Also:
DavConstants.HEADER_OVERWRITE

getDepth

public int getDepth()
Return the integer representation of the given Depth header. 'Infinity' is represented by DavConstants.DEPTH_INFINITY.

Returns:
integer representation of the Depth header.
See Also:
DavConstants.HEADER_DEPTH

getDepth

public int getDepth(int defaultValue)
Returns the integer representation of the Depth header or the given defaultValue, if the Depth header is missing.

Parameters:
defaultValue - to be returned if no Depth header is present.
Returns:
integer representation of the Depth header or the given defaultValue.
See Also:
DavConstants.HEADER_DEPTH

getLockToken

public String getLockToken()
Returns the token present in the Lock-Token Header or null if no such header is available.
Note: The 'Lock-Token' header is sent with UNLOCK requests and with lock responses only. For any other request that may be affected by a lock the 'If' header field is responsible.

Returns:
the token present in the Lock-Token header.
See Also:
DavConstants.HEADER_LOCK_TOKEN

getTimeout

public long getTimeout()
Return the timeout requested in the Timeout header as long. The representation of the 'Infinite' timeout is left to the implementation.

Returns:
long value representation of the Timeout header.
See Also:
DavConstants.HEADER_TIMEOUT, DavConstants.TIMEOUT_INFINITE

getRequestDocument

public Document getRequestDocument()
Parse the Xml request body and return a Document. If the request body can not be parsed null is returned.

Returns:
Document representing the Xml request body or null.

getPropFindType

public int getPropFindType()
                    throws DavException
Return the type of PROPFIND request as indicated by the PROPFIND request body.

Returns:
type of PROPFIND request
Throws:
DavException - If the propfind type could not be determined due to an invalid request body.
See Also:
DavConstants.PROPFIND_ALL_PROP, DavConstants.PROPFIND_BY_PROPERTY, DavConstants.PROPFIND_PROPERTY_NAMES

getPropFindProperties

public DavPropertyNameSet getPropFindProperties()
                                         throws DavException
Return the set of properties the client requested with a PROPFIND request or an empty set if the type of PROPFIND request was DavConstants.PROPFIND_ALL_PROP or DavConstants.PROPFIND_PROPERTY_NAMES.

Returns:
set of properties the client requested with a PROPFIND request
Throws:
DavException - In case of invalid request body

getPropPatchSetProperties

public DavPropertySet getPropPatchSetProperties()
                                         throws DavException
Return the set of properties the client wanted to modify / create with a PROPPATCH request, i.e. all entries in the <propertyupdate> element of the request body with name <set>.

Returns:
set of properties the client wanted to modify / create with a PROPPATCH request.
Throws:
DavException - In case of invalid request body

getPropPatchRemoveProperties

public DavPropertyNameSet getPropPatchRemoveProperties()
                                                throws DavException
Return the set of property names the client wanted to remove with a PROPPATCH request, i.e. all entries in the <propertyupdate> element of the request body with name <remove>.
Note, that in constrast to the <set> Xml element, all the XML elements in a prop XML element inside of a remove XML element must be empty, as only the names of properties to be removed are required. Therefore a DavPropertyNameSet is returned and not a DavPropertySet

Returns:
set of property names the client wanted to remove with a PROPPATCH request.
Throws:
DavException - In case of invalid request body

getLockInfo

public LockInfo getLockInfo()
                     throws DavException
Return the parsed 'lockinfo' request body, the Timeout header and the Depth header of a LOCK request as LockInfo object.

Returns:
LockInfo object encapsulating the information present in the LOCK request.
Throws:
DavException
See Also:
DavConstants.HEADER_TIMEOUT, DavConstants.HEADER_DEPTH, DavConstants.XML_LOCKINFO

matchesIfHeader

public boolean matchesIfHeader(DavResource resource)
Returns true, if the If header present with the request matches the given resource.

Parameters:
resource -
Returns:
true, if the test is successful, false otherwise.

matchesIfHeader

public boolean matchesIfHeader(String href,
                               String token,
                               String eTag)
Returns true, if the If header present with the request matches to the given href, token and eTag.

Parameters:
href -
token -
eTag -
Returns:
true, if the test is successful, false otherwise.


Copyright © 2005-2006 . All Rights Reserved.