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

net.k3nder.core.JsonUtils Maven / Gradle / Ivy

The newest version!
package net.k3nder.core;


import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.net.ConnectException;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;


public class JsonUtils {

    public static String getJsonVersion(String url) {
        StringBuilder jsonString = new StringBuilder();
        try {
            URL urlReform = new URL(url);
            BufferedReader reader = new BufferedReader(new InputStreamReader(urlReform.openStream()));
            jsonString = new StringBuilder();
            jsonString = new StringBuilder();
            String line;
            while ((line = reader.readLine()) != null) {
                jsonString.append(line);
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return jsonString.toString();
    }
}



    





© 2015 - 2025 Weber Informatics LLC | Privacy Policy