extending DirectoryResource

nemo@dnrc.bell-labs.com writes:
 > 
 > Hello,
 > 
 > I've come across the following Jigsaw puzzle ;) 
 > 
 > I have a class ManagedFileResource extends FileResource, which
 > works fine, i.e. it does what I want it to do when I go and manually
 > add files via the AddingResources form .
 > 
 > Now I want to have directories where all the files in that directory
 > are automatically attached to a ManagedFileResource. Shouldn't I be
 > able to this by just having a class ManagedDirectoryResource extends
 > DirectoryResource and only overriding createDefaultResource().

Yes, that's the point of the createDefaultresource method.

 > But what troubles me is I see that
 > DirectoryResource.createDefaultResource() calls
 > ResourceIndexer.createResource(). Why should the ResourceIndexer be
 > the one creating? The ResourceIndexer shouldn't need to know what
 > classes I feel like using for my files... If I have to go through the
 > Indexer then I need to subclass that too to handle my kind of
 > resources?  If so, then where do I tell the server to use a different
 > Indexer...

If I had more time, each DirectoryResource would already be able to
have it's own ResourceIndexer, falling back to the global one only if
nothing else is specified. Also the current ResourceIndexer is really
not that powerfull. However, in your case, feel free to redefine
createDefaultResource to match your needs (ie not making it go to the
resource indexer).

I hope to be able to tackle the configurastion problem, as a whole in
the after mid-august release. 

Anselm.

Received on Thursday, 25 July 1996 17:36:21 UTC