if(specificStructure != null)
structures.add(specificStructure);
}
JSONArray jsonStructures = new JSONArray();
JSONObject jsonStructureObject = new JSONObject();
int structCount = 0;
for(Structure st: structures)
{
if(!inodeFilter.isEmpty() || (!range.isEmpty() && structCount >= beginItem && structCount <= endItem)){
jsonStructureObject = new JSONObject();
jsonStructureObject.put("id", st.getInode());
jsonStructureObject.put("name", st.getName());
}
if(inodeFilter.isEmpty()){
jsonStructures.add(jsonStructureObject);
}else{
return responseResource.response(jsonStructureObject.toString());
}
}
if(inodeFilter.isEmpty() && !range.isEmpty()) {
response.addHeader("Content-Range", "items " + beginItem + "-" + Math.min(endItem, structCount -1) + "/" + structCount);
}