diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index c4d1e7088336..24b04ce3085d 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -43,6 +43,7 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintStream; +import java.io.PrintWriter; import java.io.Reader; import java.io.StringReader; import java.io.Writer; @@ -108,6 +109,7 @@ import java.util.regex.Pattern; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; +import jenkins.model.Jenkins; import jenkins.util.MemoryReductionUtil; import jenkins.util.SystemProperties; import jenkins.util.io.PathRemover; @@ -1856,6 +1858,20 @@ public static long daysElapsedSince(@NonNull Date date) { return t; } + @Restricted(NoExternalUse.class) + public static void printRedirect(String contextPath, String redirectUrl, String message, PrintWriter out) { + out.printf( + "" + + "" + + "" + + "" + + "%n" + + "%2$s%n" + + "