@Override
	public void write(String currentDVDFile, String masterDVDFile)
			throws FatalBackEndException {
		FileWriter cdf, mdf;
		try {
			cdf = new FileWriter(currentDVDFile);
		} catch (IOException ex) {
			throw new FatalBackEndException(ex.getMessage(),
					FileType.CurrentDVD, currentDVDFile);
		}

		try {
			mdf = new FileWriter(masterDVDFile);
		} catch (IOException ex) {
			try {
				cdf.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
			throw new FatalBackEndException(ex.getMessage(),
					FileType.NewMasterDVD, masterDVDFile);
		}

		TreeMap<Integer, MasterDVD> sorted_list = new TreeMap<Integer, MasterDVD>();
		Iterator<MasterDVD> iter = masterList.values().iterator();
		while (iter.hasNext()) {
			MasterDVD temp = iter.next();
			sorted_list.put(temp.getId(), temp);
		}

		try {
			for (Integer i : sorted_list.keySet()) {
				MasterDVD mdvd = sorted_list.get(i);
				try {
					mdf.write(mdvd.toString() + "\n");
				} catch (IOException e1) {
					throw new FatalBackEndException(e1.getMessage(),
							FileType.NewMasterDVD, masterDVDFile);
				}
				try {
					cdf.write(mdvd.get_cdvd().toString() + "\n");
				} catch (IOException e) {
					throw new FatalBackEndException(e.getMessage(),
							FileType.CurrentDVD, currentDVDFile);
				}
			}
		} finally {
			try {
				mdf.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
			try {
				cdf.close();
			} catch (IOException ex) {
				ex.printStackTrace();
			}
		}
	}