npub1lse4pfx8qmlw529cl8xq4xdz2n80yjla3a6k5yvvva78udm05uvsyc5d80 (npub1lse…5d80) Hm.
First i thought "maybe wrong version?", but this here says it's in Java SE 8: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html
I'd guess you use at least Java 8.
Looks like you should create a Path and call resolve on that:
Path source = ...
Path newdir = ...
Files.copy(source, newdir.resolve(source.getFileName());
Would be interesting if that works, too lazy to try myself right now.