I wrote java code in an adapter in a worklight project. when I try to call the java method, I get an error
"responseID": "6", "errors": {Ecma Error: TypeError: Cannot call the downloadFile property in the JavaPackage java.classes.FileIOPlugin]. This is not a function, it is \ "Object \".}
I followed the procedure in the following link.
Using Java in adapters
this is my project structure. Is there something wrong with this structure or should I add something else to this?

This is how I try to call the non-static java method in adapter-impl.js
function downloadFile() {
var fileInstance = new com.worklight.JavaCode.FileIOPlugin();
return
{ result: fileInstance.downloadFile(); };
}
source
share