Here you can find the source of readSampleJson(String name)
static JsonNode readSampleJson(String name)
//package com.java2s; //License from project: Open Source License import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.net.URL; public class Main { static JsonNode readSampleJson(String name) { URL jsonUrl = Thread.currentThread().getContextClassLoader().getResource(name); ObjectMapper mapper = new ObjectMapper(); try {//from www . j a v a2 s.c o m return mapper.readValue(jsonUrl, JsonNode.class); } catch (IOException e) { throw new IllegalStateException(e); } } }