Example usage for org.apache.commons.vfs2 CacheStrategy MANUAL

List of usage examples for org.apache.commons.vfs2 CacheStrategy MANUAL

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 CacheStrategy MANUAL.

Prototype

CacheStrategy MANUAL

To view the source code for org.apache.commons.vfs2 CacheStrategy MANUAL.

Click Source Link

Document

Deal with cached data manually.

Usage

From source file:com.googlecode.vfsjfilechooser2.utils.VFSUtils.java

/**
 * Returns the global filesystem manager
 * @return the global filesystem manager
 *//*  w  w w .  j  a v  a2 s . c  om*/
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:de.innovationgate.wgpublisher.design.fs.FileSystemDesignManager.java

public FileSystemDesignManager(WGACore core, WGDatabase db, String path, Map<String, String> options)
        throws WGDesignSyncException, IOException, WGAPIException, InstantiationException,
        IllegalAccessException, InvalidCSConfigVersionException {
    _core = core;/*from  ww  w  .  j av  a2 s .  c om*/

    // Init logger
    if (db.getDbReference().startsWith(PluginConfig.PLUGIN_DBKEY_PREFIX)) {
        _log = Logger.getLogger(LOGGER_DESIGNSYNC_QUIET);
    } else {
        _log = Logger.getLogger(LOGGER_DESIGNSYNC);
    }

    _fsManager = new StandardFileSystemManager();
    _fsManager.setCacheStrategy(CacheStrategy.MANUAL);
    _fsManager.setLogger(new Log4JLogger(Logger.getLogger(LOGGER_DESIGNSYNC_QUIET)));
    _fsManager.setClassLoader(WGACore.getLibraryLoader());
    _fsManager.setCacheStrategy(getVFSCacheStrategy());
    _fsManager.init();

    _designPath = path;
    _designOptions = options;
    _designKey = options.get(OPTION_DESIGNKEY);

    _db = db;

    _directAccessDefault = db.getBooleanAttribute(WGACore.DBATTRIB_DIRECTACCESSDEFAULT, false);

    // Determine provided types
    String optionProviderTypes = (String) db.getCreationOptions().get(WGDatabase.COPTION_DESIGNPROVIDERTYPES);
    if (optionProviderTypes != null) {
        Iterator<String> providerTypes = WGUtils.deserializeCollection(optionProviderTypes, ",", true)
                .iterator();
        while (providerTypes.hasNext()) {
            String providerTypeName = providerTypes.next();
            int providerType = WGDocument.doctypeNameToNumber(providerTypeName);
            if (providerType != 0) {
                _syncedDoctypes.add(new Integer(providerType));
            }
        }
    } else {
        _syncedDoctypes.add(new Integer(WGDocument.TYPE_FILECONTAINER));
        _syncedDoctypes.add(new Integer(WGDocument.TYPE_TML));
        _syncedDoctypes.add(new Integer(WGDocument.TYPE_CSSJS));
    }

    fetchFileSystem(core);
    if (_db.isConnected()) {
        init();
    } else {
        _db.addDatabaseConnectListener(this);
    }

}

From source file:de.innovationgate.wgpublisher.design.sync.DesignSyncManager.java

@Override
protected CacheStrategy getVFSCacheStrategy() {
    return CacheStrategy.MANUAL;
}

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

/**
 * Returns the global filesystem manager
 *
 * @return the global filesystem manager
 *//*from  www .  j  av  a2s.c  om*/
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();
    }
}