LOGGER.info("Process definition uploaded to '" + processDocument.getPaths() + "'");
List<String> folders = ((Document)fileableCmisObject).getPaths(); Joiner joiner = Joiner.on("/").skipNulls(); String pathAsString2 = joiner.join(folders);
public Object read(ObjectInputStream os) throws IOException, ClassNotFoundException { String objectId = os.readUTF(); String canonicalName = os.readUTF(); Session session = getRepositorySession(user, password, url, repository); try { org.apache.chemistry.opencmis.client.api.Document doc = (org.apache.chemistry.opencmis.client.api.Document) findObjectForId(session, objectId); Document document = (Document) Class.forName(canonicalName).newInstance(); document.setIdentifier(objectId); document.setName(doc.getName()); document.addAttribute("location", getFolderName(doc.getParents()) + getPathAsString(doc.getPaths())); if (doc.getContentStream() != null) { ContentStream stream = doc.getContentStream(); document.setContent(IOUtils.toByteArray(stream.getStream())); document.addAttribute("updated", "false"); document.addAttribute("type", stream.getMimeType()); } return document; } catch(Exception e) { throw new RuntimeException("Cannot read document from CMIS", e); } finally { session.clear(); } }
document.setLastModified(doc.getLastModificationDate().getTime()); document.setSize(doc.getContentStreamLength()); document.addAttribute("location", getFolderName(doc.getParents()) + getPathAsString(doc.getPaths())); if (doc.getContentStream() != null && contentUrl == null) { ContentStream stream = doc.getContentStream();
List<String> paths = doc.getPaths();
String path = doc.getPaths().get(0); doc2 = (Document) session.getObjectByPath(path, SELECT_ALL_NO_CACHE_OC); addResult(checkObject(session, doc2, getAllProperties(doc2), "New document object spec compliance"));
List<String> paths = document.getPaths();
(org.apache.chemistry.opencmis.client.api.Document) findObjectForId(session, document.getIdentifier()); document.setName(doc.getName()); document.addAttribute("location", getFolderName(doc.getParents()) + getPathAsString(doc.getPaths())); if (doc.getContentStream() != null) { ContentStream stream = doc.getContentStream();