@Override
        protected void onEmptyOrCommentLine(String profileName, String line) {
            /*
             * Buffer the line until we reach the next property line or the end
             * of the profile. We do this so that new properties could be
             * inserted at more appropriate location. For example:
             *
             * [default]
             * # access key
             * aws_access_key_id=aaa
             * # secret key
             * aws_secret_access_key=sss
             * # We want new properties to be inserted before this line
             * # instead of after the following empty line
             *
             * [next profile]
             * ...
             */
            if (profileName == null || !deletedProfiles.contains(profileName)) {
                buffer(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