commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasily Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (VFS-168) FileSystemOptionsFactoryBean implementation to configure FileSystemOptions object in the Spring context
Date Wed, 11 Jul 2007 00:23:04 GMT

     [ https://issues.apache.org/jira/browse/VFS-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vasily Ivanov updated VFS-168:
------------------------------

    Attachment: FileSystemOptionsFactoryBean.java

FileSystemOptionsFactoryBean implementation

> 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
>         Attachments: FileSystemOptionsFactoryBean.java
>
>
> 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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message