@Test public void testWrite() throws Exception { FileUtils.write("home","test"); }
public static void write(String path, String content) { try { File f = new File(path); if (!f.exists()) { if (!f.createNewFile()) { System.out.println("Can not create new file " + path); } } BufferedWriter output = new BufferedWriter(new FileWriter(f)); output.write(content); output.close(); } catch (Exception e) { log.error("Exception:",e); } }
FileUtils { public static void write(String path, String content) { try { File f = new File(path); if (!f.exists()) { if (!f.createNewFile()) { System.out.println("Can not create new file " + path); } } BufferedWriter output = new BufferedWriter(new FileWriter(f)); output.write(content); output.close(); } catch (Exception e) { log.error("Exception:",e); } } }
FileUtils { public static void write(String path, String content) { try { File f = new File(path); if (!f.exists()) { if (!f.createNewFile()) { System.out.println("Can not create new file " + path); } } BufferedWriter output = new BufferedWriter(new FileWriter(f)); output.write(content); output.close(); } catch (Exception e) { log.error("Exception:",e); } }  }
FileUtils { public static void write(String path, String content) { try { File f = new File(path); if (!f.exists()) { if (!f.createNewFile()) { System.out.println("Can not create new file " + path); } } BufferedWriter output = new BufferedWriter(new FileWriter(f)); output.write(content); output.close(); } catch (Exception e) { log.error("Exception:",e); } }  static void write(String path, String content); }
FileUtils { public static void write(String path, String content) { try { File f = new File(path); if (!f.exists()) { if (!f.createNewFile()) { System.out.println("Can not create new file " + path); } } BufferedWriter output = new BufferedWriter(new FileWriter(f)); output.write(content); output.close(); } catch (Exception e) { log.error("Exception:",e); } }  static void write(String path, String content);  }