mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
Early support for Jakarta Servlet 6.2 and Jakarta Activation 2.2
Closes gh-35670
This commit is contained in:
+6
@@ -19,6 +19,7 @@ package org.springframework.mail.javamail;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import jakarta.activation.FileTypeMap;
|
||||
import jakarta.activation.MimetypesFileTypeMap;
|
||||
@@ -178,4 +179,9 @@ public class ConfigurableMimeFileTypeMap extends FileTypeMap implements Initiali
|
||||
return getFileTypeMap().getContentType(fileName);
|
||||
}
|
||||
|
||||
// @Override - on Activation 2.2
|
||||
public String getContentType(Path path) {
|
||||
return getFileTypeMap().getContentType(path.getFileName().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ import org.springframework.web.util.WebUtils;
|
||||
/**
|
||||
* Mock implementation of the {@link jakarta.servlet.http.HttpServletResponse} interface.
|
||||
*
|
||||
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
|
||||
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Rod Johnson
|
||||
@@ -827,6 +827,10 @@ public class MockHttpServletResponse implements HttpServletResponse {
|
||||
return this.errorMessage;
|
||||
}
|
||||
|
||||
// @Override - on Servlet 6.2
|
||||
public void sendEarlyHints() {
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Methods for MockRequestDispatcher
|
||||
|
||||
+5
-1
@@ -55,7 +55,7 @@ import org.springframework.web.util.WebUtils;
|
||||
/**
|
||||
* Mock implementation of the {@link jakarta.servlet.http.HttpServletResponse} interface.
|
||||
*
|
||||
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
|
||||
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Rod Johnson
|
||||
@@ -827,6 +827,10 @@ public class MockHttpServletResponse implements HttpServletResponse {
|
||||
return this.errorMessage;
|
||||
}
|
||||
|
||||
// @Override - on Servlet 6.2
|
||||
public void sendEarlyHints() {
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
// Methods for MockRequestDispatcher
|
||||
|
||||
+5
-2
@@ -660,7 +660,6 @@ class DefaultServerRequest implements ServerRequest {
|
||||
return this.headers.headerNames();
|
||||
}
|
||||
|
||||
|
||||
// Unsupported
|
||||
|
||||
@Override
|
||||
@@ -713,7 +712,6 @@ class DefaultServerRequest implements ServerRequest {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCharacterEncoding() {
|
||||
throw new UnsupportedOperationException();
|
||||
@@ -793,6 +791,11 @@ class DefaultServerRequest implements ServerRequest {
|
||||
public Locale getLocale() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
// @Override - on Servlet 6.2
|
||||
public void sendEarlyHints() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user