I am trying to implement a method which is able to navigate through a JSONObject until it finds a given parameter. My JSON is structured like a foldersystem. There are folders and every folder can have files.A folder can have another folder and so on.JSON is looking like this:
{
"Elements": [
{
"file": {
"files": [
{
"id": "562dd7a2-9268-46b2-8963-b7a3b43e906e",
"modified": 1457608018166,
"name": "Bild1"
},
{
"id": "0efd76e7-730e-428a-96a4-95e04844070a",
"modified": 1457608018166,
"name": "Audio"
},
{
"files": [
{
"id": "562dd7a2-9268-46b2-8963-b7a3b43e906e",
"modified": 1457608018166,
"name": "Bild2"
},
{
"id": "562dd7a2-9268-46b2-8963-b7a3b43e906e",
"modified": 1457608018166,
"name": "Bild3"
},
{
"id": "562dd7a2-9268-46b2-8963-b7a3b43e906e",
"modified": 1457608018166,
"name": "Bild4"
}
],
"id": "562dd7a2-9268-46b2-8963-b7a3b43e906e",
"name": "FolderInRoot"
}
],
"id": "562dd7a2-9268-46b2-8963-b7a3b43e906e",
"name": "RootFolder"
}
},
{
"file": {
"files": [],
"id": "562dd7a2-9268-46b2-8963-b7a3b43e906e",
"name": "AnotherRootFolder"
}
}
]
}
So for example I want to edit "Bild2" which has the path "/RootFolder/FolderInRoot/Bild2". Has someone a method which navigates to that given position. The path should be the parameter.