public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
        final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
        for (Profile profile : profiles) {
            modifications.put(profile.getProfileName(), profile);
        }

        modifyProfiles(destination, modifications);
    }
Modify or insert new profiles into an existing credentials file by
in-place modification. Only the properties of the affected profiles will
be modified; all the unaffected profiles and comment lines will remain
the same. This method does not support renaming a profile.

@param destination
           The destination file to modify
@param profiles
           All the credential profiles to be written.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java