package seedu.ezdo.storage;

import java.io.IOException;
import java.util.Optional;

import seedu.ezdo.commons.events.model.EzDoChangedEvent;
import seedu.ezdo.commons.events.storage.DataSavingExceptionEvent;
import seedu.ezdo.commons.events.storage.EzDoDirectoryChangedEvent;
import seedu.ezdo.commons.exceptions.DataConversionException;
import seedu.ezdo.model.ReadOnlyEzDo;
import seedu.ezdo.model.UserPrefs;
//@@author A0139248X
/**
 * API of the Storage component
 */
public interface Storage extends EzDoStorage, UserPrefsStorage {

    @Override
    Optional<UserPrefs> readUserPrefs() throws DataConversionException, IOException;

    @Override
    void saveUserPrefs(UserPrefs userPrefs) throws IOException;

    @Override
    String getEzDoFilePath();

    @Override
    void setEzDoFilePath(String path);

    @Override
    Optional<ReadOnlyEzDo> readEzDo() throws DataConversionException, IOException;

    @Override
    void saveEzDo(ReadOnlyEzDo ezDo) throws IOException;

    /**
     * Saves the current version of the EzDo to the hard disk.
     *   Creates the data file if it is missing.
     * Raises {@link DataSavingExceptionEvent} if there was an error during saving.
     */
    void handleEzDoChangedEvent(EzDoChangedEvent ezce);

    /**
     * Changes the current directory of the ezDo
     */
    void handleEzDoDirectoryChangedEvent(EzDoDirectoryChangedEvent ezdce);
}

@@ -535,108 +535,616 @@
 e %7B%0A
-%0A    @Override%0A    Optional%3CUserPrefs%3E readUserPrefs() throws DataConversionException, IOException;%0A
+    /**%0A     * Read the UserPrefs data from Storage%0A     * Returns %7B@code Optional.empty()%7D if storage file is not found.%0A     * @throws DataConversionException if the data in storage is not in the expected format.%0A     * @throws IOException if there was any problem when reading from the storage.%0A     */%0A    @Override%0A    Optional%3CUserPrefs%3E readUserPrefs() throws DataConversionException, IOException;%0A%0A    /**%0A     * Saves the given %7B@link seedu.ezdo.model.UserPrefs%7D to the storage.%0A     * @param userPrefs cannot be null.%0A     * @throws IOException if there was any problem writing to the file.%0A     */
 %0A   
@@ -1211,32 +1211,73 @@
 s IOException;%0A%0A
+    /** Returns the file path of EzDo */%0A
     @Override%0A  
@@ -1313,155 +1313,733 @@
     
-@Override%0A    void setEzDoFilePath(String path);%0A%0A    @Override%0A    Optional%3CReadOnlyEzDo%3E readEzDo() throws DataConversionException, IOException;%0A
+/** Sets the file path of EzDo%0A     * @param path cannot be null.%0A     */%0A    @Override%0A    void setEzDoFilePath(String path);%0A%0A    /**%0A     * Returns EzDo data as a %7B@link ReadOnlyEzDo%7D.%0A     *   Returns %7B@code Optional.empty()%7D if storage file is not found.%0A     * @throws DataConversionException if the data in storage is not in the expected format.%0A     * @throws IOException if there was any problem when reading from the storage.%0A     */%0A    @Override%0A    Optional%3CReadOnlyEzDo%3E readEzDo() throws DataConversionException, IOException;%0A%0A    /**%0A     * Saves the given %7B@link ReadOnlyEzDo%7D to the storage.%0A     * @param ezDo cannot be null.%0A     * @throws IOException if there was any problem writing to the file.%0A     */
 %0A   
@@ -2429,24 +2429,108 @@
 of the ezDo%0A
+     * Raises %7B@link DataSavingExceptionEvent%7D if there was an error during saving.%0A
      */%0A    

Update comments