Skip to content

Commit 1360029

Browse files
committed
Upgrade to Jetty 12.0.12
Closes gh-41770
1 parent 4fb62fe commit 1360029

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ bom {
687687
]
688688
}
689689
}
690-
library("Jetty", "12.0.11") {
690+
library("Jetty", "12.0.12") {
691691
group("org.eclipse.jetty.ee10") {
692692
imports = [
693693
"jetty-ee10-bom"

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyEmbeddedWebAppContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ void deferredInitialize() throws Exception {
4242
getContext().call(handler::deferredInitialize, null);
4343
}
4444

45+
@Override
46+
public String getCanonicalNameForTmpDir() {
47+
return super.getCanonicalNameForTmpDir();
48+
}
49+
4550
private static final class JettyEmbeddedServletHandler extends ServletHandler {
4651

4752
@Override

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,17 @@ private void addLocaleMappings(WebAppContext context) {
308308

309309
private File getTempDirectory(WebAppContext context) {
310310
String temp = System.getProperty("java.io.tmpdir");
311-
return (temp != null)
312-
? new File(temp, WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context) + UUID.randomUUID())
313-
: null;
311+
return (temp != null) ? new File(temp, getTempDirectoryPrefix(context) + UUID.randomUUID()) : null;
312+
}
313+
314+
@SuppressWarnings("removal")
315+
private String getTempDirectoryPrefix(WebAppContext context) {
316+
try {
317+
return ((JettyEmbeddedWebAppContext) context).getCanonicalNameForTmpDir();
318+
}
319+
catch (Throwable ex) {
320+
return WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context);
321+
}
314322
}
315323

316324
private void configureDocumentRoot(WebAppContext handler) {

0 commit comments

Comments
 (0)