Example usage for org.apache.commons.vfs FileSystemManagerWrapper resolveFile

List of usage examples for org.apache.commons.vfs FileSystemManagerWrapper resolveFile

Introduction

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

Prototype

@Override
public FileObject resolveFile(final String name) throws FileSystemException 

Source Link

Usage

From source file:org.kalypso.simulation.grid.TestSimpleGridProcess.java

public void testGridProcess() throws Exception {
    final String processFactoryId = "org.kalypso.simulation.gridprocess";
    System.setProperty("GLOBUS_LOCATION", "d:/workspace3.4/org.globus.ws.core");
    final String sandboxRoot = "testRma";

    final FileSystemManagerWrapper manager = VFSUtilities.getNewManager();

    final String rmaName = "RMA10Sk_35";

    final IProcess process = KalypsoCommonsExtensions.createProcess(processFactoryId, sandboxRoot, rmaName);
    process.environment().put("OMP_NUM_THREADS", "4");

    final String sandboxDirectory = process.getSandboxDirectory();
    final FileObject workingDir = manager.resolveFile(sandboxDirectory);
    copyFileToWorking(manager, workingDir, rmaName);
    copyFileToWorking(manager, workingDir, "model.2d");
    copyFileToWorking(manager, workingDir, "control.r10");

    process.startProcess(System.out, System.err, null, null);

    final FileObject resultFile = workingDir.resolveFile("A0001.2d");
    if (!resultFile.exists())
        fail("Result was not created!");

    manager.close();//from  ww  w.j a  v  a 2 s.  co m
}