-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
138 changed files
with
3,984 additions
and
586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
core/src/main/java/org/kohsuke/stapler/CompatibleFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.kohsuke.stapler; | ||
|
||
import jakarta.servlet.Filter; | ||
import jakarta.servlet.FilterChain; | ||
import jakarta.servlet.FilterConfig; | ||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.ServletRequest; | ||
import jakarta.servlet.ServletResponse; | ||
import java.io.IOException; | ||
|
||
public interface CompatibleFilter extends Filter { | ||
/** | ||
* @deprecated use {@link #init(FilterConfig)} | ||
*/ | ||
@Deprecated | ||
default void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException { | ||
try { | ||
init(filterConfig.toJakartaFilterConfig()); | ||
} catch (ServletException e) { | ||
throw javax.servlet.ServletException.fromJakartaServletException(e); | ||
} | ||
} | ||
|
||
/** | ||
* @deprecated use {@link #doFilter(ServletRequest, ServletResponse, FilterChain)} | ||
*/ | ||
@Deprecated | ||
default void doFilter( | ||
javax.servlet.ServletRequest request, | ||
javax.servlet.ServletResponse response, | ||
javax.servlet.FilterChain chain) | ||
throws IOException, javax.servlet.ServletException { | ||
try { | ||
if (request instanceof javax.servlet.http.HttpServletRequest | ||
&& response instanceof javax.servlet.http.HttpServletResponse) { | ||
javax.servlet.http.HttpServletRequest httpRequest = (javax.servlet.http.HttpServletRequest) request; | ||
javax.servlet.http.HttpServletResponse httpResponse = (javax.servlet.http.HttpServletResponse) response; | ||
doFilter( | ||
httpRequest.toJakartaHttpServletRequest(), | ||
httpResponse.toJakartaHttpServletResponse(), | ||
chain.toJakartaFilterChain()); | ||
} else { | ||
doFilter( | ||
request.toJakartaServletRequest(), | ||
response.toJakartaServletResponse(), | ||
chain.toJakartaFilterChain()); | ||
} | ||
} catch (ServletException e) { | ||
throw javax.servlet.ServletException.fromJakartaServletException(e); | ||
} | ||
} | ||
} |
Oops, something went wrong.