Copy Files

Applies to ReadyAPI 3.5, last modified on January 26, 2021

You can use Groovy scripts to copy files in your file system.

Where To Use

You can use this script anywhere in ReadyAPI.

Example

Groovy

//Import libraries for working with files
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;

//Create objects for the copied file and the target file
Path source = Paths.get("C:\\Users\\elle.stevenson\\Desktop\\test.xlsx");
Path target = Paths.get("C:\\Users\\elle.stevenson\\Desktop\\out\\copied.xlsx");

//Copy the file
Files.copy(source, target)

See Also

Groovy Scripts
Scripting

Highlight search results