URLReader { @SuppressWarnings("javasecurity:S2083") private String readFile() throws IOException { File file = new File(url); return FileUtils.readFileToString(file, Config.DEFAULT_ENCODING); } URLReader(final URL url);  URLReader(final URI uri); String read();  }
@Test public void testReadFile() throws IOException { File file = new File("src/test/resources", "musterdatei_041222.txt"); URLReader urlReader = new URLReader(file.toURI().toURL()); String content = urlReader.read(); File targetFile = new File("target", "musterdatei_041222.txt"); FileUtils.write(targetFile, content, StandardCharsets.ISO_8859_1); FileTester.assertContentEquals(file, targetFile); }