Example usage for org.apache.commons.vfs2.impl StandardFileSystemManager getSchemes

List of usage examples for org.apache.commons.vfs2.impl StandardFileSystemManager getSchemes

Introduction

In this page you can find the example usage for org.apache.commons.vfs2.impl StandardFileSystemManager getSchemes.

Prototype

@Override
public String[] getSchemes() 

Source Link

Document

Get the schemes currently available.

Usage

From source file:pl.otros.vfs.browser.util.VFSUtils.java

/**
 * Returns the global filesystem manager
 *
 * @return the global filesystem manager
 */// w w w  . j  a  v  a  2  s.co m
public static FileSystemManager getFileSystemManager() {
    aLock.readLock().lock();

    try {
        if (fileSystemManager == null) {
            try {
                StandardFileSystemManager fm = new StandardFileSystemManager();
                fm.setCacheStrategy(CacheStrategy.MANUAL);
                fm.init();
                LOGGER.info("Supported schemes: {} ", Joiner.on(", ").join(fm.getSchemes()));
                fileSystemManager = fm;
            } catch (Exception exc) {
                throw new RuntimeException(exc);
            }
        }

        return fileSystemManager;
    } finally {
        aLock.readLock().unlock();
    }
}