Search in sources :

Example 1 with ContextBuilder

use of org.locationtech.geogig.api.ContextBuilder in project GeoGig by boundlessgeo.

the class GlobalState method setupGeogig.

public static void setupGeogig() throws Exception {
    assertNotNull(platform);
    stdIn = new ByteArrayInputStream(new byte[0]);
    stdOut = new ByteArrayOutputStream();
    if (GlobalState.consoleReader != null) {
        GlobalState.consoleReader.shutdown();
    }
    // GlobalState.consoleReader = new ConsoleReader(stdIn,
    // new TeeOutputStream(stdOut, System.err), new UnsupportedTerminal());
    GlobalState.consoleReader = new ConsoleReader(stdIn, stdOut, new UnsupportedTerminal());
    ContextBuilder injectorBuilder = new CLITestContextBuilder(platform);
    Context injector = injectorBuilder.build();
    if (geogigCLI != null) {
        geogigCLI.close();
    }
    geogigCLI = new GeogigCLI(GlobalState.consoleReader);
    GlobalContextBuilder.builder = injectorBuilder;
    Platform platform = injector.platform();
    geogigCLI.setPlatform(platform);
    geogigCLI.tryConfigureLogging();
}
Also used : Context(org.locationtech.geogig.api.Context) GeogigCLI(org.locationtech.geogig.cli.GeogigCLI) ConsoleReader(jline.console.ConsoleReader) TestPlatform(org.locationtech.geogig.api.TestPlatform) Platform(org.locationtech.geogig.api.Platform) ByteArrayInputStream(java.io.ByteArrayInputStream) UnsupportedTerminal(jline.UnsupportedTerminal) ContextBuilder(org.locationtech.geogig.api.ContextBuilder) GlobalContextBuilder(org.locationtech.geogig.api.GlobalContextBuilder) ByteArrayOutputStream(java.io.ByteArrayOutputStream)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 UnsupportedTerminal (jline.UnsupportedTerminal)1 ConsoleReader (jline.console.ConsoleReader)1 Context (org.locationtech.geogig.api.Context)1 ContextBuilder (org.locationtech.geogig.api.ContextBuilder)1 GlobalContextBuilder (org.locationtech.geogig.api.GlobalContextBuilder)1 Platform (org.locationtech.geogig.api.Platform)1 TestPlatform (org.locationtech.geogig.api.TestPlatform)1 GeogigCLI (org.locationtech.geogig.cli.GeogigCLI)1