It's all about the answers!

Ask a question

DNG-6.0: Retriving folders from DNG project using OSLC

Naveen Tyagi (1874118) | asked Mar 07 '16, 1:30 a.m.
I am retrieving the folders using:

String targetFolder =  webContextUrl+"/folders";

String  getUrl= targetFolder+"?oslc.where=public_rm:parent=";

HttpGet get = new HttpGet(getUrl+folderArgumnet.getFolderURL());

get.addHeader("Accept", "application/xml");

get.addHeader("OSLC-Core-Version", "2.0");

HttpResponse response = HttpUtils.sendGetForSecureDocument(webContextUrl, get, null, null,
client.getHttpClient(), JTS_Server);

response is coming in RDFxml. Which returns first root level folders in the project. Then i have written an recursive parser which is traverse through these folders one by one till last child folder and continue to add the folder[name and URL] object in a list. it is working fine but if project contains more folders[100 or more] then it is taking very much time.
It is obvious because for every folder one sendGetForSecureDocumen will be made to check if it contains child folders, if it contains then again sendGetForSecureDocumen call will be made and so so. if folder doesn't contain any child folder then it will be added to the folder list and same for the other folders in  hierarchy.
 is there any way to get all the folder once. I don't need to maintain any relationship between them which folder is child/parent of which folder. All i want is the list of the folder[at least contain name and URL] objects in a given project.

Be the first one to answer this question!

Register or to post your answer.