AnsweredAssumed Answered

Uploading file using REST Service

Question asked by himanshu412 on Apr 23, 2009

I am facing problem while uploading file(contents and metadata) to Alfresco Repository. While referring to Alfresco 3.1 "Repository RESTful API Reference."I come across couple of references like:
POST /alfresco/service/api/node/{store_type}/{store_id}/{id}/children
POST /alfresco/service/api/path/{store_type}/{store_id}/{id}/children
POST /alfresco/service/api/node/{store_type}/{store_id}/{id}/descendants
POST /alfresco/service/api/path/{store_type}/{store_id}/{id}/descendants

where contentStream is optional. I am not sure how to upload file contents(not just metadata) using above.  As an example I have to implement following function:

Object storeContent(Map<> metadata, byte[] data) {
  static url =http://localhost:8080/alfresco/service/api/path/workspace/SpacesStore/Company%20Home/children.content?alf_ticket=TICKET_XXX*/  
   PostMethod postMethod = new PostMethod(url);       
/* Calling REST API specific code*/

Can anyone help me on this ?