FileSystemOptionsFactoryBean implementation to configure FileSystemOptions 
object in the Spring context
-------------------------------------------------------------------------------------------------------

                 Key: VFS-168
                 URL: https://issues.apache.org/jira/browse/VFS-168
             Project: Commons VFS
          Issue Type: New Feature
            Reporter: Vasily Ivanov
            Priority: Minor


It would be nice to have Spring FactoryBean that configures FileSystemOptions 
object and provides it as a bean reference.

I have created simple FactoryBean to do this kind of stuff 
(FileSystemOptionsFactoryBean.java attached).

For example, configuration would be like this:
<bean class="FileSystemOptionsFactoryBean">
    <property name="fileSystemConfig">
      <map>
        <entry key="org.apache.commons.vfs.impl.DefaultFileSystemConfigBuilder">
          <map>
            <entry key="userAuthenticator">
              <bean class="org.apache.commons.vfs.auth.StaticUserAuthenticator">
                <constructor-arg index="0"><null/></constructor-arg>
                <constructor-arg index="1" value="username"/>
                <constructor-arg index="2" value="password"/>
              </bean>
            </entry>
          </map>
        </entry>
        <entry 
key="org.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder">
          <map>
            <entry key="proxyType">
              <util:constant 
static-field="org.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder.PROXY_HTTP"/>
            </entry>
            <entry key="proxyHost" value="proxyhost"/>
            <entry key="proxyPort" value="8080"/>
            <entry key="userInfo">
              <bean 
class="org.apache.commons.vfs.provider.sftp.TrustEveryoneUserInfo"/>
            </entry>
            <entry key="strictHostKeyChecking" value="no"/>
            <entry key="userDirIsRoot" value="true"/>
            <entry key="timeout" value="3000"/>
          </map>
        </entry>
      </map>
    </property>
  </bean>

All properties are optional with "smart" defaults.

I'm planing to make it smart enough to accept just map of properties 
(FileSystem options) without reference to FileSystemConfigBuilder objects. 
It'll introspect all available FileSystemConfigBuilder implementations and 
apply those options using proper FileSystemConfigBuilder implementation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to