I am new to Scala.
I\'ve Googled a lot on how to move files in Scala, but have only found how to move files in Java. I tried to move files using Java import Java.io
From my understanding of your question,
you are trying to pass String variables instead of java.nio.Path variables to the Files.move().
The below way works:
import java.io.File
import java.nio.file.{Files, Path, StandardCopyOption}
val d1 = new File("/abcd").toPath
val d2 = new File("/efgh").toPath
Files.move(d1, d2, StandardCopyOption.ATOMIC_MOVE)
However I see one more issue in your code.
Both StandardCopyOption.REPLACE_EXISTING and StandardCopyOption.ATOMIC_MOVE should work but, you can't move a parent directory directly into it's child directory.
$ mv public/ public/images
mv: cannot move ‘public/’ to a subdirectory of itself, ‘public/images’
Instead you might want to move public -> tmp -> public/images