Read Json File using JAVA

public static final String SRC_MAIN_RESOURCES = "src/main/resources/";

final String actualResponse = readFileAsString(SRC_MAIN_RESOURCES + "MenuItems.json").trim();

 private static String readFileAsString(String file) throws Exception {

        return new String(Files.readAllBytes(Paths.get(file)));

 } 

Post a Comment

Previous Post Next Post