This repository was archived by the owner on Jul 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/com/kttdevelopment/simplehttpserver/handler Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .kttdevelopment .simplehttpserver .handler ;
2+
3+ import com .sun .net .httpserver .HttpExchange ;
4+ import com .sun .net .httpserver .HttpHandler ;
5+
6+ import java .io .IOException ;
7+
8+ public class TemporaryHandler implements HttpHandler {
9+
10+ private final HttpHandler handler ;
11+
12+ public TemporaryHandler (final HttpHandler handler ){
13+ this .handler = handler ;
14+ }
15+
16+ public TemporaryHandler (final HttpHandler handler , final long maxTime ){
17+ this .handler = handler ;
18+ }
19+
20+ @ Override
21+ public final void handle (final HttpExchange exchange ) throws IOException {
22+ handler .handle (exchange );
23+ exchange .getHttpContext ().getServer ().removeContext (exchange .getHttpContext ());
24+ }
25+
26+ }
You can’t perform that action at this time.
0 commit comments