com.caucho.servlets.webdav
Class XmlApplicationPath

java.lang.Object
  extended by com.caucho.servlets.webdav.AbstractPath
      extended by com.caucho.servlets.webdav.ApplicationPath
          extended by com.caucho.servlets.webdav.XmlApplicationPath

public class XmlApplicationPath
extends ApplicationPath

Represents a virtual filesystem using xml files to store the attribute.


Nested Class Summary
static class XmlApplicationPath.FileAttributes
           
 
Field Summary
 
Fields inherited from class com.caucho.servlets.webdav.AbstractPath
log
 
Constructor Summary
XmlApplicationPath()
           
 
Method Summary
 java.lang.String getAttribute(AttributeName name, java.lang.String path, HttpServletRequest request, ServletContext app)
          Returns an attribute value.
 java.util.Iterator getAttributeNames(java.lang.String path, HttpServletRequest request, ServletContext app)
          Returns an iterator over the attribute names.
protected  XmlApplicationPath.FileAttributes getAttributes(java.lang.String path)
           
protected  Path getPath(java.lang.String path, HttpServletRequest request, ServletContext app)
          Returns the underlying path.
 Path getRoot()
          Returns the root path.
 java.lang.String[] list(java.lang.String path, HttpServletRequest request, ServletContext app)
          Returns a list of the files in the directory.
 boolean remove(java.lang.String path, HttpServletRequest request, ServletContext app)
          Deletes the file
 boolean removeAttribute(AttributeName name, java.lang.String path, HttpServletRequest request, ServletContext app)
          Removes an attribute value.
protected  void removeAttributes(java.lang.String path)
           
 boolean setAttribute(AttributeName name, java.lang.String value, java.lang.String path, HttpServletRequest request, ServletContext app)
          Sets an attribute value.
 void setRoot(Path path)
          path the root path.
 
Methods inherited from class com.caucho.servlets.webdav.ApplicationPath
canRead, exists, getLastModified, getLength, isDirectory, isFile, mkdir, openRead, openWrite, removeAttribute, rmdir
 
Methods inherited from class com.caucho.servlets.webdav.AbstractPath
destroy, rename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlApplicationPath

public XmlApplicationPath()
Method Detail

setRoot

public void setRoot(Path path)
path the root path.


getRoot

public Path getRoot()
Returns the root path.


remove

public boolean remove(java.lang.String path,
                      HttpServletRequest request,
                      ServletContext app)
               throws java.io.IOException
Deletes the file

Overrides:
remove in class ApplicationPath
Parameters:
path - the requested relative path
request - the servlet request
app - the servlet context
Returns:
true if the remove succeeded.
Throws:
java.io.IOException

getAttributeNames

public java.util.Iterator getAttributeNames(java.lang.String path,
                                            HttpServletRequest request,
                                            ServletContext app)
                                     throws java.io.IOException
Returns an iterator over the attribute names. Each attribute name is of the type AttributeName.

Overrides:
getAttributeNames in class ApplicationPath
Parameters:
path - the requested relative path
request - the servlet request
app - the servlet context
Throws:
java.io.IOException

getAttribute

public java.lang.String getAttribute(AttributeName name,
                                     java.lang.String path,
                                     HttpServletRequest request,
                                     ServletContext app)
                              throws java.io.IOException
Returns an attribute value.

Overrides:
getAttribute in class ApplicationPath
Parameters:
name - the attribute name
path - the requested relative path
request - the servlet request
app - the servlet context
Throws:
java.io.IOException

setAttribute

public boolean setAttribute(AttributeName name,
                            java.lang.String value,
                            java.lang.String path,
                            HttpServletRequest request,
                            ServletContext app)
                     throws java.io.IOException
Sets an attribute value.

Overrides:
setAttribute in class ApplicationPath
Parameters:
name - the attribute name
value - the attribute value
path - the requested relative path
request - the servlet request
app - the servlet context
Returns:
true if the setting was successful
Throws:
java.io.IOException

removeAttribute

public boolean removeAttribute(AttributeName name,
                               java.lang.String path,
                               HttpServletRequest request,
                               ServletContext app)
                        throws java.io.IOException
Removes an attribute value.

Overrides:
removeAttribute in class AbstractPath
Parameters:
name - the attribute name
path - the requested relative path
request - the servlet request
app - the servlet context
Throws:
java.io.IOException

getAttributes

protected XmlApplicationPath.FileAttributes getAttributes(java.lang.String path)

removeAttributes

protected void removeAttributes(java.lang.String path)

list

public java.lang.String[] list(java.lang.String path,
                               HttpServletRequest request,
                               ServletContext app)
                        throws java.io.IOException
Returns a list of the files in the directory.

Overrides:
list in class ApplicationPath
Parameters:
path - the requested relative path
request - the servlet request
app - the servlet context
Throws:
java.io.IOException

getPath

protected Path getPath(java.lang.String path,
                       HttpServletRequest request,
                       ServletContext app)
                throws java.io.IOException
Returns the underlying path.

Overrides:
getPath in class ApplicationPath
Throws:
java.io.IOException