cancel
Showing results for 
Search instead for 
Did you mean: 

I want to create folder next inside folder need to create subfolders.

rajeev7842
Champ in-the-making
Champ in-the-making

Please share Rest api code for creating folder and sub folders using java?

Example:

Education

        SSC

        Professional

        Kyc

Here education is parent folder and remaining three are subfolders .I need code please share ASAP.

Regards 

Rajeev

1 REPLY 1

abhinavmishra14
World-Class Innovator
World-Class Innovator

AFAIK, It is not possible to create the folders and subfolders in one go via any rest apis. However, please the below rest api which can be used to create folders:

https://docs.alfresco.com/content-services/5.2/develop/rest-api-guide/folders-files/#create-a-folder

http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/{id}/children

The id can be either one of the constants -root-, -shared-, -my- or an Alfresco Node Identifier (e.g. 444be4a6-5693-4d10-af4b-b55448fe4f97). The POST data defines the folder metadata and looks like in this example:

 

{
  "name": "My Folder",
  "nodeType": "cm:folder",
  "properties": {
    "cm:title": "My Folder",
    "cm:description": "My new folder"
  }
}

If you would have to create the folder and subfolders in one go, you would have to create your custom webscript to handle your specific requirement. In your webscript you can include the code to create folders/subfolders based on the path value passed.

See the detailed solution here: https://hub.alfresco.com/t5/alfresco-content-services-forum/how-to-create-directory-structure-using-...

~Abhinav
(ACSCE, AWS SAA, Azure Admin)