commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject Re: [VFS] "res:" protocol issue
Date Wed, 31 Aug 2005 14:49:41 GMT
Hi (again ;-) )!
> this is just what is missing for "res:"
> ResUtil.listJar();
> now you can resolve /path/to/resource on each jar and select those 
> that you prefer
> just write the tool
And if you ;-) write it dont forget a classpath do not only contain jars 
but also directories.

So if I understand what you would like to have is something like

FileObject[] fos = ResUtils.resolveClasspath();

and then one is able to check if a requested resource is child of one of 
the "fos".

I have hade something else in mind, I thought it would be nice if we 
introduce a CompositeFileObject then we can do:

FileObject fo = VFS.getManager().resovleFile("classpath:org/");
FileObject[] fos = fo.getChildren();

The returned array is then a list of (maybe Composite-) FileObjects 
collected through different jars/directories.

The problem is that "org" in one jar can be a "file" and in another a 
"directory", but this can be solved in CompositeFileObject and so there 
is no "unclean" solution in VFS core.

This "CompositeFileObject" can be used outside of classpath:// to, e.g. 
what you can do is

FileObject fo = new CompositeFileObject("file://c:/", "file://d:/");
A fo.getChildren() will return a list from both filesystems then.

BTW: Notice the trailing "/" ;-) I start to like it.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message