package seedu.task.storage;

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

import javax.xml.bind.JAXBException;

import seedu.task.commons.exceptions.DataConversionException;
import seedu.task.commons.util.XmlUtil;

/**
 * Stores addressbook data in an XML file
 */
public class XmlFileStorage {
    /**
     * Saves the given addressbook data to the specified file.
     */
    public static void saveDataToFile(File file, XmlSerializableTaskManager addressBook)
            throws FileNotFoundException {
        try {
            XmlUtil.saveDataToFile(file, addressBook);
        } catch (JAXBException e) {
            assert false : "Unexpected exception " + e.getMessage();
        }
    }

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

}

@@ -237,27 +237,28 @@
  Stores 
-addressbook
+task manager
  data in
@@ -339,19 +339,20 @@
 ven 
-addressbook
+task manager
  dat
@@ -460,27 +460,27 @@
 Manager 
-addressBook
+taskManager
 )%0A      
@@ -575,19 +575,19 @@
 le, 
-addressBook
+taskManager
 );%0A 
@@ -730,28 +730,28 @@
 Returns 
-address book
+task manager
  in the 
@@ -771,20 +771,20 @@
 pty 
-address book
+task manager
 %0A   

Refactor XmlFileStorage.java methods