Merge branch '3.3.x'

Closes gh-41829
This commit is contained in:
Stéphane Nicoll 2024-08-12 16:13:35 +02:00
commit a839cbdb68
3 changed files with 17 additions and 4 deletions

View File

@ -931,7 +931,7 @@ bom {
] ]
} }
} }
library("Jetty", "12.0.11") { library("Jetty", "12.0.12") {
group("org.eclipse.jetty.ee10") { group("org.eclipse.jetty.ee10") {
imports = [ imports = [
"jetty-ee10-bom" "jetty-ee10-bom"

View File

@ -42,6 +42,11 @@ class JettyEmbeddedWebAppContext extends WebAppContext {
getContext().call(handler::deferredInitialize, null); getContext().call(handler::deferredInitialize, null);
} }
@Override
public String getCanonicalNameForTmpDir() {
return super.getCanonicalNameForTmpDir();
}
private static final class JettyEmbeddedServletHandler extends ServletHandler { private static final class JettyEmbeddedServletHandler extends ServletHandler {
@Override @Override

View File

@ -309,9 +309,17 @@ public class JettyServletWebServerFactory extends AbstractServletWebServerFactor
private File getTempDirectory(WebAppContext context) { private File getTempDirectory(WebAppContext context) {
String temp = System.getProperty("java.io.tmpdir"); String temp = System.getProperty("java.io.tmpdir");
return (temp != null) return (temp != null) ? new File(temp, getTempDirectoryPrefix(context) + UUID.randomUUID()) : null;
? new File(temp, WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context) + UUID.randomUUID()) }
: null;
@SuppressWarnings("removal")
private String getTempDirectoryPrefix(WebAppContext context) {
try {
return ((JettyEmbeddedWebAppContext) context).getCanonicalNameForTmpDir();
}
catch (Throwable ex) {
return WebInfConfiguration.getCanonicalNameForWebAppTmpDir(context);
}
} }
private void configureDocumentRoot(WebAppContext handler) { private void configureDocumentRoot(WebAppContext handler) {