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>
This commit is contained in:
Stefan SpiekerandDaniel Beck authored and GitHub committed 2022-02-13 20:59:27 +01:00
1 parent 6071d5ab40
commit eecfbf2a33
1 file changed
+6
+6
View File
@@ -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());