Since it's not so clear what you've tried, you might look into things like
JACKSON -- a JSON parsing/generation system.
Or a whole host of other utilities.
Writing your own parser would be a waste of time.
Reading from the file may or may not be covered by the utilities, but you can handle that--or there may be some utility in Apache Commons.