Class RedirectHandler
- java.lang.Object
-
- com.kttdevelopment.simplehttpserver.handler.RedirectHandler
-
- All Implemented Interfaces:
SimpleHttpHandler,HttpHandler
public class RedirectHandler extends Object implements SimpleHttpHandler
A request handler that redirects to a different URL without pushing to the history. The URL may not work correctly if it does not have a valid authority (http/https).- Since:
- 01.00.00
- Version:
- 03.05.00
- Author:
- Ktt Development
- See Also:
SimpleHttpHandler,HttpHandler
-
-
Constructor Summary
Constructors Constructor Description RedirectHandler(String link)Creates a redirect to a URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(SimpleHttpExchange exchange)Handlers the given request and generates a response if no exceptions occur.voidhandle(HttpExchange exchange)Encapsulates theSimpleHttpHandler.handle(SimpleHttpExchange)for the authenticator.StringtoString()
-
-
-
Constructor Detail
-
RedirectHandler
public RedirectHandler(String link)
Creates a redirect to a URL.- Parameters:
link- URL to redirect to- Since:
- 01.00.00
-
-
Method Detail
-
handle
public final void handle(HttpExchange exchange) throws IOException
Description copied from interface:SimpleHttpHandlerEncapsulates theSimpleHttpHandler.handle(SimpleHttpExchange)for the authenticator. This method is reserved by the server; do not override this, it will break theSimpleHttpHandler.handle(SimpleHttpExchange)method.- Specified by:
handlein interfaceHttpHandler- Specified by:
handlein interfaceSimpleHttpHandler- Parameters:
exchange- client information- Throws:
IOException- internal failure
-
handle
public final void handle(SimpleHttpExchange exchange) throws IOException
Description copied from interface:SimpleHttpHandlerHandlers the given request and generates a response if no exceptions occur.- Specified by:
handlein interfaceSimpleHttpHandler- Parameters:
exchange- client information- Throws:
IOException- internal failure
-
-