commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject Re: [vfs] FileSystemManager construction rethought
Date Thu, 24 Jun 2004 10:59:56 GMT
Rami Ojares wrote:

All you have written seems right - hard work ;-)

>But if one would tell them for example
>then that would just override the providers defaults set from the configuration
But i have to say i dont like to add all those configuration stuff to 
the uri - maybe this might be a handy place, but adding e.g. path 
elements like those in your example might be a real pain. It might be 
really hard to construct a correct uri.

>Now the configuration (file) can be passed as path, File, FileObject, DOM or
>whatever. But it would be nice if FileSystemManager interface would dictate at
>least some kind of configuration framework so the ant tasks would not have to
>mention any implementations.
I can second this too, and i see not discrepance to the current system.

<vfs-manager refid="mymanager" class="MyManager" configuration="path/to/conf"/>
<vfs-options id="options1">
	<vfs-option scheme="http" name="proxyHost" value="yourProxyHost" />
	<vfs-option scheme="sftp" name="userInfo" className="yourUserInfoImplementation" />
	<vfs-option scheme="sftp" name="knownHosts" value="/path/to" />
	<vfs-option scheme="sftp" name="identities">
<vfs-options id="options2">
	<vfs-option ... some other configuration ... />

Now there could be a class e.g. GeneralFileSystemConfigBuilder with

(<vfs-options name= value=>)
setConfigValue(String scheme, String name, String value)
(<vfs-options name= ><value></value>)
setConfigValue(String scheme, String name, String[] values)
(<vfs-options name= className=>)
setConfigClass(String scheme, String name, String className)

Which tries to locate the correct *FileSystemConfigBuilder, tries to 
convert the given value/class to the expected parameter and calls the 
All this can be done using reflection and a configuration mistake is 
fastly shown.
I will implement this class if we find a consent.

Now there is the problem how to connect the options to a given uri.
Maybe, if we do not connect them to the uri we could use a construct 
like this.

<vfs-copy todir="sftp://host/usr/local/var">

    <vfs-manager ref="mymanager"/>
    <vfs-options ref="options1"/>


Or i can think about an easy implementation like this:

<vfs-copy todir="sftp@options1://host/usr/local/var">

    <vfs-manager ref="mymanager"/>


Then the ant task should strip the @options1 and lookup a table to find 
the FileSystemOptions for resolvFile()

To do the same with the FileSystemManager - as you have said - we have 
to create a separate data structure first.
I will have a look at it, but for now we can stick on the xml file.

Might this find your acceptance?


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

View raw message