cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if a folder exists using CMIS API

rita_aiyar
Champ in-the-making
Champ in-the-making
HI,

I want to know if a folder exists in the repository but do not want to iterate through all the folders. I tried using session.GetObjectByPath method. If the folder exists in the path then it returns the ICMISObject, however if the folder does not exist then it throws an error and i have to then create the folder from the catch block. I was wondering if there was some way in which i give a path for e.g Repository/RefLibFolder/InfoTypeFolder/ContentTypeFolder then the method returns me a true or false stating that the above structure exists or not.

Regards,
Rita
1 REPLY 1

niketapatel
Star Contributor
Star Contributor
Hi Rita, I dont think that API is available.

and I think you are doing it correct way.Please check below Jeff Pott's example - "Get the Target Folder"

http://ecmarchitect.com/archives/2013/08/26/3528