Fix FileAccess#move and FileAccess#copy

This commit is contained in:
JeremyStar™ 2024-12-03 21:46:46 +01:00
parent 8126b3ab83
commit f7c130d66e
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -699,7 +699,7 @@ public final class FileAccess {
* @since v1-alpha9 * @since v1-alpha9
*/ */
public @NotNull FileAccess move(@NotNull FileAccess destination) throws IOException { public @NotNull FileAccess move(@NotNull FileAccess destination) throws IOException {
Files.move(path, destination.path); Files.move(path, destination.path, StandardCopyOption.REPLACE_EXISTING);
return destination; return destination;
} }
@ -712,7 +712,7 @@ public final class FileAccess {
* @since v1-alpha9 * @since v1-alpha9
*/ */
public @NotNull FileAccess copy(@NotNull FileAccess destination) throws IOException { public @NotNull FileAccess copy(@NotNull FileAccess destination) throws IOException {
Files.move(path, destination.path); Files.copy(path, destination.path, StandardCopyOption.REPLACE_EXISTING);
return this; return this;
} }