Skip to content

Commit a839cbd

Browse files
committed
Merge branch '3.3.x'
Closes gh-41829
2 parents 7343254 + 7f6f95e commit a839cbd

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
@@ -931,7 +931,7 @@ bom {
931931
]
932932
}
933933
}
934-
library("Jetty", "12.0.11") {
934+
library("Jetty", "12.0.12") {
935935
group("org.eclipse.jetty.ee10") {
936936
imports = [
937937
"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
@@ -309,9 +309,17 @@ private void addLocaleMappings(WebAppContext context) {
309309

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

317325
private void configureDocumentRoot(WebAppContext handler) {

0 commit comments

Comments
 (0)