Let say I have some folders in SharePoint.
Each folder contains Folder1->Folder2>Folder3....>File(txt.docx etc) like this inside folder we have another folder and at the end some files of any type.
I want to access the files available in each folder with help of microsoft graph API in java sdk.
Below code will give me the root level files
JsonObject rootChildJson = graphClient.customRequest("/drives/"+driveId+
"/items/root/children") .buildRequest() .get();
and with the help of each item id of root folder I can get the next level file.
JsonObject innerChildren =graphClient.customRequest("/drives/"+driveId+
"/items/"+itemId+"/children") .buildRequest() .get();
Is there an easy way to traverse the files available in each folder?
Thanks!!!