Example usage for org.openqa.selenium.json JsonOutput write

List of usage examples for org.openqa.selenium.json JsonOutput write

Introduction

In this page you can find the example usage for org.openqa.selenium.json JsonOutput write.

Prototype

public JsonOutput write(Object value) 

Source Link

Usage

From source file:io.appium.java_client.remote.NewAppiumSessionPayload.java

License:Apache License

private void writeMetaData(JsonOutput out) throws IOException {
    CharSource charSource = backingStore.asByteSource().asCharSource(UTF_8);
    try (Reader reader = charSource.openBufferedStream(); JsonInput input = json.newInput(reader)) {
        input.beginObject();//  w w w . j  av a  2 s .co m
        while (input.hasNext()) {
            String name = input.nextName();
            switch (name) {
            case CAPABILITIES:
            case DESIRED_CAPABILITIES:
            case REQUIRED_CAPABILITIES:
                input.skipValue();
                break;

            default:
                out.name(name);
                out.write(input.read(Object.class));
                break;
            }
        }
    }
}