本文整理汇总了Java中org.apache.commons.vfs2.FileSystemConfigBuilder类的典型用法代码示例。如果您正苦于以下问题:Java FileSystemConfigBuilder类的具体用法?Java FileSystemConfigBuilder怎么用?Java FileSystemConfigBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileSystemConfigBuilder类属于org.apache.commons.vfs2包,在下文中一共展示了FileSystemConfigBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractFileSystem
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
protected AbstractFileSystem(final FileName rootName,
final FileObject parentLayer,
final FileSystemOptions fileSystemOptions)
{
// this.parentLayer = parentLayer;
this.parentLayer = parentLayer;
this.rootName = rootName;
this.fileSystemOptions = fileSystemOptions;
FileSystemConfigBuilder builder = DefaultFileSystemConfigBuilder.getInstance();
String uri = builder.getRootURI(fileSystemOptions);
if (uri == null)
{
uri = rootName.getURI();
}
this.rootURI = uri;
}
示例2: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Test
public void getConfigBuilder() throws FileSystemException {
final AtomicBoolean called = new AtomicBoolean( false );
String scheme = "scheme";
HadoopConfiguration config =
new HadoopConfiguration( VFS.getManager().resolveFile( "ram:///" ), "id", "name", new MockHadoopShim(), null,
null, null );
FileProvider provider = new MockFileProvider() {
@Override
public FileSystemConfigBuilder getConfigBuilder() {
called.set( true );
return null;
}
};
HadoopConfigurationFileSystemManager fsm = createTestFileSystemManager( config, scheme, provider );
ActiveHadoopShimFileProvider p = new ActiveHadoopShimFileProvider( fsm, scheme );
p.getConfigBuilder();
assertTrue( "Expected provider method not called", called.get() );
}
示例3: createSchemeMethods
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
/**
* create the list of all set*() methods for the given scheme
*/
private Map<String, List<Method>> createSchemeMethods(String scheme) throws FileSystemException
{
final FileSystemConfigBuilder fscb = getManager().getFileSystemConfigBuilder(scheme);
if (fscb == null)
{
throw new FileSystemException("vfs.provider/no-config-builder.error", scheme);
}
Map<String, List<Method>> schemeMethods = new TreeMap<String, List<Method>>();
Method[] methods = fscb.getClass().getMethods();
for (int iterMethods = 0; iterMethods < methods.length; iterMethods++)
{
Method method = methods[iterMethods];
if (!Modifier.isPublic(method.getModifiers()))
{
continue;
}
String methodName = method.getName();
if (!methodName.startsWith("set"))
{
// not a setter
continue;
}
String key = methodName.substring(3).toLowerCase();
List<Method> configSetter = schemeMethods.get(key);
if (configSetter == null)
{
configSetter = new ArrayList<Method>(2);
schemeMethods.put(key, configSetter);
}
configSetter.add(method);
}
return schemeMethods;
}
示例4: getFileSystemConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
/**
* Get the configuration builder for the given scheme.
* @param scheme The scheme to locate.
* @return The FileSystemConfigBuilder for the scheme.
* @throws FileSystemException if the given scheme is not konwn
*/
public FileSystemConfigBuilder getFileSystemConfigBuilder(final String scheme)
throws FileSystemException
{
FileProvider provider = providers.get(scheme);
if (provider == null)
{
throw new FileSystemException("vfs.impl/unknown-scheme.error", new Object[] {scheme});
}
return provider.getConfigBuilder();
}
示例5: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getConfigBuilder() {
try {
return fsm.getActiveFileProvider( scheme ).getConfigBuilder();
} catch ( FileSystemException e ) {
return null;
}
}
示例6: getFileSystemConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getFileSystemConfigBuilder( String scheme ) throws FileSystemException {
lock.readLock().lock();
try {
return super.getFileSystemConfigBuilder( scheme );
} finally {
lock.readLock().unlock();
}
}
示例7: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public FileSystemConfigBuilder getConfigBuilder() {
return GsiFtpFileSystemConfigBuilder.getInstance();
}
示例8: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
public FileSystemConfigBuilder getConfigBuilder() {
// not needed for our usage
return null;
}
示例9: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getConfigBuilder()
{
return FtpFileSystemConfigBuilder.getInstance();
}
示例10: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getConfigBuilder()
{
return SftpFileSystemConfigBuilder.getInstance();
}
示例11: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getConfigBuilder()
{
return HttpFileSystemConfigBuilder.getInstance();
}
示例12: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getConfigBuilder()
{
return org.apache.commons.vfs2.provider.res.ResourceFileSystemConfigBuilder.getInstance();
}
示例13: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getConfigBuilder()
{
return WebdavFileSystemConfigBuilder.getInstance();
}
示例14: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
@Override
public FileSystemConfigBuilder getConfigBuilder()
{
return FtpsFileSystemConfigBuilder.getInstance();
}
示例15: getConfigBuilder
import org.apache.commons.vfs2.FileSystemConfigBuilder; //导入依赖的package包/类
/**
* Returns the FileSystemConfigBuidler.
* @return the FileSystemConfigBuilder.
*/
public FileSystemConfigBuilder getConfigBuilder()
{
return null;
}