AnsweredAssumed Answered

not able to create folder using CMIS API

Question asked by nancyaggarwal on Aug 24, 2015
Latest reply on Aug 27, 2015 by nancyaggarwal

I am building one client application which is integrated with alfresco using external authentication. I am able to create a session with alfresco using current user alf_ticket. Now in root folder i have created one folder with the name "test".

Now i want to create folder inside the folder test with the name of the current user.

For this i written the below code:

private static Folder createFolder(Folder target, String newFolderName) {
      Map<String, String> props = new HashMap<String, String>();
      props.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
      props.put(PropertyIds.NAME, "abc");
      Folder newFolder = target.createFolder(props);
      return newFolder;

and now calling this method in main after retriving the test as below:
Folder target = (Folder) session.getObject("workspace://SpacesStore/898583d0-5c38-4dad-a297-204f45960a4c"); //retrieving test folder
               Folder newFolder = createFolder(target, "abc");

but while running this code this is giving me org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException: Forbidden error.

Please help me with this.