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.
I must develop a java application able to parse an xml file stored in Alfresco.
ContentReader reader = this.contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);
You can get the input stream for the XML file byContentReader reader = this.contentService.getReader(nodeRef, ContentModel.PROP_CONTENT);where the nodeRef is the NodeRef of the XML file.
private File getZipAsFile(String nodeRef) { NodeRef node = new NodeRef(nodeRef); ContentReader reader = this.contentService.getReader(node, ContentModel.PROP_CONTENT); File sourceFile = TempFileProvider.createTempFile(getClass().getSimpleName() + "_source_", ".zip"); reader.getContent(sourceFile); return sourceFile; }
You can change the extension file to whatever you need.