commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject [VFS] uri style resolve of relative filenames
Date Wed, 31 Aug 2005 19:24:55 GMT

The current SVN HEAD of VFS contains a version where you are able to 
enable the URI style filename resolving.

You have to enable it with
at the very beginning (before any other VFS operation).

To say its tested would be too much anyway. Just some quick resolving tests.
I dont know if the current test-cases work with URI style enabled.

base, relative, result
file://to/dir/, any/file, file://to/dir/any/file
file://to/dir, any/file, file://to/any/file

The current known limitations are:

*) Filenames created through FileObject.getChildren() do not have the 
correct type (file/directory) before you attach them.
I try to figure it out how to solve this.

*) The solution is not thread-safe (and maybe will never be). If you 
take care to always resolve directories with trailing "/" and files 
without this might not a big problem.
If you do not respect this point you might get unexpected results when 
resolving relative files as one time the file might be a file and later 
it might magically (e.g. createDirectory) be morphed to a directory.

*) Even if you resolve to a file it is still possible to call 
createDiretory(). The filename will then change its type to directory 
too. This is reversible if you do delete() and createFile().

*) The basic URI resolving is implemented (difference between 
file/directory at name level), for sure there is some other RFC guidline 
which waits to be undercovered.
If you find a problem you maybe can try to create a patch too ;-)

Feedback is welcome.


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

View raw message