Class DavRequest

java.lang.Object
com.ithit.webdav.server.DavRequest

public abstract class DavRequest extends Object
Represents http request to the WebDAV server.
  • Constructor Details

    • DavRequest

      public DavRequest()
  • Method Details

    • getHeader

      public abstract String getHeader(String name)
      Returns http header by name or null if not exists.
      Parameters:
      name - Name of the header.
      Returns:
      Value of the header.
    • getMethod

      public abstract String getMethod()
      Returns http method of the request.
      Returns:
      Http method.
    • getRequestURI

      public abstract String 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

      public abstract String getQueryString()
      Returns the query string that is contained in the request URL after the path.
      Returns:
      a String containing the query string or null if the URL contains no query string. The value is not decoded by the container.
    • getContextPath

      public abstract String 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

      public abstract String 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

      public abstract String getScheme()
      Returns http or https server scheme.
      Returns:
      Http or https.
    • getServerName

      public abstract String getServerName()
      Returns server name.
      Returns:
      Server name.
    • getCharacterEncoding

      public abstract String getCharacterEncoding()
      Returns request encoding.
      Returns:
      Character encoding of the request.
    • getInputStream

      public abstract InputStream getInputStream() throws IOException
      Retrieves the body of the request as binary data using a InputStream.
      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

      public abstract String getContentType()
      Returns the MIME type of the body of the request, or null.
      Returns:
      a String containing the name of the MIME type of the request, or null if the type is not known.
    • getHeaderNames

      public abstract Enumeration<String> 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

      public abstract Object getOriginalRequest()
      Returns the original request that was sent by the chosen web container.
      Returns:
      Object original request.
    • getClientLockTokens

      public List<String> 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.