Example usage for org.apache.commons.vfs.impl DefaultFileSystemManager addProvider

List of usage examples for org.apache.commons.vfs.impl DefaultFileSystemManager addProvider

Introduction

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

Prototype

public void addProvider(final String[] urlSchemes, final FileProvider provider) throws FileSystemException 

Source Link

Document

Registers a file system provider.

Usage

From source file:org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalogHelper.java

public MondrianCatalogHelper(boolean useLegacyDbName) {
    super();//from w  w w.j  ava  2 s.c  o m
    this.useLegacyDbName = useLegacyDbName;

    try {
        DefaultFileSystemManager dfsm = (DefaultFileSystemManager) VFS.getManager();
        dfsm.addProvider("mondrian", new MondrianVfs()); //$NON-NLS-1$
    } catch (FileSystemException e) {
        logger.error(e.getMessage());
    }
}

From source file:org.pentaho.platform.plugin.action.olap.impl.OlapServiceImpl.java

/**
 * Constructor for testing purposes. Takes a repository as a parameter.
 *///from www .ja  v  a  2 s.c  o m
public OlapServiceImpl(IUnifiedRepository repo, final MondrianServer server) {
    this.repository = repo;
    this.filters = new CopyOnWriteArrayList<IOlapConnectionFilter>();
    this.server = server;

    try {
        DefaultFileSystemManager dfsm = (DefaultFileSystemManager) VFS.getManager();
        if (dfsm.hasProvider("mondrian") == false) {
            dfsm.addProvider("mondrian", new MondrianVfs());
        }
    } catch (FileSystemException e) {
        throw new RuntimeException(e);
    }
}

From source file:org.pentaho.platform.web.servlet.PentahoXmlaServlet.java

public PentahoXmlaServlet() {
    super();//  w ww.j  av  a 2  s.  c o m
    if (!cacheMgr.cacheEnabled(CACHE_REGION)) {
        cacheMgr.addCacheRegion(CACHE_REGION);
    }
    repo = PentahoSystem.get(IUnifiedRepository.class);
    mondrianCatalogService = (MondrianCatalogHelper) PentahoSystem.get(IMondrianCatalogService.class);
    try {
        DefaultFileSystemManager dfsm = (DefaultFileSystemManager) VFS.getManager();
        if (!dfsm.hasProvider("mondrian")) {
            dfsm.addProvider("mondrian", new MondrianVfs());
        }
    } catch (FileSystemException e) {
        logger.error(e.getMessage());
    }
}

From source file:pt.webdetails.di.baserver.utils.repositoryPlugin.RepositoryPlugin.java

public RepositoryPlugin(DefaultFileSystemManager fileSystemManager) {
    this.forceLibPensolPropertiesLoad();

    // if no file system manager is specified used the one from Kettle VFS
    if (fileSystemManager == null) {
        fileSystemManager = this.getKettleVFSFileSystemManager();
    }/*from ww w.j a v  a  2 s  . c o m*/

    this.setFileSystemManager(fileSystemManager);

    String vfsScheme = this.getConstants().getVfsScheme();
    if (fileSystemManager != null && !fileSystemManager.hasProvider(vfsScheme)) {
        try {
            fileSystemManager.addProvider(vfsScheme, new PentahoSolutionFileProvider());
        } catch (FileSystemException e) {
            this.getLogger().error("Error trying to add Pentaho Solution File provider.", e);
        }
    }

    this.registerJCRFileChooserDialog();

    this.setToolbarController(new ToolbarController());
    final RepositoryPlugin repositoryPlugin = this;
    this.lifecycleListener = new SpoonLifecycleListener() {
        @Override
        public void onEvent(SpoonLifeCycleEvent evt) {
            repositoryPlugin.getToolbarController().getSpoonLifeCycleListener().onEvent(evt);
        }
    };

}