On 6/13/06, Lixin Chu <[EMAIL PROTECTED]> wrote:
Hi Marco, I am also interested in how you organize your private folder where you keep the resource/user/type information.
Well, my problem was that I had to enable users to watch files in a document management system, ROOT - | --- user ( as collection ) | --- UrlEncoder.encode(path/to/resource) ( as collection ) where ROOT is the root path of your private directory ( collection ) . The user collection has the same name as the username; I keep the e-mail address as a property of the collection . Each path has a property that says which type of subscriptions are submitted for the current user. Then, in my servlet, I create a listener on the ROOT directory, so that I am notified of every change in the tree and I can operate with subscribing & unsubscribing in the servlet itself. The system operates in the directory ( never directly on webdav subscriptions ) : there is only one class that minds about the callbacks. More, internally ( in memory ) data is organized a little differently than on disk : since you get the callback for the resource ( a path ) you need to organize data in maps that have UrlEncoder.encode(path/to/resource) as key and the list of users subscribed as data. Another pit : I had ( on a tomcat based server ) to put the initialization of the servlet ( reading the dav tree and so on ) in a separate thread ... it was stopping the server for too long making impossible for the webdav server to start up properly. cheers Marco --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]