java - FileAlreadyExistsException with REPLACE_EXISTING option -
inside code there loop substitute file file.
this done with:
java.nio.file.files.move(path source, path target, copyoption... options) throws ioexception
the following exception thrown:
exception in thread "main" java.nio.file.filealreadyexistsexception: c:\brute-force\test-loads-2-forces-only.dat.temp -> c:\brute-force\test-loads-2-forces-only.dat @ sun.nio.fs.windowsexception.translatetoioexception(unknown source) @ sun.nio.fs.windowsexception.rethrowasioexception(unknown source) @ sun.nio.fs.windowsfilecopy.move(unknown source) @ sun.nio.fs.windowsfilesystemprovider.move(unknown source) @ java.nio.file.files.move(unknown source) (*) @ bruteforce.main.changevalue(main.java:260) @ bruteforce.main.main(main.java:71)
the line @ exception thrown:
(*) @ bruteforce.main.changevalue(main.java:260): files.move(path, path.resolvesibling("destiny_file"), replace_existing);
javadoc defines exception:
... filealreadyexistsexception - if target file exists cannot replaced because replace_existing option not specified (optional specific exception) ...
the code specifies replace_existing.
also option imported @ beginning of file:
import static java.nio.file.standardcopyoption.replace_existing;
any hint?
it due computer (or hdd) hybernates or similar? have set enegy options not suspends while using power grid.
thanks in advance
Comments
Post a Comment