commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject RE: [vfs] why is FileSystemConfigBuilder.setParam() protected?
Date Fri, 29 May 2009 08:33:07 GMT
> This is one of my least favorite parts of VFS. To configure  
> FileSystemOptions you have to use the appropriate  
> FileSystemConfigBuilder. I can't tell you why it was done this way as  
> it precedes my involvement, but I've considered reinventing this more  
> than once. It isn't pretty.

The reason I have done it that way was simply to have type-safe configuration parameters.
I hate it to have just setParam(String, String) or something like this.

It also was necessary to being able to mix parameters for multiple file-system implementations
1) your url might create a layered filesystem
2) you never know exactly which filesystem implementation is going to be used

So, I still like this approach.

For the setParam(String, String) approach VFS provides the DelegatingFileSystemOptionsBuilder
which then allows you to use setConfigString/setConfigClass which accepts just strings and
uses reflection to coerce it to the required type. This was created to populate the configuration
e.g. from an ant script or a properties file.


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

View raw message