@Override
        protected void onProfileProperty(String profileName,
                String propertyKey, String propertyValue,
                boolean isSupportedProperty, String line) {
            // Record that this property key has been declared for this profile
            if (existingProfileProperties.get(profileName) == null) {
                existingProfileProperties.put(profileName, new HashSet<String>());
            }
            existingProfileProperties.get(profileName).add(propertyKey);

            if (deletedProfiles.contains(profileName))
                return;

            // Keep the unsupported properties
            if ( !isSupportedProperty ) {
                writeLine(line);
                return;
            }

            // flush all the buffered comments and empty lines before this property line
            flush();

            // Modify the property value
            if (newProfiles.containsKey(profileName)) {
                String newValue = newProfiles.get(profileName)
                        .getPropertyValue(propertyKey);
                if (newValue != null) {
                    writeProperty(propertyKey, newValue);
                }
                // else remove that line
            } else {
                writeLine(line);
            }

        }
Read the existing content of a credentials file, and then make
in-place modification according to the new profiles specified in this
class.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java