Here's some things I was mulling over last night:
- There seems to be some overlap in concepts/goals between FileName and Uri. Perhaps
they should be combined somehow.
- There's a lot of functionality inside FileObject: including getChildren(),
getParent(), resolveFile(), create(), delete(), etc. . One advantage to this is only
needing one object, a FileObject, to get all sorts of this work done. Alternatively,
these calls could be made to FileSystem directly, with a FileObject passed in. Since
most of these methods that are currently in FileObject end up calling FileSystem
anyway a lot of the work is already done. This would reduce the duplication in apis
between FileObject and FileSystem. It might also make it a bit clearer where the
responsibility is.
- taking the last idea a little further, it might be cleaner/clearer to move most/all
FileObject creation into FileSystem and it's subclasses. One of the hardest things
for me in getting up to speed with the code was understanding the creation of
FileObjects. In the index of the API docs, there are 19 different resolveFile methods
in various class hierarchies. There is also FileProvider.findFile(),
FileObject.findFiles(), and LocalFileProvider.findLocalFile(). Forcing clients to use
a FileSystem instance to get a FileObject might be another step or two of code for
them, but it might make a big improvement in the api clarity and would allow the
slimming down of many other classes.
- it may be useful to explore the idea of removing FileObject's refererence to it's
FileSystem alltogether
- For consistency: Unless I'm missing some meaning, and I totally could be,
AbstractFileSystemProvider, DefaultLocalFileSystemProvider, ZipFileSystemProvider,
JarFileSystemProvider, FtpFileSystemProvider, SmbFileSystemProvider should all be
FileProvider not FileSystemProvider since that's the interface they implement. Or
FileProvider should be renamed along with it's similarly named implementors.
- the reasoning behind what classes go in org.commons.vfs.impl versus
org.commons.vfs.provider is a little confusing.
That's all I can think of at the moment. How do these sound? Hopefully my ideas came
across as constructive, not critical. I'm very impressed with what's already there
and how quickly I was able to use it.
+jeff