Unanswered question

How can we copy a file from a path using javascript by parameterizing file name?

I have a file in C:\tmp
I am writing below code to copy contents of file but the name here is hardcoded
I want to parameterize the file name so that I need not change it manually in code
var fileToCopy = new Packages.java.io.File("C:\\tmp\\base\\API_02_Details.FileName"); /
How do I do it?

Venkata Vijaya S.
Venkata Vijaya S.

Venkata Vijaya S.

Level
0
34 / 100
points

Answers

Kai K.
Kai K.

Kai K.

Level
0
39 / 100
points

I would assume the following code should be working:

var path=context.variableManager.getValue("myPathVariable");
var fileToCopy = new Packages.java.io.File(path);