Applies this JsonPath to the provided json file

@param jsonFile file to read from
@param <T>      expected return type
@return list of objects matched by the given path
@throws IOException
547882
@SuppressWarnings({"unchecked"})
    public <T> T read(File jsonFile) throws IOException {
        return read(jsonFile, Configuration.defaultConfiguration());
    }
511409
def read_json(filepath, intkeys=True, intvalues=True):
    
    d = json.load(ensure_open(find_filepath(filepath), mode='rt'))
    d = update_dict_types(d, update_keys=intkeys, update_values=intvalues)
    return d
496961
protected String readJsonFrom(final InputStream json) throws IOException {
        return isJsonFormat()
            ? JsonValue.readHjson(IOUtils.toString(json, StandardCharsets.UTF_8)).toString()
            : String.join("\n", IOUtils.readLines(json, StandardCharsets.UTF_8));
    }
1336555
public static ClassFileReader newInstance(Path path, JarFile jf) throws IOException {
        return new JarFileReader(path, jf);
    }
1031008
public static String buildPath(JsonPath jsonPath) {
        List<String> urlParts = new LinkedList<>();

        JsonPath currentJsonPath = jsonPath;
        String pathPart;
        do {
            if (currentJsonPath instanceof RelationshipsPath) {
                pathPart = RELATIONSHIP_MARK + SEPARATOR + currentJsonPath.getElementName();
            } else if (currentJsonPath instanceof FieldPath) {
                pathPart = currentJsonPath.getElementName();
            } else {
                pathPart = currentJsonPath.getElementName();
                if (currentJsonPath.getIds() != null) {
                    pathPart += SEPARATOR + mergeIds(currentJsonPath.getIds());
                }
            }
            urlParts.add(pathPart);

            currentJsonPath = currentJsonPath.getParentResource();
        } while (currentJsonPath != null);
        Collections.reverse(urlParts);

        return SEPARATOR + StringUtils.join(SEPARATOR, urlParts) + SEPARATOR;
    }
121555
public static JSONObject readJSONObject(File file, Charset charset) throws IORuntimeException {
		return parseObj(FileReader.create(file, charset).readString());
	}
94792
@SuppressWarnings("unchecked")
    public <T> T collectOne(InputStream inputStream, Class<T> tClass, JsonPath... paths) {
        CollectOneListener listener = new CollectOneListener(true);
        SurfingConfiguration.Builder builder = configBuilder().skipOverlappedPath();
        for (JsonPath jsonPath : paths) {
            builder.bind(jsonPath, listener);
        }
        surf(inputStream, builder.build());
        Object value = listener.getValue();
        return tClass.cast(jsonProvider.cast(value, tClass));
    }
845150
@SuppressWarnings({"unchecked"})
    public <T> T read(URL jsonURL) throws IOException {
        return read(jsonURL, Configuration.defaultConfiguration());
    }
670840
def _write_jsonl(filepath, data, kwargs):
    """"""
    with io_stl.open(filepath, 'w', encoding='utf8') as outfile:
        kwargs['indent'] = None  # JSON has to be on one line!
        if 'sort_keys' not in kwargs:
            kwargs['sort_keys'] = True
        if 'separators' not in kwargs:
            kwargs['separators'] = (',', ': ')
        if 'ensure_ascii' not in kwargs:
            kwargs['ensure_ascii'] = False
        for line in data:
            str_ = json.dumps(line, **kwargs)
            outfile.write(to_unicode(str_))
            outfile.write(u'\n')
    return data
232031
public static String[] readListFile( URL listFile )
        throws IOException
    {
        ArrayList<String> list = new ArrayList<String>();
        InputStream stream = listFile.openStream();
        try
        {
            InputStreamReader isr = new InputStreamReader( stream, "UTF-8" );
            BufferedReader reader = new BufferedReader( isr );
            String line = reader.readLine();
            while( line != null )
            {
                list.add( line );
                line = reader.readLine();
            }
            String[] items = new String[list.size()];
            list.toArray( items );
            return items;
        }
        finally
        {
            stream.close();
        }
    }
398072
JsonNode readCacheFile()
  {
    if (cacheFile == null || !this.checkCacheLockFile())
    {
      // no cache or the cache is not valid.
      return null;
    }
    try
    {
      if (!cacheFile.exists())
      {
        LOGGER.debug(
            "Cache file doesn't exists. File: {}", cacheFile);
        return null;
      }

      try (Reader reader = new InputStreamReader(
          new FileInputStream(cacheFile), DEFAULT_FILE_ENCODING))
      {
        return OBJECT_MAPPER.readTree(reader);
      }
    }
    catch (IOException ex)
    {
      LOGGER.debug(
          "Failed to read the cache file. No worry. File: {}, Err: {}",
          cacheFile, ex);
    }
    return null;
  }
1131787
private File getTargetFile(File sourceFile, OutputFormat selectedOutputFormat) throws IOException {

    File sourceDirectory = getSourceDirectory();
    String relativePath = StringUtils.substringAfter(sourceFile.getAbsolutePath(), sourceDirectory.getAbsolutePath());
    String relativeTargetPath = FileUtils.removeExtension(relativePath) + "." + selectedOutputFormat.getFileExtension();

    File jsonFile = new File(getGeneratedResourcesFolder().getPath() + relativeTargetPath);

    jsonFile = jsonFile.getCanonicalFile();

    File parentDirectory = jsonFile.getParentFile();
    if (!parentDirectory.exists()) {
      parentDirectory.mkdirs();
      buildContext.refresh(parentDirectory);
    }

    return jsonFile;
  }
1254468
public static File toJsonFile(String jsonString, File returnJsonFile) {
        try {
            jsonMapper.writeValue(returnJsonFile, jsonString);
            return returnJsonFile;
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndReturnNull(log, e,
                    "toJsonFile", jsonString);
        }
    }
622142
public String apply(final JsonParser jp) throws IOException {
        return apply(jp, CacheScope.APPLICATION_SCOPE, null);
    }
1206645
public static <T> List<T> loadJsonValues(File json, Class<T> clazz) throws IOException {
        List<T> answer = new ArrayList<>();
        if (json.exists() && json.isFile()) {
            MappingIterator<T> iter = objectMapper.readerFor(clazz).readValues(json);
            while (iter.hasNext()) {
                answer.add(iter.next());
            }
        }
        return answer;
    }
501244
public List<Object> getAllJsonPath(String json, String jsonPath) {
        List<Object> result;
        if (JsonPath.isPathDefinite(jsonPath)) {
            Object val = getJsonPath(json, jsonPath);
            if (val == null) {
                result = Collections.emptyList();
            } else {
                result = Collections.singletonList(val);
            }
        } else {
            result = parseJson(json).read(jsonPath);
        }
        return result;
    }
373837
public static StorageConfiguration deserialize(final File pFile) throws TTIOException {
        try {
            FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName()));
            JsonReader jsonReader = new JsonReader(fileReader);
            jsonReader.beginObject();
            jsonReader.nextName();
            File file = new File(jsonReader.nextString());
            jsonReader.endObject();
            jsonReader.close();
            fileReader.close();
            return new StorageConfiguration(file);
        } catch (IOException ioexc) {
            throw new TTIOException(ioexc);
        }
    }