Example usage for org.apache.commons.vfs.impl StandardFileSystemManager setCacheStrategy

List of usage examples for org.apache.commons.vfs.impl StandardFileSystemManager setCacheStrategy

Introduction

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

Prototype

public void setCacheStrategy(final CacheStrategy fileCacheStrategy) throws FileSystemException 

Source Link

Document

Set the cache strategy to use when dealing with file object data.

Usage

From source file:net.sf.vfsjfilechooser.utils.VFSUtils.java

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

    try {
        if (fileSystemManager == null) {
            try {
                StandardFileSystemManager fm = new StandardFileSystemManager();
                fm.setCacheStrategy(CacheStrategy.MANUAL);
                fm.init();
                fileSystemManager = fm;
            } catch (Exception exc) {
                throw new RuntimeException(exc);
            }
        }

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

From source file:org.docx4j.extras.vfs.VFSUtils.java

public static FileSystemManager getFileSystemManager() {
    aLock.readLock().lock();//from w  w  w .  j a  v  a2  s  .c  o m

    try {
        if (fileSystemManager == null) {
            try {
                StandardFileSystemManager fm = new StandardFileSystemManager();
                fm.setCacheStrategy(CacheStrategy.MANUAL);
                fm.init();
                fileSystemManager = fm;
            } catch (Exception exc) {
                throw new RuntimeException(exc);
            }
        }

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