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

com.testvagrant.optimuscloud.utils.JsonUtil Maven / Gradle / Ivy

Go to download

The Java Client provides access to Optimus cloud for all java based projects.

There is a newer version: 1.1.0
Show newest version
/*
 * Copyright (c) 2017.  TestVagrant Technologies
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 */

package com.testvagrant.optimuscloud.utils;

import org.apache.commons.io.IOUtils;
import org.json.JSONObject;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;


public class JsonUtil {
    public JSONObject getAppJson(String name) {
        String result1 = "";
        try {
            result1 = IOUtils.toString(new FileInputStream(
                    new File(System.getProperty("user.dir") + "/src/test/resources/"+ name+".json")));
        } catch (IOException e) {
            e.printStackTrace();
        }

        JSONObject result = new JSONObject(result1);
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy