From eecfbf2a338b7bff86847a2daea9ee4c9cbb361b Mon Sep 17 00:00:00 2001 From: Stefan Spieker Date: Sun, 13 Feb 2022 20:59:27 +0100 Subject: [PATCH] Deprecate `Util.copyFile()` (#6272) * deprecate copyFile * Update core/src/main/java/hudson/Util.java Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com> --- core/src/main/java/hudson/Util.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index 66d2d262b4..a43295601c 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -57,6 +57,7 @@ import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.charset.StandardCharsets; +import java.nio.file.CopyOption; import java.nio.file.FileAlreadyExistsException; import java.nio.file.FileSystemException; import java.nio.file.FileSystems; @@ -1071,7 +1072,12 @@ public class Util { /** * Copies a single file by using Ant. + * + * @deprecated since TODO; use {@link Files#copy(Path, Path, CopyOption...)} directly */ + @Deprecated + @Restricted(NoExternalUse.class) + @RestrictedSince("TODO") public static void copyFile(@NonNull File src, @NonNull File dst) throws BuildException { Copy cp = new Copy(); cp.setProject(new Project());