URI of the document in Alfresco

Showing results for 
Search instead for 
Did you mean: 
Member II

URI of the document in Alfresco


I tried the below code

URI uri = new URI("");
File f = new File(uri);

I am getting the error as "URI scheme is not file". But when i put the in browser, I could be able to see my document opening in the browser window.

My question is then what will be the correct URI (how to get the URI) that refers to my document so that i could create a reference File object for the document present in Alfresco.

Any help appreciated.

2 Replies
Senior Member

Re: URI of the document in Alfresco


You can not use URI directly like this, you can see the document in the browser with this URI because you are accessing the document by making an http request and you are authorized to Alfresco repository.

You can use various Java or JavaScript APIs or services like NodeService to access the 'NodeRef' of a document within Alfresco.

You can get all the document related information(metadata and content) with the help of this NodeService.

For more information refer NodeService | Alfresco Documentation 

Please let me know if you have any further query.




Member II

Re: URI of the document in Alfresco

Thanks for the clarification