Package com.ithit.webdav.server
Class DavRequest
java.lang.Object
com.ithit.webdav.server.DavRequest
Represents http request to the WebDAV server.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
Returns request encoding.Gets the array of lock tokens submitted by client.abstract long
Returns the length, in bytes, of the request body.abstract String
Returns the MIME type of the body of the request, ornull
.abstract String
Returns the portion of the request URI that indicates the context of the request.abstract String
Returns http header by name or null if not exists.abstract Enumeration<String>
Returns an enumeration of all the header names this request contains.abstract InputStream
Retrieves the body of the request as binary data using aInputStream
.abstract String
Returns http method of the request.abstract Object
Returns the original request that was sent by the chosen web container.abstract String
Returns the query string that is contained in the request URL after the path.abstract String
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.abstract String
Returns http or https server scheme.abstract String
Returns server name.abstract String
Returns the part of this request's URL that calls the server.abstract int
Returns port at which server is running.
-
Constructor Details
-
DavRequest
public DavRequest()
-
-
Method Details
-
getHeader
Returns http header by name or null if not exists.- Parameters:
name
- Name of the header.- Returns:
- Value of the header.
-
getMethod
Returns http method of the request.- Returns:
- Http method.
-
getRequestURI
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.- Returns:
- a
String
containing the part of the URL from the protocol name up to the query string.
-
getQueryString
Returns the query string that is contained in the request URL after the path.- Returns:
- a
String
containing the query string ornull
if the URL contains no query string. The value is not decoded by the container.
-
getContextPath
Returns the portion of the request URI that indicates the context of the request.- Returns:
- a
String
specifying the portion of the request URI that indicates the context of the request.
-
getServerPath
Returns the part of this request's URL that calls the server.- Returns:
- a
String
containing the name or path of the server being called, as specified in the request URL, decoded, or an empty string if the server used to process the request is matched using the "/*" pattern.
-
getServerPort
public abstract int getServerPort()Returns port at which server is running.- Returns:
int
port.
-
getScheme
Returns http or https server scheme.- Returns:
- Http or https.
-
getServerName
Returns server name.- Returns:
- Server name.
-
getCharacterEncoding
Returns request encoding.- Returns:
- Character encoding of the request.
-
getInputStream
Retrieves the body of the request as binary data using aInputStream
.- Returns:
- a
InputStream
object containing the body of the request. - Throws:
IOException
- if an input or output exception occurred.
-
getContentLength
public abstract long getContentLength()Returns the length, in bytes, of the request body.- Returns:
- An long containing the length of the request body or -1 if the length is not known.
-
getContentType
Returns the MIME type of the body of the request, ornull
.- Returns:
- a
String
containing the name of the MIME type of the request, or null if the type is not known.
-
getHeaderNames
Returns an enumeration of all the header names this request contains.- Returns:
- An enumeration of all the header names sent with this request.
-
getOriginalRequest
Returns the original request that was sent by the chosen web container.- Returns:
- Object original request.
-
getClientLockTokens
Gets the array of lock tokens submitted by client.Gets array of lock tokens submitted by client. You must generate the lock tokens during the call to your
Lock.lock(boolean, boolean, long, java.lang.String)
method implementation. During this call you associate generated token with an item in the repository and return it to the Engine. Engine than sends the new token to the WebDAV client. When WebDAV client is modifying any server item it sends back to server the list of lock tokens. In your WebDAV server Class 2 implementation before modifying any locked items you must check if WebDAV client provided necessary lock token.- Returns:
- List of lock tokens submitted by client.
-