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

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

Introduction

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

Prototype

StandardFileSystemManager

Source Link

Usage

From source file:org.codehaus.cargo.util.VFSFileHandlerTest.java

/**
 * Creates the various file system and handler attributes. {@inheritDoc}
 * @throws Exception If anything goes wrong.
 *//*from   ww w .j a v a2s  .  c om*/
@Override
protected void setUp() throws Exception {
    super.setUp();

    this.fsManager = new StandardFileSystemManager();
    this.fsManager.init();
    this.fileHandler = new VFSFileHandler(this.fsManager);
}

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

public static FileSystemManager getFileSystemManager() {
    aLock.readLock().lock();//from www  .  j  av  a2 s.  com

    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.gatherdata.archiver.dao.vfs.internal.VfsArchiverDao.java

public VfsArchiverDao() {
    fsManager = new StandardFileSystemManager();
    try {// w w  w .  ja va 2s . co m
        fsBase = fsManager.getBaseFile();
    } catch (FileSystemException e) {
        e.printStackTrace();
    }
}

From source file:org.jboss.dashboard.filesystem.VfsWrapper.java

public static StandardFileSystemManager getManager() {
    if (instance == null) {
        instance = new StandardFileSystemManager();
        try {/*from   w  w w  .j a  va  2s .  c om*/
            instance.setCacheStrategy(CacheStrategy.ON_CALL);
            instance.init();
        } catch (Exception e) {
            log.error("Error: ", e);
        }
    }
    return instance;
}

From source file:org.mule.transports.vfs.VFSConnector.java

private FileSystemManager createFileSystemManager() throws FileSystemException {
    StandardFileSystemManager fsm = new StandardFileSystemManager();
    fsm.init();//from  ww w  . ja va2s  .  c  o  m
    return fsm;
}

From source file:org.org.eclipse.core.utils.platform.tools.ArchivesToolBox.java

private static DefaultFileSystemManager createFileSystemManager() throws FileSystemException {
    DefaultFileSystemManager fileSystemManager = new StandardFileSystemManager();
    fileSystemManager.init();//from w  w w.  j a  va2  s  .  c  o m
    return fileSystemManager;
}

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

private KettleVFS() {
    fsm = new StandardFileSystemManager();
    try {/*from  www  . j  a v  a 2s.  c  om*/
        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();
            }
        }
    }));
}