Thanks Fernando, actually i already go-through with this
link, but as per your suggestion i checked again and find
some useful points on it. 
Thanks for your support.

Fernando, i got file name and file path through below code
but i am not able to store it on any particular location on
local disk, i need your help, please have a look on my code
and tell me where i will have to make changes.

 ============================================================
============================================================
====================================

package com.rest.client;

import java.io.File;

import org.nuxeo.ecm.automation.client.jaxrs.Constants;
import org.nuxeo.ecm.automation.client.jaxrs.Session;
import 
org.nuxeo.ecm.automation.client.jaxrs.impl.HttpAutomationCli
ent;
import
org.nuxeo.ecm.automation.client.jaxrs.model.Document;
import
org.nuxeo.ecm.automation.client.jaxrs.model.FileBlob;
import
org.nuxeo.ecm.automation.client.jaxrs.model.PropertyMap;



public class DownloadFromRemote {
        public static void main(String[] args) throws Exception {
                HttpAutomationClient client = new
HttpAutomationClient("http://localhost:8080/nuxeo/site/automation";);
                Session session = client.getSession("Administrator",
"Administrator");
                // Get The Root

                Document doc = (Document)
session.newRequest("Document.Fetch").setHeader(Constants.HEADER_NX_SCHEMAS,
"*").set("value", "/pm.JPG").execute();
                PropertyMap map =
doc.getProperties().getMap("file:content");
                String path = map.getString("data");
                System.out.println("Path : "+path);
                FileBlob blob = (FileBlob) session.getFile(path);
                String downloaded = blob.getFileName();
                System.out.println("Name of file : "+downloaded);
                
        }

}
======================================================= END 
============================================================
============================
---
Mailing list: [email protected]
Forum: http://forum.nuxeo.org/f/1/

Reply via email to