In the above output,each line contains a attribute name and the next corresponding line have the value for this attribute.
For example,the line1 and line2 in above output is identitydetails.attribute.name=uid and identitydetails.attribute.value=John.
Now I want to add uid(from line1) as a key and John(from line2) as value to a HashMap. The same has to be done for other lines in the output and add key/value pairs to HashMap.
Can anyone suggest me the best approach to achieve the above requirement.
Thanks in Advance,
Author and all-around good cowpoke
posted 3 years ago
That is the name=value format used by "properties" so you could create a java.util.Properties object to hold and read values.
Create a StringReader from the String, create an empty Properties and then load it from the Reader.