@@ -0,0 +1,2505 @@
+package seedu.task.logic.commands;%0A%0Aimport java.io.IOException;%0Aimport java.util.logging.Logger;%0A%0Aimport seedu.task.MainApp;%0Aimport seedu.task.commons.core.Config;%0Aimport seedu.task.commons.core.LogsCenter;%0Aimport seedu.task.commons.util.ConfigUtil;%0Aimport seedu.task.commons.util.StringUtil;%0A%0Apublic class ChangeDirectoryCommand extends Command %7B%0A%0A    public static final String COMMAND_WORD = %22cd%22;%0A%0A    public static final String MESSAGE_USAGE = COMMAND_WORD%0A            + %22: Changes the location where the tasks in the Task Manager are saved. %22%0A            + %22Paramaters: cd %7Bfile location%7D/%22 + %22Example: %22 + COMMAND_WORD + %22  cd data/%22;%0A%0A    public static final String MESSAGE_SUCCESS = %22Directory Changed%22;%0A    public static final String MESSAGE_FAILURE = %22Illegal directory name given, please use a different directory name and try again%22;%0A%0A    private final String newDirectory;%0A    private Config newConfig = new Config();%0A    private String configFilePathUsed;%0A    private static final String DEFAULT_TASK_MANAGER_XML_FILE_NAME = %22taskmanager.xml%22;%0A    private static final Logger logger = LogsCenter.getLogger(MainApp.class);%0A%0A    /**%0A     * Convenience constructor using raw values.%0A     */%0A    public ChangeDirectoryCommand(String newDirectory) %7B%0A        this.newDirectory = newDirectory;%0A    %7D%0A%0A    @Override%0A    public CommandResult execute() %7B%0A%0A        if (isValidDirectory(newDirectory)) %7B%0A            newConfig.setTaskManagerFilePath(newDirectory);%0A            configFilePathUsed = Config.DEFAULT_CONFIG_FILE;%0A            try %7B%0A                ConfigUtil.saveConfig(newConfig, configFilePathUsed);%0A                return new CommandResult(MESSAGE_SUCCESS);%0A            %7D catch (IOException e) %7B%0A                logger.warning(%22Failed to save config file : %22 + StringUtil.getDetails(e));%0A                return new CommandResult(MESSAGE_FAILURE);%0A            %7D%0A        %7D else %7B%0A            return new CommandResult(MESSAGE_FAILURE);%0A        %7D%0A%0A    %7D%0A%0A    public static boolean isValidDirectory(String directory) %7B%0A        if (directory.contains(%22?%22)) %7B%0A            return false;%0A        %7D%0A        if (!String.valueOf(directory.charAt(directory.length()-1)).equals(%22/%22)) %7B%0A            return false;%0A        %7D%0A        return true;%0A    %7D%0A%0A%0A    public String directoryContainsXmlExtension(String directory) %7B%0A        if (!directory.contains(DEFAULT_TASK_MANAGER_XML_FILE_NAME)) %7B%0A            return directory + DEFAULT_TASK_MANAGER_XML_FILE_NAME;%0A        %7D%0A        return directory;%0A    %7D%0A%0A%7D%0A

Add a new feature to change the directory of taskmanager.xml