(String dir, String fileName, String content)
| 531 | } |
| 532 | |
| 533 | public static void writeFile(String dir, String fileName, String content) { |
| 534 | try { |
| 535 | File f = new File(dir, fileName); |
| 536 | if ( !f.getParentFile().exists() ) f.getParentFile().mkdirs(); |
| 537 | FileWriter w = new FileWriter(f); |
| 538 | BufferedWriter bw = new BufferedWriter(w); |
| 539 | bw.write(content); |
| 540 | bw.close(); |
| 541 | w.close(); |
| 542 | } |
| 543 | catch (IOException ioe) { |
| 544 | System.err.println("can't write file"); |
| 545 | ioe.printStackTrace(System.err); |
| 546 | } |
| 547 | } |
| 548 | } |