private static void touchFile(String fileName) { try { FileWriter writer = new FileWriter(fileName); writer.close(); } catch (java.io.IOException e) { Log.exception("touchFile " + fileName, e); } }
/** * php equivalent to file_put_contents * * @param filename * @param content */ public static void filePutContents(String filename, String content) { File outFile = new File(filename); try { FileWriter out = new FileWriter(outFile); out.write(content); out.close(); } catch (Exception e) { System.out.println("error writing " + filename); } }