public String copyTestData(String name){
  String content=readTestData(name);
  Path targetPath=Paths.get(tempDir,name);
  try {
    Files.createDirectories(targetPath.getParent());
    Files.write(targetPath,content.getBytes(StandardCharsets.UTF_8));
  }
 catch (  IOException e) {
    throw new IllegalArgumentException(String.format("Cannot copy '%s': %s",targetPath,e.getMessage()));
  }
  return content;
}

public String copyTestData ( String name ) { String content = readTestData ( name ) ; Path targetPath = Paths . get ( tempDir , name ) ; try { Files . createDirectories ( targetPath . getParent ( ) ) ; Files . write ( targetPath , content . getBytes ( StandardCharsets . UTF_8 ) ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( String . format ( "Cannot copy '%s': %s" , targetPath , e . getMessage ( ) ) ) ; } return content ; }
copies test data , located via the test data locator , into the temporary directory associated with this test config . returns the content of the test data as a string .
