@Test public void is_able_to_save_a_temporary_file() throws Exception { File file = new File(System.getProperty("java.io.tmpdir")); File subFolder = new File(file, "subFolder"); File targetFile = new File(subFolder, "targetFile"); targetFile.deleteOnExit(); writerToTest.save(targetFile, "text"); assertTrue(targetFile.exists()); try (BufferedReader br = new BufferedReader(new FileReader(targetFile))) { String line = br.readLine(); assertEquals("text", line); } }
public void save(File targetFile, String origin) throws IOException { save(targetFile, origin, true); }
TextFileWriter { public void save(File targetFile, String origin) throws IOException { save(targetFile, origin, true); } }
TextFileWriter { public void save(File targetFile, String origin) throws IOException { save(targetFile, origin, true); } TextFileWriter(); }
TextFileWriter { public void save(File targetFile, String origin) throws IOException { save(targetFile, origin, true); } TextFileWriter(); void addMissingHeaders(File targetFile); void save(File targetFile, String origin); void save(File targetFile, String origin, boolean overwrite); }
TextFileWriter { public void save(File targetFile, String origin) throws IOException { save(targetFile, origin, true); } TextFileWriter(); void addMissingHeaders(File targetFile); void save(File targetFile, String origin); void save(File targetFile, String origin, boolean overwrite);  }