Hi ES team,

There is a method to get document from registry in API Manager Impl layer.
We can get any file saved in registry with that method. But when I pass the
returned file object to jaggery method, jaggery layer gets an empty object.

public static Map<String, Object> getDocument(String userName, String
resourceUrl,
                                              String tenantDomain)
 {
    Map<String, Object> documentMap = new HashMap<String, Object>();

    InputStream inStream = null;

    Resource apiDocResource;

            inStream = apiDocResource.getContentStream();
            documentMap.put("Data", inStream);
            documentMap.put("contentType", apiDocResource.getMediaType());
            String[] content = apiDocResource.getPath().split("/");
            documentMap.put("name", content[content.length - 1]);

    return documentMap;
}
above is the getDocument method. It gets the document from registry and put
into a hash map. Below is the jaggery method to get the file where I can
get the hash map values successfully but the file content.

 StoreAPIProxy.prototype.getDocument = function (username, resourcepath,
tenantDomain) {
        var document = {};

            var content = APIUtil.getDocument(username, resourcepath,
tenantDomain);
            document.data = content.get("Data");
            document.contentType = content.get("contentType");
            document.name = content.get("name");

            return {
                error:false,
                document:document
            };
        }
    };

How do I get the InputStream object returns by java method to jaggery
method?

Thanks
-- 
Lakshman Udayakantha
WSO2 Inc. www.wso2.com
lean.enterprise.middleware
Mobile: *0711241005*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to