public static void writeReport(String filename, String data) throws IOException { String absoluteFilename = getAbsoluteFileName(filename); File f = new File(absoluteFilename); File parent = f.getParentFile(); parent.mkdirs(); // ensure parent dir exists // write file FileOutputStream fos = new FileOutputStream(f, true); // append BufferedOutputStream bos = new BufferedOutputStream(fos); PrintStream ps = new PrintStream(bos); ps.println(data); ps.close(); bos.close(); fos.close(); }
public static void writeReport(String filename, String data) throws IOException { String absoluteFilename = getAbsoluteFileName(filename); File f = new File(absoluteFilename); File parent = f.getParentFile(); parent.mkdirs(); // ensure parent dir exists // write file FileOutputStream fos = new FileOutputStream(f, true); // append BufferedOutputStream bos = new BufferedOutputStream(fos); PrintStream ps = new PrintStream(bos); ps.println(data); ps.close(); bos.close(); fos.close(); }
public static void writeReport(String filename, String data) throws IOException { String absoluteFilename = getAbsoluteFileName(filename); File f = new File(absoluteFilename); File parent = f.getParentFile(); parent.mkdirs(); // ensure parent dir exists // write file FileOutputStream fos = new FileOutputStream(f, true); // append BufferedOutputStream bos = new BufferedOutputStream(fos); PrintStream ps = new PrintStream(bos); ps.println(data); ps.close(); bos.close(); fos.close(); }
public static void writeReport(String filename, String data) throws IOException { String absoluteFilename = getAbsoluteFileName(filename); File f = new File(absoluteFilename); File parent = f.getParentFile(); parent.mkdirs(); // ensure parent dir exists // write file FileOutputStream fos = new FileOutputStream(f, true); // append BufferedOutputStream bos = new BufferedOutputStream(fos); PrintStream ps = new PrintStream(bos); ps.println(data); ps.close(); bos.close(); fos.close(); }
public static void writeReport(String filename, String data) throws IOException { String absoluteFilename = getAbsoluteFileName(filename); File f = new File(absoluteFilename); File parent = f.getParentFile(); parent.mkdirs(); // ensure parent dir exists // write file FileOutputStream fos = new FileOutputStream(f, true); // append BufferedOutputStream bos = new BufferedOutputStream(fos); PrintStream ps = new PrintStream(bos); ps.println(data); ps.close(); bos.close(); fos.close(); }
public static void writeReport(String filename, String data) throws IOException { String absoluteFilename = getAbsoluteFileName(filename); File f = new File(absoluteFilename); File parent = f.getParentFile(); parent.mkdirs(); // ensure parent dir exists // write file FileOutputStream fos = new FileOutputStream(f, true); // append BufferedOutputStream bos = new BufferedOutputStream(fos); PrintStream ps = new PrintStream(bos); ps.println(data); ps.close(); bos.close(); fos.close(); }