1
good night.
For the first time I am manipulating a Json file with Java, because many colleagues have always told me that it is very easy to manipulate data, especially with the Google library (Gson).
Well, one question that came to me is this, how can I access a key inside a file?
Sort of like this:
I recorded an object in a single column in this way:
{
"fileName":"090808_072340.jpg",
"fileSize":"337 Kb",
"fileType":"image/jpeg",
"fileTmpPath":"/tmp/joocebox-img/destination/manolo/090808_072340.jpg"
}
In case, I wanted to work with the key "fileTmpPath".
Can I parse inside this file with any Gson methods? Or at the time deserializar I have to have a bean with the fields and Gson takes care of it for me? Remaining only I give one getFileTmpPath() for example?
Thank you and a hug to all!
Hi Lucas Polo! First of all thanks for the help. That’s what I was after. I made some adaptations to my code and it worked perfectly. Thank you!
– João Manolo