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

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

Introduction

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

Prototype

public FileObject resolveFile(final String uri) throws FileSystemException 

Source Link

Document

Locates a file by URI.

Usage

From source file:org.ofbiz.commons.vfs.CommonsVfsContainer.java

public boolean start() throws ContainerException {
    try {/*from w w w  .ja  v a2 s.c om*/
        StandardFileSystemManager sfsm = VFSUtil.createStandardFileSystemManager();
        FileObject currentDir = sfsm.resolveFile(new File(".").toURI().toURL().toString());
        sfsm.setBaseFile(currentDir);
        CommonsVfsContainer.sfsm = sfsm;
    } catch (FileSystemException e) {
        throw (ContainerException) new ContainerException("Initializing StandardFileSystemManager")
                .initCause(e);
    } catch (MalformedURLException e) {
        throw (ContainerException) new ContainerException("Initializing StandardFileSystemManager")
                .initCause(e);
    }
    return true;
}