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.
QName contentQName = QName.createQName("{http://www.alfresco.org/model/content/1.0}content"); FileInfo pdfInfo = fileFolderService.create(directory, filename, contentQName); NodeRef pdf = pdfInfo.getNodeRef();
NodeRef storeRootNodeRef = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
//using fileFolderService List<FileInfo> parentDirectory = fileFolderService.searchstoreRootNodeRef , "folder name****", true); NodeRef parentNodeRef = parentDirectory .getNodeRef(); //using searchService List<NodeRef> results = searchService.selectNodes( storeRootNodeRef, "/app:company_home/app:****/", null, namespaceService, false, SearchService.LANGUAGE_XPATH); if (results.size() == 0) { throw new AlfrescoRuntimeException("Didn't find node"+name); } NodeRef parentNodeRef = results.get(0);
FileInfo object = fileFolderService.create(parentNodeRef, "name", TYPE_CONTENT);