add javadoc and rename AuthenticationState.ServeAs.PathWrapper

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2023-08-22 15:02:37 +10:00
parent a8832c4fa9
commit f0953e4d29
3 changed files with 9 additions and 3 deletions

View File

@ -304,8 +304,14 @@ public interface AuthenticationState extends Request.AuthenticationState
* changing its target to a given path. If a {@link Request} implements this interface it can
* be obtained with the {@link Request#as(Request, Class)} method.
*/
public interface Path
public interface PathWrapper
{
/**
* Wraps a request but changes the path so that it can be served to a different target.
* @param request the original request.
* @param path the path of the new target.
* @return the request wrapped to the new target.
*/
Request serveAs(Request request, String path);
}
}

View File

@ -365,7 +365,7 @@ public class FormAuthenticator extends LoginAuthenticator
@Override
public Request wrap(Request request)
{
ServeAs.Path serveAs = Request.as(request, ServeAs.Path.class);
PathWrapper serveAs = Request.as(request, PathWrapper.class);
if (serveAs != null)
return serveAs.serveAs(request, path);
return super.wrap(request);

View File

@ -54,7 +54,7 @@ import org.eclipse.jetty.util.Fields;
* This class is single use only.
* </p>
*/
public class ServletContextRequest extends ContextRequest implements ServletContextHandler.ServletRequestInfo, ServeAs.Path
public class ServletContextRequest extends ContextRequest implements ServletContextHandler.ServletRequestInfo, ServeAs.PathWrapper
{
public static final String MULTIPART_CONFIG_ELEMENT = "org.eclipse.jetty.multipartConfig";
static final int INPUT_NONE = 0;