cancel
Showing results for 
Search instead for 
Did you mean: 

How do I access the files in users home space

ajaylakhani
Champ in-the-making
Champ in-the-making
Hi, could you please advice on how to get access to the files in a user's home space. I am unable to get a node reference using the below code:

Node node = null;
String path = "/app:company_home/cm:Users/cm:Ajays_x0020_Space";

Repository  RepositoryServiceSoapBindingStub repositoryService = webServiceFactory.getRepositoryService();

Reference reference = new Reference(STORE, uuid, path);

Predicate predicate = new Predicate(new Reference[]{reference}, null, null);

node = repositoryService.get(predicate)[0];
—– the exception is
Exception in thread "main"
com.crawler.alfresco.AlfrescoException: Could not locate resource
   at com.crawler.alfresco.AlfrescoDriver.getNode(AlfrescoDriver.java:103)
   at com.crawler.alfresco.AlfrescoDriver.getNode(AlfrescoDriver.java:111)
   at com.crawler.alfresco.AlfrescoDriver.main(AlfrescoDriver.java:170)
2 REPLIES 2

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

Try this ..

Reference reference = new Reference(STORE, null, path);

.. since you don't need to set the id of the reference as you are providing a path instead.

Cheers,
Roy

ajaylakhani
Champ in-the-making
Champ in-the-making
USING:
Reference reference = new Reference(STORE, null, path);

I am still not able to get the reference… i have observed that I can use this code for folders but for a home-space, it does not locate