JSFile question

How can I create a new instance of the JSFile object without creating a temp file, but instead, by passing in a File object.
I see in the JSFile class inside of the plugin they have this constructor…

public JSFile(File file) {
	this.file = file;
}

But, the plugin API doesn’t give you access to it…or at least I can’t figure out how.
I need this becuase I’m working on a plugin to copy a file from the Servoy App server down to the client. So, in my plugin I’m returning a File object, and would like to cast it to a JSFile object so I may reuse all of the methods.

So, in my servoy method, I’d like to do something like:

var myFile = (my plugin Call)
var myJSFile = new JSFile(myFile)

Any help is appreciated.

in the file plugin there is: convertStringToJSFile() that you can use.

var myJSFile = plugins.file.converStringToJSFile(myFile.toString());

by the way, JSFile is just a wrapper around file that calls the file methods. So you should be able to call pretty much the exact same methods that you do on JSFile on File itself…