@Test public void testSaveToFile() throws IOException { FileUtils utils = new FileUtils(); Path destPath = Paths.get("fileUtilTest.txt"); utils.saveToFile("foo", destPath); assertThat(destPath).exists().isReadable().hasContent("foo\n"); Files.deleteIfExists(destPath); }
public void saveToFile(final String text, final Path destPath) throws IOException { try (PrintWriter out = new PrintWriter( Files.newBufferedWriter(destPath, StandardCharsets.UTF_8))) { out.println(text); out.flush(); } }
FileUtils { public void saveToFile(final String text, final Path destPath) throws IOException { try (PrintWriter out = new PrintWriter( Files.newBufferedWriter(destPath, StandardCharsets.UTF_8))) { out.println(text); out.flush(); } } }
FileUtils { public void saveToFile(final String text, final Path destPath) throws IOException { try (PrintWriter out = new PrintWriter( Files.newBufferedWriter(destPath, StandardCharsets.UTF_8))) { out.println(text); out.flush(); } }  }
FileUtils { public void saveToFile(final String text, final Path destPath) throws IOException { try (PrintWriter out = new PrintWriter( Files.newBufferedWriter(destPath, StandardCharsets.UTF_8))) { out.println(text); out.flush(); } }  void saveToFile(final String text, final Path destPath); static boolean isSubPath(File parent, File child); static boolean isSubPath(org.apache.hadoop.fs.Path parent, org.apache.hadoop.fs.Path child); }
FileUtils { public void saveToFile(final String text, final Path destPath) throws IOException { try (PrintWriter out = new PrintWriter( Files.newBufferedWriter(destPath, StandardCharsets.UTF_8))) { out.println(text); out.flush(); } }  void saveToFile(final String text, final Path destPath); static boolean isSubPath(File parent, File child); static boolean isSubPath(org.apache.hadoop.fs.Path parent, org.apache.hadoop.fs.Path child);  }