08-24-2018 09:50 AM
I have the below findFolder method, when I pass the path I am not able to find the folder. Please can you let me know what the path should be or what is incorrect below.
I have a folder at the path specified.
FindFolder method
public static Folder findFolder(@NotNull Session session, @NotNull String path) throws FolderNotFoundException{
CmisObject obj = session.getObjectByPath(path);
if(obj instanceof Folder){
return (Folder)obj;
}else{
throw new FolderNotFoundException("The path " + path + " does not return reference to a folder");
}
}
Test class
String user = "admin";
String pwd = "admin";
String serviceUrl = "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser";
Session session = SessionManager.getInstance().createSession(new SessionContext(user, pwd, serviceUrl));
try {
Folder folder = FolderService.findFolder(session, "/app:company_home/st:sites/cm:testsite/cm:documentLibrary/cm:Contracts");
assertNotNull(folder);
} catch (FolderNotFoundException e) {
e.printStackTrace();
}
Exception
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Object not found: /app:company_home/st:sites/cm:test-site/cm:documentLibrary/cm:Contracts
at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.convertStatusCode(AbstractBrowserBindingService.java:296)
at org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.read(AbstractBrowserBindingService.java:410)
08-24-2018 01:15 PM
"app:company_home" is known as "/" for CMIS.
Try typing "/Sites/Test Site/documentLibrary/Contracts" or so.
08-24-2018 01:15 PM
"app:company_home" is known as "/" for CMIS.
Try typing "/Sites/Test Site/documentLibrary/Contracts" or so.
Explore our Alfresco products with the links below. Use labels to filter content by product module.