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

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

Introduction

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

Prototype


public void setBaseFile(final FileObject baseFile) throws FileSystemException 

Source Link

Document

Sets the base file to use when resolving relative URI.

Usage

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

public boolean start() throws ContainerException {
    try {//  w ww  .ja  v a  2s  . c o m
        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;
}