I am trying to delete a folder using Modified Javascript in Pentaho, however the delete
keyword is reserved by the PDI compiler (it is used to delete a variable from memory).
Here's what I do:
var source = new java.io.File("some path");
var files = source.list();
for (var i=0; i<files.length; i++) {
deleteFile(oldpath + "/" + filename); // empty folder from files, works okey
}
source.delete();
And I get a compilation error from Pentaho.
I tried deleteFile on the folder, but apparently deleteFile can't delete a folder.
Any suggestions how to overcome the use of a reserved word?