- private String getFileContentAsString(String resourceName) throws IOException {
- URL url = this.getClass().getClassLoader().getResource(".");
- Path path = Paths.get(url.getPath(), "payload_jsons", resourceName);
- return new String(Files.readAllBytes(path));
+ private String getFileContentAsString(String resourceName) throws Exception {
+ Path path = Paths.get("payload_jsons", resourceName);
+ URL url = this.getClass().getClassLoader().getResource(path.toString());
+ return IOUtils.toString(url.toURI(), "UTF-8");