As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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 + " "); } }