package seedu.jimi.logic.commands;

/**
 *  
 * @author Wei Yin 
 * 
 * Sets save directory for the tasks and events in Jimi.
 */
public class SaveAsCommand extends Command {

    public static final String COMMAND_WORD = "saveas";

    public static final String MESSAGE_USAGE = COMMAND_WORD + ": Set a new save directory for all your tasks and events in Jimi.\n"
            + "Parameters: FILEPATH/FILENAME.xml \n"
            + "Example: " + COMMAND_WORD
            + " C:/dropbox/taskbook.xml";

    public static final String MESSAGE_SUCCESS = "Save directory changed: %1$s";
    public static final String MESSAGE_DUPLICATE_TASK = "This save directory is originally used in Jimi";

    private String taskBookFilePath;

    /**
     * Convenience constructor using raw values.
     */
    public SaveAsCommand(String filePath)  {
        this.taskBookFilePath = filePath;
    }
    
    @Override
    public CommandResult execute() {
        // TODO Auto-generated method stub
        return null;
    }

}

@@ -29,16 +29,188 @@
 mands;%0A%0A
+import java.util.Optional;%0Aimport seedu.jimi.commons.core.Config;%0Aimport seedu.jimi.commons.exceptions.DataConversionException;%0Aimport seedu.jimi.commons.util.ConfigUtil;%0A%0A
 /**%0A *  
@@ -853,16 +853,140 @@
 n Jimi%22;
+%0A    public static final String CONFIG_FILE_NOT_FOUND = %22Config file is not found. Using default config file properties...%22;
 %0A%0A    pr
@@ -1243,63 +1243,658 @@
     
-// TODO Auto-generated method stub%0A        return null;
+String defaultConfigFilePathUsed = Config.DEFAULT_CONFIG_FILE;%0A        try %7B%0A            Optional%3CConfig%3E configOptional = ConfigUtil.readConfig(defaultConfigFilePathUsed);%0A            Config config = configOptional.orElse(new Config());%0A            config.setTaskBookFilePath(taskBookFilePath);%0A            return new CommandResult(String.format(MESSAGE_SUCCESS, taskBookFilePath));%0A        %7D catch (DataConversionException e) %7B%0A            Config config = new Config();%0A            config.setTaskBookFilePath(taskBookFilePath);%0A            return new CommandResult(String.format(CONFIG_FILE_NOT_FOUND, MESSAGE_SUCCESS, taskBookFilePath));%0A        %7D
 %0A   

Implement execute() for SaveAsCommand