Example usage for org.apache.commons.vfs2.impl DefaultFileSystemManager getReplicator

List of usage examples for org.apache.commons.vfs2.impl DefaultFileSystemManager getReplicator

Introduction

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

Prototype

public FileReplicator getReplicator() throws FileSystemException 

Source Link

Document

Returns the file replicator.

Usage

From source file:org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader.java

public static void close() {
    for (WeakReference<DefaultFileSystemManager> vfsInstance : vfsInstances) {
        DefaultFileSystemManager ref = vfsInstance.get();
        if (ref != null) {
            FileReplicator replicator;//from   www  .j  a  v  a 2 s. c o m
            try {
                replicator = ref.getReplicator();
                if (replicator instanceof UniqueFileReplicator) {
                    ((UniqueFileReplicator) replicator).close();
                }
            } catch (FileSystemException e) {
                log.error("FileSystemException", e);
            }
            ref.close();
        }
    }
    try {
        FileUtils.deleteDirectory(computeTopCacheDir());
    } catch (IOException e) {
        log.error("IOException", e);
    }
}