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
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-...
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.