cancel
Showing results for 
Search instead for 
Did you mean: 

Path of a file stored in Alfresco

camillo
Champ in-the-making
Champ in-the-making
Hi all,

I must develop a java application able to parse an xml file stored in Alfresco.
But, when i want to know the path of the file i received this string for the file named my_file.xml:
/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1....

followed by an java.io.FileNotFoundException because i can't open the xml file.
Does anybody can help me to solve this problem?
thanks in advance
10 REPLIES 10

ebrenes
Champ on-the-rise
Champ on-the-rise
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.