cancel
Showing results for 
Search instead for 
Did you mean: 

URI of the document in Alfresco

azarfaiz
Champ in-the-making
Champ in-the-making

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 2

kalpesh_c2
Star Collaborator
Star Collaborator

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

azarfaiz
Champ in-the-making
Champ in-the-making

Thanks for the clarification