Xindice API
version 1.2m1

org.apache.xindice.webadmin.webdav
Class DAVRequest

java.lang.Object
  extended byorg.apache.xindice.webadmin.webdav.DAVRequest

public class DAVRequest
extends Object

This is a wrapper class that provides additional DAV-specific functionality.

Version:
$Revision: 551440 $, $Date: 2007-06-28 00:26:07 -0400 (Thu, 28 Jun 2007) $

Field Summary
static int DEPTH_0
           
static int DEPTH_1
           
static int DEPTH_INFINITY
           
 
Constructor Summary
DAVRequest(javax.servlet.http.HttpServletRequest request)
          Creates new instance of DAVRequest based on incoming HTTP request.
 
Method Summary
 String getContextPath()
          Wrapper method, gets servlet context path.
 int getDepth()
          Retrieves Depth header value from HTTP request.
 String getDestinationPath()
          Retrieves Destination header value from HTTP request.
 String getHeader(String name)
          Wrapper method, gets HTTP request header.
 javax.servlet.ServletInputStream getInputStream()
          Wrapper method, gets servlet input stream.
 boolean getOverwrite()
          Retrieves Overwrite header value from HTTP request.
 String getParameter(String name)
          Wrapper method, gets HTTP request parameter.
 String getPath()
          Wrapper method, gets resource path.
 String getProtocol()
          Wrapper method, gets request protocol.
 org.w3c.dom.Document getRequestDoc()
          Retreives request document if incoming request has any.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPTH_0

public static final int DEPTH_0
See Also:
Constant Field Values

DEPTH_1

public static final int DEPTH_1
See Also:
Constant Field Values

DEPTH_INFINITY

public static final int DEPTH_INFINITY
See Also:
Constant Field Values
Constructor Detail

DAVRequest

public DAVRequest(javax.servlet.http.HttpServletRequest request)
Creates new instance of DAVRequest based on incoming HTTP request.

Parameters:
request - HttpServletRequest
Method Detail

getRequestDoc

public org.w3c.dom.Document getRequestDoc()
                                   throws IOException
Retreives request document if incoming request has any.

Returns:
Parsed request document if request body has one or null if request body was empty or does not have a valid XML.
Throws:
IOException - ServletInputStream IOException

getPath

public String getPath()
Wrapper method, gets resource path. If servlet is mapped as default servlet (with url pattern '/'), resource path is obtained from HttpServletRequest.getServletPath(), and HttpServletRequest.getPathInfo() is always null. If servlet is mapped to a path pattern (url pattern like '/foo/*'), resource path is retrieved from HttpServletRequest.getPathInfo().

Returns:
Called servlet path.

getHeader

public String getHeader(String name)
Wrapper method, gets HTTP request header.

Parameters:
name - Header name
Returns:
Header value

getOverwrite

public boolean getOverwrite()
Retrieves Overwrite header value from HTTP request. Possible values are "T" or "F" (true of false). By default value is "T".

Returns:
False if HTTP request has a header "Overwrite: F", true othewise.

getDepth

public int getDepth()
Retrieves Depth header value from HTTP request. Possible values are "0", "1", and "infinity". By default, value is "infinity".

Returns:
0, 1, -1 for "0", "1", "infinity" header values respectively.

getDestinationPath

public String getDestinationPath()
Retrieves Destination header value from HTTP request. Its value is URL, it can be absolute or relative. This method returns only local path, deleting protocol, server name and context path.

Returns:
Local part of the destination path

getContextPath

public String getContextPath()
Wrapper method, gets servlet context path.

Returns:
Called servlet context path.

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws IOException
Wrapper method, gets servlet input stream.

Returns:
Servlet input stream.
Throws:
IOException

getParameter

public String getParameter(String name)
Wrapper method, gets HTTP request parameter.

Parameters:
name - Parameter name
Returns:
Parameter value

getProtocol

public String getProtocol()
Wrapper method, gets request protocol.

Returns:
Request protocol and version.

Xindice API
version 1.2m1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.