src/main/java/seedu/address/storage/StorageManager.java
private void backup(AddressBookStorage addressBookStorage) {
        Optional<ReadOnlyAddressBook> addressBookOptional;

        try {
            addressBookOptional = addressBookStorage.readAddressBook();

            if (addressBookOptional.isPresent()) {
                backup(addressBookOptional.get());
                logger.info("Storage file present, back up success!");
            } else {
                logger.warning("Storage file not present, backup not possible.");
            }

        } catch (DataConversionException e) {
            logger.warning("Data file not in the correct format. "
                    + "Backup of Ark not available for this instance.");
        } catch (IOException e) {
            logger.warning("Problem while reading from the file. "
                    + "Backup of Ark not available for this instance.");
        }
    }
/**
     * Backup {@code addressBookStorage} and stores the file into the backup file.
     *
     * @param addressBookStorage the storage data to backup.
     */
Backup  addressBookStorage and stores the file into the backup file.
@param addressBookStorage the storage data to backup.
Backup addressBookStorage and stores the file into the backup file . @param addressBookStorage the storage data to backup .
private void backup(AddressBookStorage addressBookStorage) {
        Optional<ReadOnlyAddressBook> addressBookOptional;
        try {
            addressBookOptional = addressBookStorage.readAddressBook();
            if (addressBookOptional.isPresent()) {
                backup(addressBookOptional.get());
                logger.info("Storage file present, back up success!");
            } else {
                logger.warning("Storage file not present, backup not possible.");
            }
        } catch (DataConversionException e) {
            logger.warning("Data file not in the correct format. "
                    + "Backup of Ark not available for this instance.");
        } catch (IOException e) {
            logger.warning("Problem while reading from the file. "
                    + "Backup of Ark not available for this instance.");
        }
    }
private void backup ( AddressBookStorage addressBookStorage ) { Optional < ReadOnlyAddressBook > addressBookOptional ; try { addressBookOptional = addressBookStorage . readAddressBook ( ) ; if ( addressBookOptional . isPresent ( ) ) { backup ( addressBookOptional . get ( ) ) ; logger . info ( "Storage file present, back up success!" ) ; } else { logger . warning ( "Storage file not present, backup not possible." ) ; } } catch ( DataConversionException e ) { logger . warning ( "Data file not in the correct format. " + "Backup of Ark not available for this instance." ) ; } catch ( IOException e ) { logger . warning ( "Problem while reading from the file. " + "Backup of Ark not available for this instance." ) ; } }
Backup {@code addressBookStorage} and stores the file into the backup file.
Backup { @code addressBookStorage } and stores the file into the backup file .