URI of the document in Alfresco

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

URI of the document in Alfresco

Hi

I tried the below code

URI uri = new URI("http://127.0.0.1:8080/share/proxy/alfresco/api/node/content/workspace/SpacesStore/99c9f0ab-c78a-4980...");
File f = new File(uri);

I am getting the error as "URI scheme is not file". But when i put the http://127.0.0.1:8080/share/proxy/alfresco/api/node/content/workspace/SpacesStore/99c9f0ab-c78a-4980... 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
Highlighted
Senior Member

Re: URI of the document in Alfresco

Hi,

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.

Thanks,

Kalpesh

ContCentric

Highlighted
Member II

Re: URI of the document in Alfresco

Thanks for the clarification