tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <>
Subject WebDAV, DefaultServlet and Resources
Date Thu, 27 Jul 2000 01:45:09 GMT

I'd like to discuss here some features and enhancements I plan to make in

* WebDAV support

A servlet will provide WebDAV level 2 capabilities. It can be seen as a
merge between the DefaultServlet and a simplified version of the
WebdavServlet from the Slide project (and cleared of Slide dependencies, of
course). This servlet could be designed to use the filesystem directly.
Instead, for additional flexibility and abstraction, I plan to use the
Resources interface (well, an extended version of it, since there are no
write methods in that interface as of now - see below).

* DefaultServlet

DefaultServlet will be modified to also use the Resources interface. If
performance turns out to be good enough, I suggest completely removing any
direct filesystem access. Some additions will be needed to Resources,
though, like the possibility to access directories through the interface, or
just retrieving the content length of a resource, when it's known.

* Resources

Right now, the interface provides the following functions :
- String getMimeType(String file)
- String getRealPath(String path)
- URL getResource(String path)
- InputStream getResourceAsStream(String path)

I think the following methods should be added for support in DefaultServlet,
with the same level of functionality as standard filesystem :
- long getResourceLength(String path)
Returns -1 if unknown, 0 if no content (directory ...), or the content
length of the resource otherwise
- boolean isCollection(String path)
Returns true if the resource denoted by the given path is the functional
equivalent of a directory
- String[] getCollectionMembers(String path)
Returns the list of the paths of the resources which are member of the
collection denoted by the given path. null if the resource is not a

WebDAV requires write access :
- boolean setResource(String path, InputStream content)
Write a resource. Return false if the content was not written if the given
path denotes a collection of if no parent collection exists for this
- boolean createCollection(String path)
Creates a new empty collection. isCollection(path) would return true after
making that call. The call returns false if a resource already exist, or if
additional intermediate collections need to be created before.
- void deleteResource(String path)
Deletes the resource denoted by the path. Only "normal" resources and empty
dirs can be deleted, etc, etc ...

Feel free to give me some feedback on these plans.


View raw message