All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cardanofoundation.conversions.utils.MoreJson Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package org.cardanofoundation.conversions.utils;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.io.IOException;
import java.io.InputStream;
import org.cardanofoundation.conversions.ConversionRuntimeException;

public class MoreJson {

  public static ObjectNode parseJson(ObjectMapper objectMapper, InputStream is) {
    ObjectNode jsonNode;
    try {
      jsonNode = (ObjectNode) objectMapper.readTree(is);
    } catch (IOException e) {
      throw new ConversionRuntimeException("Error parsing shelley genesis file", e);
    }

    return jsonNode;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy