* @param folder the folder
*
* @return the docs
*/
public DocumentListFeed getDocsFromFolder(DocumentListEntry folder) {
DocumentListFeed results = new DocumentListFeed();
DocumentListFeed docs = null;
List<DocumentListEntry> list = new ArrayList<DocumentListEntry>();
if (folder == null) {
try {
docs = getDocumentList().getDocsListFeed("all");
} catch (Exception e) {
e.printStackTrace();
}
while (true) {
if (docs != null && docs.getEntries().size() > 0) { // docs.getTotalResults() != -1 &&
for (DocumentListEntry doc : docs.getEntries()) {
if (doc.getParentLinks().isEmpty() && !doc.getType().equals("folder")) {
list.add(doc);
}
}
try {
docs = getDocumentList().getDocsListFeed(docs.getNextLink());
} catch (Exception e) {
e.printStackTrace();
break;
}
} else {
break;
}
}
} else {
try {
docs = getDocumentList().getFolderDocsListFeed(folder.getResourceId());
} catch (Exception e) {
e.printStackTrace();
}
while (true) {
if (docs != null && docs.getEntries().size() > 0) {
for (DocumentListEntry doc : docs.getEntries()) {
if (!doc.getType().equals("folder")) {
list.add(doc);
}
}
try {
docs = getDocumentList().getDocsListFeed(docs.getNextLink());
} catch (Exception e) {
e.printStackTrace();
break;
}
} else {