6
6
import java .nio .charset .StandardCharsets ;
7
7
import jenkins .model .Jenkins ;
8
8
import org .apache .commons .io .IOUtils ;
9
- import org .kohsuke .stapler .StaplerResponse ;
9
+ import org .kohsuke .stapler .StaplerResponse2 ;
10
10
import org .kohsuke .stapler .interceptor .RequirePOST ;
11
11
12
12
import edu .umd .cs .findbugs .annotations .CheckForNull ;
13
- import javax .servlet .ServletContext ;
14
- import javax .servlet .http .HttpServletResponse ;
13
+ import jakarta .servlet .ServletContext ;
14
+ import jakarta .servlet .http .HttpServletResponse ;
15
15
import java .io .*;
16
16
import java .net .URL ;
17
17
import java .net .URLDecoder ;
@@ -23,13 +23,13 @@ public class UpdateCenterAction implements RootAction {
23
23
24
24
@ RequirePOST
25
25
@ SuppressFBWarnings (value = {"NP_LOAD_OF_KNOWN_NULL_VALUE" , "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE" }, justification = "Spotbugs doesn't grok try-with-resources" )
26
- public void doUse (StaplerResponse response ) throws IOException {
26
+ public void doUse (StaplerResponse2 response ) throws IOException {
27
27
if (!Jenkins .get ().hasPermission (Jenkins .ADMINISTER )) {
28
28
response .sendError (HttpServletResponse .SC_FORBIDDEN );
29
29
return ;
30
30
}
31
31
32
- ServletContext context = Jenkins .get ().servletContext ;
32
+ ServletContext context = Jenkins .get ().getServletContext () ;
33
33
if (context == null ) {
34
34
LOGGER .warning ("cannot get the servlet context when use the mirror certificate" );
35
35
return ;
@@ -51,7 +51,7 @@ public void doUse(StaplerResponse response) throws IOException {
51
51
}
52
52
53
53
@ RequirePOST
54
- public void doRemove (StaplerResponse response ) throws IOException {
54
+ public void doRemove (StaplerResponse2 response ) throws IOException {
55
55
if (!Jenkins .get ().hasPermission (Jenkins .ADMINISTER )) {
56
56
response .sendError (HttpServletResponse .SC_FORBIDDEN );
57
57
return ;
0 commit comments