Example usage for org.apache.commons.vfs.cache WeakRefFilesCache WeakRefFilesCache

List of usage examples for org.apache.commons.vfs.cache WeakRefFilesCache WeakRefFilesCache

Introduction

In this page you can find the example usage for org.apache.commons.vfs.cache WeakRefFilesCache WeakRefFilesCache.

Prototype

WeakRefFilesCache

Source Link

Usage

From source file:org.pentaho.di.core.vfs.KettleVFS.java

private KettleVFS() {
    fsm = new StandardFileSystemManager();
    try {//from   www . jav  a 2  s  .c  o  m
        fsm.setFilesCache(new WeakRefFilesCache());
        fsm.init();
    } catch (FileSystemException e) {
        e.printStackTrace();
    }

    // Install a shutdown hook to make sure that the file system manager is closed
    // This will clean up temporary files in vfs_cache
    Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
        @Override
        public void run() {
            if (fsm != null) {
                fsm.close();
            }
        }
    }));
}