02-06-2014 10:53 AM
02-07-2014 04:42 AM
02-10-2014 12:18 PM
02-12-2014 03:07 AM
02-12-2014 04:41 AM
02-17-2014 03:21 AM
public void getDimension() throws Exception{
String parentFolder = "documentLibrary";
String site = "workspace://SpacesStore/48299b30-d909-41e4-b7c7-73a504d5161d";
Session session = CmisUtil.createCmisSession(ALFRESCO_USER, ALFRESCO_PWD, ALFRESCO_CMIS_URL);
RepositoryCapabilities caps =
session.getRepositoryInfo().getCapabilities();
Folder folder = CmisUtil.getFolderInSite(session, parentFolder, site);
if (!caps.isGetDescendantsSupported()) {
throw new Exception("\n Warning: getDescendants " +
"not supported in this repository");
} else {
System.out.println("\ngetDescendants " +
"is supported on this repository.");
for (Tree<FileableCmisObject> t : folder.getDescendants(-1)) {
printTree(t , "");
}
System.out.println("\nSize of " +
folder.getName() + ": " + size);
}
}
private static void printTree(Tree<FileableCmisObject> tree,
String tab) throws Exception {
long value = 0;
for(Property<?> property : tree.getItem().getProperties()){
String queryName = property.getQueryName();
if (queryName.equalsIgnoreCase("cmis:contentStreamLength")){
Object obj = property.getFirstValue();
BigInteger bi = (BigInteger) obj;
value = bi.longValue();
size = size + value;
break;}
}
System.out.println("Size of " +
tree.getItem().getName() + ": " + value);
for (Tree<FileableCmisObject> t: tree.getChildren()) {
printTree(t, tab + " ");
}
}
02-11-2015 12:44 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.