Package org.apache.commons.vfs2.util
Class DelegatingFileSystemOptionsBuilder
java.lang.Object
org.apache.commons.vfs2.util.DelegatingFileSystemOptionsBuilder
This class use reflection to set a configuration value using the fileSystemConfigBuilder associated the a scheme.
 
Example:
FileSystemOptions fso = new FileSystemOptions(); DelegatingFileSystemOptionsBuilder delegate = new DelegatingFileSystemOptionsBuilder(VFS.getManager()); delegate.setConfigString(fso, "sftp", "identities", "c:/tmp/test.ident"); delegate.setConfigString(fso, "http", "proxyPort", "8080"); delegate.setConfigClass(fso, "sftp", "userinfo", TrustEveryoneUserInfo.class);
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected FileSystemManagerGets the FileSystemManager.voidsetConfigClass(FileSystemOptions fso, String scheme, String name, Class<?> className) Sets a single class value.voidsetConfigClasses(FileSystemOptions fso, String scheme, String name, Class<?>[] classNames) Sets an array of class values.voidsetConfigString(FileSystemOptions fso, String scheme, String name, String value) Sets a single string value.voidsetConfigStrings(FileSystemOptions fso, String scheme, String name, String[] values) Sets an array of string value.
- 
Constructor Details- 
DelegatingFileSystemOptionsBuilderConstructs a new instance.Pass in your fileSystemManager instance. - Parameters:
- manager- the manager to use to get the fileSystemConfigBuilder associated to a scheme
 
 
- 
- 
Method Details- 
getManagerGets the FileSystemManager.- Returns:
- the FileSystemManager.
 
- 
setConfigClasspublic void setConfigClass(FileSystemOptions fso, String scheme, String name, Class<?> className) throws FileSystemException, ReflectiveOperationException Sets a single class value.The class has to implement a no-args constructor, else the instantiation might fail. - Parameters:
- fso- FileSystemOptions
- scheme- scheme
- name- name
- className- className
- Throws:
- FileSystemException- if an error occurs.
- ReflectiveOperationException- if a class cannot be accessed or instantiated.
 
- 
setConfigClassespublic void setConfigClasses(FileSystemOptions fso, String scheme, String name, Class<?>[] classNames) throws FileSystemException, ReflectiveOperationException Sets an array of class values.The class has to implement a no-args constructor, else the instantiation might fail. - Parameters:
- fso- FileSystemOptions
- scheme- scheme
- name- name
- classNames- classNames
- Throws:
- FileSystemException- if an error occurs.
- ReflectiveOperationException- if a class cannot be accessed or instantiated.
 
- 
setConfigStringpublic void setConfigString(FileSystemOptions fso, String scheme, String name, String value) throws FileSystemException Sets a single string value.- Parameters:
- fso- FileSystemOptions
- scheme- scheme
- name- name
- value- value
- Throws:
- FileSystemException- if an error occurs.
 
- 
setConfigStringspublic void setConfigStrings(FileSystemOptions fso, String scheme, String name, String[] values) throws FileSystemException Sets an array of string value.- Parameters:
- fso- FileSystemOptions
- scheme- scheme
- name- name
- values- values
- Throws:
- FileSystemException- if an error occurs.
 
 
-