Hi all,

I want to read a file from API Manager publisher jaggery app which is
located outside of that jaggery app.
The reason for the requirement is that this particular file is a sample
documentation which we plan to distribute with API Manager and should be
stored in a location which users can easily access instead of inside
jaggery apps.

When jaggery FileHostObject gets created, it seems to be appending absolute
path of the calling jaggery app to whenever path we are provided. I
provided the absolute Path of the file. Therefore the real path provided by
jaggery FileHostObject = absolute path of Jaggery app + absolute path of
the file to be read.

Since that path is wrong, when this file is accessed using
 APIProviderHostObject.java it throws a file not found exception.

I tried following approaches without any luck [1].

Appreciate your feedback on any possible approach or would like to know
whether it is not possible via jaggery.

Thanks.

[1]

   1. Provided the path of the reading file relative to the jaggery app.
   HostObject is not capable of understanding relative paths. - throws
   FileNotFound Exception
   2. Provided original file path using ~ (Home) - throws FileNotFound
   Exception
   3. Read the file on jaggery side using Packages.java.io.File - throws
   ClassCastException: org.mozilla.javascript.NativeJavaObject cannot be cast
   to org.jaggeryjs.hostobjects.file.FileHostObject


-- 
Best Regards,

*Thilini Cooray*
Software Engineer
Mobile : +94 (0) 774 570 112 <%2B94%20%280%29%20773%20451194>
E-mail : thili...@wso2.com

WSO2 Inc. www.wso2.com
lean.enterprise.middleware
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to