- private void saveToFile() {
- Collection<Film> filmCollection = database.values();
- for(Film film : filmCollection) {
- try {
- FileWriter outFile = new FileWriter("c:/pmdb/database.txt");
- PrintWriter out = new PrintWriter(outFile);
- out.println(film.toString());
- out.close();
- } catch (IOException e){
- e.printStackTrace();
- }
- }
- }