src/main/java/seedu/address/logic/parser/ImportCommandParser.java
public ImportCommand parse(String arg) throws ParseException {
        String trimmedArgument = arg.trim();

        if (!isValidFileName(trimmedArgument)) {
            throw new ParseException(MESSAGE_INVALID_FILE_NAME);
        }

        try {
            String fullPath = IMPORT_FILE_DIRECTORY + trimmedArgument + ".xml";
            ReadOnlyAddressBook readOnlyAddressBook = ParserUtil.parseImportFilePath(fullPath);

            List<ReadOnlyParcel> parcels = readOnlyAddressBook.getParcelList();

            return new ImportCommand(parcels);
        } catch (IllegalValueException ive) {
            throw new ParseException(String.format(ive.getMessage()));
        }
    }
/**
     * Parses the given {@code String} of arguments in the context of the {@link ImportCommand}
     * and returns an {@link ImportCommand} object for execution.
     *
     * @throws ParseException if the user input does not conform the expected format, or the storage file is not able to
     * be found or it is in the wrong data format.
     */
Parses the given  String of arguments in the context of the  ImportCommand
and returns an  ImportCommand object for execution.

@throws ParseException if the user input does not conform the expected format, or the storage file is not able to
be found or it is in the wrong data format.
Parses the given String of arguments in the context of the ImportCommand and returns an ImportCommand object for execution . @throws ParseException if the user input does not conform the expected format or the storage file is not able to be found or it is in the wrong data format .
public ImportCommand parse(String arg) throws ParseException {
        String trimmedArgument = arg.trim();
        if (!isValidFileName(trimmedArgument)) {
            throw new ParseException(MESSAGE_INVALID_FILE_NAME);
        }
        try {
            String fullPath = IMPORT_FILE_DIRECTORY + trimmedArgument + ".xml";
            ReadOnlyAddressBook readOnlyAddressBook = ParserUtil.parseImportFilePath(fullPath);
            List<ReadOnlyParcel> parcels = readOnlyAddressBook.getParcelList();
            return new ImportCommand(parcels);
        } catch (IllegalValueException ive) {
            throw new ParseException(String.format(ive.getMessage()));
        }
    }
public ImportCommand parse ( String arg ) throws ParseException { String trimmedArgument = arg . trim ( ) ; if ( ! isValidFileName ( trimmedArgument ) ) { throw new ParseException ( MESSAGE_INVALID_FILE_NAME ) ; } try { String fullPath = IMPORT_FILE_DIRECTORY + trimmedArgument + ".xml" ; ReadOnlyAddressBook readOnlyAddressBook = ParserUtil . parseImportFilePath ( fullPath ) ; List < ReadOnlyParcel > parcels = readOnlyAddressBook . getParcelList ( ) ; return new ImportCommand ( parcels ) ; } catch ( IllegalValueException ive ) { throw new ParseException ( String . format ( ive . getMessage ( ) ) ) ; } }
Parses the given {@code String} of arguments in the context of the {@link ImportCommand}
 and returns an {@link ImportCommand} object for execution.
Parses the given { @code String } of arguments in the context of the { @link ImportCommand } and returns an { @link ImportCommand } object for execution .