@Test public void testWriteFile() throws IOException { File tmpFile = File.createTempFile("ot-unit-test-write", ".txt"); String content = "write" + System.lineSeparator() + "output file" + System.lineSeparator() + "Test's out" + System.lineSeparator(); FileUtil.writeFile(tmpFile.getAbsolutePath(), content); String written = FileUtil.readFile(tmpFile.getAbsolutePath()); Assert.assertEquals(content, written); }
public static void writeFile(String filename, String content) { BufferedWriter writer; try { writer = new BufferedWriter(new FileWriter(filename)); writer.write(content); writer.close(); } catch (IOException ioe) { String msg = "Cannot access file [" + filename + "]."; _log.error(ioe, ioe); throw new InvalidImplementationException(msg, ioe); } }
FileUtil { public static void writeFile(String filename, String content) { BufferedWriter writer; try { writer = new BufferedWriter(new FileWriter(filename)); writer.write(content); writer.close(); } catch (IOException ioe) { String msg = "Cannot access file [" + filename + "]."; _log.error(ioe, ioe); throw new InvalidImplementationException(msg, ioe); } } }
FileUtil { public static void writeFile(String filename, String content) { BufferedWriter writer; try { writer = new BufferedWriter(new FileWriter(filename)); writer.write(content); writer.close(); } catch (IOException ioe) { String msg = "Cannot access file [" + filename + "]."; _log.error(ioe, ioe); throw new InvalidImplementationException(msg, ioe); } } private  FileUtil(); }
FileUtil { public static void writeFile(String filename, String content) { BufferedWriter writer; try { writer = new BufferedWriter(new FileWriter(filename)); writer.write(content); writer.close(); } catch (IOException ioe) { String msg = "Cannot access file [" + filename + "]."; _log.error(ioe, ioe); throw new InvalidImplementationException(msg, ioe); } } private  FileUtil(); static String readFile(File file); static String readFile(String filename); static byte[] readFileAsBytes(File file); static byte[] readFileAsBytes(String filename); static String backupFile(File source); static InputStream getFileStream(String name); static void writeFile(String filename, String content); static void appendFile(String filename, String content); static File createDirectory(String path); static boolean copyMultipartFile(final MultipartFile multipartFile,
			File dest); static Properties readProperty(File f); static void saveProperty(String filename, Properties properties, String header); static String getFilename(String filepath); }
FileUtil { public static void writeFile(String filename, String content) { BufferedWriter writer; try { writer = new BufferedWriter(new FileWriter(filename)); writer.write(content); writer.close(); } catch (IOException ioe) { String msg = "Cannot access file [" + filename + "]."; _log.error(ioe, ioe); throw new InvalidImplementationException(msg, ioe); } } private  FileUtil(); static String readFile(File file); static String readFile(String filename); static byte[] readFileAsBytes(File file); static byte[] readFileAsBytes(String filename); static String backupFile(File source); static InputStream getFileStream(String name); static void writeFile(String filename, String content); static void appendFile(String filename, String content); static File createDirectory(String path); static boolean copyMultipartFile(final MultipartFile multipartFile,
			File dest); static Properties readProperty(File f); static void saveProperty(String filename, Properties properties, String header); static String getFilename(String filepath);  }