Attempting to transfer a bytea file from a Postgresql database field (SQL instance on Orchestrator) to the file store on the Orchestrator.
Code is as follows:
var query = "Select * from lots where id = '" + vmID + "'";
var resultRecords = database.readCustomQuery(query);
var icaoData = resultRecords[0].getProperty("icaodatabase_file_data");
var out = new java.io.FileOutputStream("/var/run/vco/" + resultRecords[0].getProperty("icaodatabase_file_name"));
out.write(icaoData)
out.flush()
out.close()
Error received: TypeError: [JavaPackage java.io.FileOutputStream] is not a function, it is object.
This works fine in Grails. Any suggestions on how to achieve success in Orchestrator 5.5?
You will have to use the filewriter javascript object (and check how to enable permissions for it)
Or will have to configure a shutter file to enable vCO to use java.file.
You will have to use the filewriter javascript object (and check how to enable permissions for it)
Or will have to configure a shutter file to enable vCO to use java.file.
Followed directions in the Installation manual to add the JAVA classes to shutter file configuration. Thank you for your help.