(String dir, String fileName, String content)
| 524 | } |
| 525 | |
| 526 | public static void writeFile(String dir, String fileName, String content) { |
| 527 | try { |
| 528 | File f = new File(dir, fileName); |
| 529 | if ( !f.getParentFile().exists() ) f.getParentFile().mkdirs(); |
| 530 | FileWriter w = new FileWriter(f); |
| 531 | BufferedWriter bw = new BufferedWriter(w); |
| 532 | bw.write(content); |
| 533 | bw.close(); |
| 534 | w.close(); |
| 535 | } |
| 536 | catch (IOException ioe) { |
| 537 | System.err.println("can't write file"); |
| 538 | ioe.printStackTrace(System.err); |
| 539 | } |
| 540 | } |
| 541 | } |