package seedu.ezdo.storage;

import java.io.File;
import java.io.FileNotFoundException;

import javax.xml.bind.JAXBException;

import seedu.ezdo.commons.exceptions.DataConversionException;
import seedu.ezdo.commons.util.XmlUtil;
//@@author A0139248X
/**
 * Stores ezDo data in an XML file
 */
public class XmlFileStorage {
    /**
     * Saves the given ezDo data to the specified file.
     */
    public static void saveDataToFile(File file, XmlSerializableEzDo ezDo)
            throws FileNotFoundException {
        try {
            XmlUtil.saveDataToFile(file, ezDo);
        } catch (JAXBException e) {
            assert false : "Unexpected exception " + e.getMessage();
        }
    }

    /**
     * Returns ezDo in the file or an empty ezDo
     */
    public static XmlSerializableEzDo loadDataFromSaveFile(File file) throws DataConversionException,
                                                                            FileNotFoundException {
        try {
            return XmlUtil.getDataFromFile(file, XmlSerializableEzDo.class);
        } catch (JAXBException e) {
            throw new DataConversionException(e);
        }
    }
}

@@ -380,16 +380,78 @@
 d file.%0A
+     * @throws FileNotFoundException if the file is not found%0A
      */%0A
@@ -524,28 +524,16 @@
 Do ezDo)
-%0A           
  throws 
@@ -744,24 +744,24 @@
  %7D%0A%0A    /**%0A
-
      * Retur
@@ -797,16 +797,173 @@
 ty ezDo%0A
+     * @throws DataConversionException if the file is empty or does not have the correct format.%0A     * @throws FileNotFoundException if the file is missing%0A
      */%0A

Update comments