|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.webdav.WebdavRequestImpl
public class WebdavRequestImpl
WebdavRequestImpl
...
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
WebdavRequestImpl(javax.servlet.http.HttpServletRequest httpRequest,
DavLocatorFactory factory)
Creates a new DavServletRequest with the given parameters. |
Method Summary | |
---|---|
Object |
getAttribute(String s)
|
Enumeration |
getAttributeNames()
|
String |
getAuthType()
|
BindInfo |
getBindInfo()
Returns the BindInfo present with the request |
String |
getCharacterEncoding()
|
int |
getContentLength()
|
String |
getContentType()
|
String |
getContextPath()
|
javax.servlet.http.Cookie[] |
getCookies()
|
long |
getDateHeader(String s)
|
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 field and return the path of the destination resource. |
String |
getHeader(String s)
|
Enumeration |
getHeaderNames()
|
Enumeration |
getHeaders(String s)
|
DavResourceLocator |
getHrefLocator(String href)
Parse a href and return the path of the resource. |
javax.servlet.ServletInputStream |
getInputStream()
|
int |
getIntHeader(String s)
|
String |
getLabel()
Returns the Label header or null |
LabelInfo |
getLabelInfo()
Return the request body as LabelInfo object or null
if parsing the request body or the creation of the label info failed. |
Locale |
getLocale()
|
Enumeration |
getLocales()
|
LockInfo |
getLockInfo()
LockInfo object encapsulating the information passed with a LOCK
request if the LOCK request body was valid. |
String |
getLockToken()
Retrive the lock token from the 'Lock-Token' header. |
DavResourceLocator |
getMemberLocator(String segment)
Returns the path of the member resource of the request resource which is identified by the segment parameter. |
MergeInfo |
getMergeInfo()
Return the request body as MergeInfo object or null
if the creation failed due to invalid format. |
String |
getMethod()
|
OptionsInfo |
getOptionsInfo()
Returns the OptionsInfo present with the request or null . |
String |
getOrderingType()
Returns the Ordering-Type header . |
OrderPatch |
getOrderPatch()
Return a OrderPatch object encapsulating the request body
of an ORDERPATCH request or null if the request body was
either missing or could not be parsed. |
String |
getParameter(String s)
|
Map |
getParameterMap()
|
Enumeration |
getParameterNames()
|
String[] |
getParameterValues(String s)
|
String |
getPathInfo()
|
String |
getPathTranslated()
|
long |
getPollTimeout()
Returns the PollTimeout header
or 0 (zero) if no such header is present. |
Position |
getPosition()
Return a Position object encapsulating the Position header field or null if no Position header is present
or does not contain a valid format. |
DavPropertyNameSet |
getPropFindProperties()
Returns the set of properties requested by the PROPFIND body or an empty set if the type is either 'allprop' or
'propname'. |
int |
getPropFindType()
Returns the type of PROPFIND as indicated by the request body. |
List |
getPropPatchChangeList()
Return a List of property change operations. |
DavPropertyNameSet |
getPropPatchRemoveProperties()
Deprecated. use getPropPatchChangeList() instead |
DavPropertySet |
getPropPatchSetProperties()
Deprecated. use getPropPatchChangeList() instead |
String |
getProtocol()
|
String |
getQueryString()
|
BufferedReader |
getReader()
|
String |
getRealPath(String s)
|
RebindInfo |
getRebindInfo()
Returns the RebindInfo present with the request |
String |
getRemoteAddr()
|
String |
getRemoteHost()
|
String |
getRemoteUser()
|
ReportInfo |
getReportInfo()
Returns the request body and the Depth header as ReportInfo
object. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String s)
|
Document |
getRequestDocument()
Parse the Xml request body and return a Document . |
String |
getRequestedSessionId()
|
DavResourceLocator |
getRequestLocator()
Return a DavResourceLocator representing the request handle. |
String |
getRequestURI()
|
StringBuffer |
getRequestURL()
|
String |
getScheme()
|
String |
getServerName()
|
int |
getServerPort()
|
String |
getServletPath()
|
javax.servlet.http.HttpSession |
getSession()
|
javax.servlet.http.HttpSession |
getSession(boolean b)
|
String |
getSubscriptionId()
Return the SubscriptionId header
or null if no such header is present. |
SubscriptionInfo |
getSubscriptionInfo()
Return a SubscriptionInfo object representing the subscription
info present in the SUBSCRIBE request body or null if
retrieving the subscription info fails. |
long |
getTimeout()
Parse the Timeout header and return a long representing the value. |
String |
getTransactionId()
Retrieve the transaction id from the TransactionId header . |
TransactionInfo |
getTransactionInfo()
Retrieve the 'transactioninfo' request body that must be included with the UNLOCK request of a transaction lock. |
UnbindInfo |
getUnbindInfo()
Returns the UnbindInfo present with the request |
UpdateInfo |
getUpdateInfo()
Parses the UPDATE request body a build the corresponding UpdateInfo
object. |
Principal |
getUserPrincipal()
|
boolean |
isOverwrite()
Return true if the overwrite header does not inhibit overwriting. |
boolean |
isRequestedSessionIdFromCookie()
|
boolean |
isRequestedSessionIdFromUrl()
|
boolean |
isRequestedSessionIdFromURL()
|
boolean |
isRequestedSessionIdValid()
|
boolean |
isSecure()
|
boolean |
isUserInRole(String s)
|
boolean |
matchesIfHeader(DavResource resource)
Test if the if header 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 |
removeAttribute(String s)
|
void |
setAttribute(String s,
Object o)
|
void |
setCharacterEncoding(String s)
|
void |
setDavSession(DavSession session)
Sets the session field and adds all lock tokens present with either the Lock-Token header or the If header to the given session object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.ServletRequest |
---|
getLocalAddr, getLocalName, getLocalPort, getRemotePort |
Constructor Detail |
---|
public WebdavRequestImpl(javax.servlet.http.HttpServletRequest httpRequest, DavLocatorFactory factory)
DavServletRequest
with the given parameters.
httpRequest
- factory
- Method Detail |
---|
public void setDavSession(DavSession session)
setDavSession
in interface DavServletRequest
session
- DavServletRequest.setDavSession(DavSession)
public DavSession getDavSession()
DavServletRequest
DavSession
created for this request.
getDavSession
in interface DavServletRequest
DavServletRequest.getDavSession()
public DavResourceLocator getRequestLocator()
DavResourceLocator
representing the request handle.
getRequestLocator
in interface DavServletRequest
DavServletRequest.getRequestLocator()
public DavResourceLocator getDestinationLocator() throws DavException
getDestinationLocator
in interface DavServletRequest
DavException
DavConstants.HEADER_DESTINATION
,
DavServletRequest.getDestinationLocator()
public DavResourceLocator getHrefLocator(String href) throws DavException
getHrefLocator
in interface BindServletRequest
DavException
BindServletRequest.getHrefLocator(java.lang.String)
public DavResourceLocator getMemberLocator(String segment)
getMemberLocator
in interface BindServletRequest
public boolean isOverwrite()
isOverwrite
in interface DavServletRequest
DavConstants.HEADER_OVERWRITE
,
DavServletRequest.isOverwrite()
public int getDepth(int defaultValue)
DavServletRequest
Depth header
or the given defaultValue, if the Depth header is missing.
getDepth
in interface DavServletRequest
defaultValue
- to be returned if no Depth header is present.
Depth header
or the given defaultValue.DavServletRequest.getDepth(int)
public int getDepth()
DavServletRequest
Depth header
. 'Infinity' is represented by DavConstants.DEPTH_INFINITY
.
getDepth
in interface DavServletRequest
Depth header
.DavServletRequest.getDepth()
public long getTimeout()
DavConstants.UNDEFINED_TIMEOUT
is used as default value if no header
is available or if the parsing fails.
getTimeout
in interface DavServletRequest
DavServletRequest.getTimeout()
,
TimeoutHeader.parse(javax.servlet.http.HttpServletRequest, long)
public String getLockToken()
getLockToken
in interface DavServletRequest
IllegalArgumentException
- If the value has not the correct format.DavConstants.HEADER_LOCK_TOKEN
,
DavServletRequest.getLockToken()
public Document getRequestDocument() throws DavException
DavServletRequest
Document
.
getRequestDocument
in interface DavServletRequest
null
if no request body is present.
DavException
- If the request body cannot be parsed into an Xml
Document.DavServletRequest.getRequestDocument()
public int getPropFindType() throws DavException
getPropFindType
in interface DavServletRequest
allprops
DavException
- If the propfind type could not be determined due to
an invalid request body.DavServletRequest.getPropFindType()
public DavPropertyNameSet getPropFindProperties() throws DavException
type
is either 'allprop' or
'propname'.
getPropFindProperties
in interface DavServletRequest
DavException
- In case of invalid request bodyDavServletRequest.getPropFindProperties()
public DavPropertySet getPropPatchSetProperties() throws DavException
getPropPatchChangeList()
instead
getPropPatchSetProperties
in interface DavServletRequest
DavException
- In case of invalid request bodyDavServletRequest.getPropPatchSetProperties()
public DavPropertyNameSet getPropPatchRemoveProperties() throws DavException
getPropPatchChangeList()
instead
getPropPatchRemoveProperties
in interface DavServletRequest
DavException
- In case of invalid request bodyDavServletRequest.getPropPatchRemoveProperties()
public List getPropPatchChangeList() throws DavException
List
of property change operations. Each entry
is either of type DavPropertyName
, indicating a <remove>
operation, or of type DavProperty
, indicating a <set>
operation. Note that ordering is significant here.
getPropPatchChangeList
in interface DavServletRequest
DavException
- In case of invalid request bodyDavServletRequest.getPropPatchChangeList()
public LockInfo getLockInfo() throws DavException
LockInfo
object encapsulating the information passed with a LOCK
request if the LOCK request body was valid. If the request body is
missing a 'refresh lock' request is assumed. The LockInfo
then only provides timeout and isDeep property and returns true on
LockInfo.isRefreshLock()
getLockInfo
in interface DavServletRequest
null
if an error occured while
parsing the request body.
DavException
- throws a 400 (Bad Request) DavException if a request
body is present but does not start with a DAV:lockinfo element. Note however,
that a non-existing request body is a valid request used to refresh
an existing lock.DavServletRequest.getLockInfo()
public boolean matchesIfHeader(DavResource resource)
resource href
and the token returned from an exclusive write lock present on
the resource.null
or if
the resource has not applied an exclusive write lock the preconditions are met.
If in contrast the lock applied to the given resource returns a
null
lock token (e.g. for security reasons) or a lock token
that does not match, the method will return false.
matchesIfHeader
in interface DavServletRequest
resource
- Webdav resources being operated on
DavServletRequest.matchesIfHeader(DavResource)
,
IfHeader.matches(String, String, String)
,
DavResource.hasLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
,
ActiveLock.getToken()
public boolean matchesIfHeader(String href, String token, String eTag)
DavServletRequest
If header
present
with the request matches to the given href, token and eTag.
matchesIfHeader
in interface DavServletRequest
DavServletRequest.matchesIfHeader(String, String, String)
,
IfHeader.matches(String, String, String)
public String getTransactionId()
TransactionDavServletRequest
TransactionId header
.
getTransactionId
in interface TransactionDavServletRequest
TransactionId header
or null
.TransactionDavServletRequest.getTransactionId()
public TransactionInfo getTransactionInfo() throws DavException
TransactionDavServletRequest
null
is returned.
getTransactionInfo
in interface TransactionDavServletRequest
TransactionInfo
object encapsulating the 'transactioninfo'
Xml element present in the request body or null if no
body is present or if it could not be parsed.
- Throws:
DavException
- if an invalid request body is present.- See Also:
TransactionDavServletRequest.getTransactionInfo()
public String getSubscriptionId()
ObservationDavServletRequest
SubscriptionId header
or null
if no such header is present.
getSubscriptionId
in interface ObservationDavServletRequest
SubscriptionId header
ObservationDavServletRequest.getSubscriptionId()
public long getPollTimeout()
ObservationDavServletRequest
PollTimeout header
or 0 (zero) if no such header is present.
getPollTimeout
in interface ObservationDavServletRequest
ObservationDavServletRequest.getPollTimeout()
public SubscriptionInfo getSubscriptionInfo() throws DavException
ObservationDavServletRequest
SubscriptionInfo
object representing the subscription
info present in the SUBSCRIBE request body or null
if
retrieving the subscription info fails.
getSubscriptionInfo
in interface ObservationDavServletRequest
null
if the subscription info cannot be built.
DavException
- if an invalid request body was encountered.ObservationDavServletRequest.getSubscriptionInfo()
public String getOrderingType()
OrderingDavServletRequest
Ordering-Type header
.
getOrderingType
in interface OrderingDavServletRequest
Ordering-Type header
.OrderingDavServletRequest.getOrderingType()
public Position getPosition()
OrderingDavServletRequest
Position
object encapsulating the Position header
field or null
if no Position header is present
or does not contain a valid format.
getPosition
in interface OrderingDavServletRequest
Position
object encapsulating the Position header
OrderingDavServletRequest.getPosition()
public OrderPatch getOrderPatch() throws DavException
OrderingDavServletRequest
OrderPatch
object encapsulating the request body
of an ORDERPATCH request or null
if the request body was
either missing or could not be parsed.
getOrderPatch
in interface OrderingDavServletRequest
OrderPatch
object representing the orderpatch request
body or null
if the
DavException
OrderingDavServletRequest.getOrderPatch()
public String getLabel()
DeltaVServletRequest
null
getLabel
in interface DeltaVServletRequest
null
DeltaVServletRequest.getLabel()
public LabelInfo getLabelInfo() throws DavException
DeltaVServletRequest
LabelInfo
object or null
if parsing the request body or the creation of the label info failed.
getLabelInfo
in interface DeltaVServletRequest
LabelInfo
object or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getLabelInfo()
public MergeInfo getMergeInfo() throws DavException
DeltaVServletRequest
MergeInfo
object or null
if the creation failed due to invalid format.
getMergeInfo
in interface DeltaVServletRequest
MergeInfo
object or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getMergeInfo()
public UpdateInfo getUpdateInfo() throws DavException
DeltaVServletRequest
UpdateInfo
object. If the request body is missing or does not of the required format
null
is returned.
getUpdateInfo
in interface DeltaVServletRequest
null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getUpdateInfo()
public ReportInfo getReportInfo() throws DavException
DeltaVServletRequest
ReportInfo
object. The default depth, if no Depth header
, is DavConstants.DEPTH_0
.
If the requuest body could not be parsed into an Element
null
is returned.
getReportInfo
in interface DeltaVServletRequest
ReportInfo
or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getReportInfo()
public OptionsInfo getOptionsInfo() throws DavException
DeltaVServletRequest
OptionsInfo
present with the request or null
.
getOptionsInfo
in interface DeltaVServletRequest
OptionsInfo
or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getOptionsInfo()
public RebindInfo getRebindInfo() throws DavException
BindServletRequest
RebindInfo
present with the request
getRebindInfo
in interface BindServletRequest
RebindInfo
object
DavException
- in case of an invalid or missing request bodyBindServletRequest.getRebindInfo()
public UnbindInfo getUnbindInfo() throws DavException
BindServletRequest
UnbindInfo
present with the request
getUnbindInfo
in interface BindServletRequest
UnbindInfo
object
DavException
- in case of an invalid or missing request bodyBindServletRequest.getUnbindInfo()
public BindInfo getBindInfo() throws DavException
BindServletRequest
BindInfo
present with the request
getBindInfo
in interface BindServletRequest
BindInfo
object
DavException
- in case of an invalid or missing request bodyBindServletRequest.getBindInfo()
public String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
public long getDateHeader(String s)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
public String getHeader(String s)
getHeader
in interface javax.servlet.http.HttpServletRequest
public Enumeration getHeaders(String s)
getHeaders
in interface javax.servlet.http.HttpServletRequest
public Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
public int getIntHeader(String s)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
public String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(String s)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
public String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
public StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
public String getServletPath()
getServletPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession(boolean b)
getSession
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.HttpSession getSession()
getSession
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
public Object getAttribute(String s)
getAttribute
in interface javax.servlet.ServletRequest
public Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(String s) throws UnsupportedEncodingException
setCharacterEncoding
in interface javax.servlet.ServletRequest
UnsupportedEncodingException
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
public String getContentType()
getContentType
in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream() throws IOException
getInputStream
in interface javax.servlet.ServletRequest
IOException
public String getParameter(String s)
getParameter
in interface javax.servlet.ServletRequest
public Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public String[] getParameterValues(String s)
getParameterValues
in interface javax.servlet.ServletRequest
public Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
public String getScheme()
getScheme
in interface javax.servlet.ServletRequest
public String getServerName()
getServerName
in interface javax.servlet.ServletRequest
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
public BufferedReader getReader() throws IOException
getReader
in interface javax.servlet.ServletRequest
IOException
public String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
public String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
public void setAttribute(String s, Object o)
setAttribute
in interface javax.servlet.ServletRequest
public void removeAttribute(String s)
removeAttribute
in interface javax.servlet.ServletRequest
public Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
public Enumeration getLocales()
getLocales
in interface javax.servlet.ServletRequest
public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public javax.servlet.RequestDispatcher getRequestDispatcher(String s)
getRequestDispatcher
in interface javax.servlet.ServletRequest
public String getRealPath(String s)
getRealPath
in interface javax.servlet.ServletRequest
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |