-2

For Java, I have a test case scenario that involves many steps amongst which:

A- Checking whether a certain file has been generated in a certain directory. B- moving this file from this directory to another specific directory.

How can A & B be implemented ?

djangofan
  • 28,471
  • 61
  • 196
  • 289
  • here https://stackoverflow.com/questions/1816673/how-do-i-check-if-a-file-exists-in-java and here https://stackoverflow.com/questions/4645242/how-do-i-move-a-file-from-one-location-to-another-in-java – Valga May 08 '19 at 20:21
  • 1
    This question has nothing to do with Selenium or streams so I removed those tags. – JeffC May 08 '19 at 20:31
  • what did you try so far? – JavaSheriff May 08 '19 at 20:34

1 Answers1

0

Using Java 1.8+, it is simple like this:

import static java.nio.file.StandardCopyOption.*;
...
Files.move(source, target, REPLACE_EXISTING);
djangofan
  • 28,471
  • 61
  • 196
  • 289