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

utils.FiletoJson Maven / Gradle / Ivy

package utils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

public class FiletoJson {

    /**
     * Method that reads a Json file and transforms it into a String
     *
     * @param path to the Jsonfile from the root folder: src/test/resources/mymockrequest.json
     * @return String
     * @throws IOException
     */
    public static String convert(String path) throws IOException {
        return new String(Files.readAllBytes(Paths.get(path)));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy