From 995ae186830b92fb3ba59db53716f970cef9ed33 Mon Sep 17 00:00:00 2001 From: Katsute Date: Sun, 10 May 2020 12:19:45 -0400 Subject: [PATCH 1/4] Convert SimpleHttpExchange Impl to extends +suppression --- .../SimpleHttpExchangeImpl.java | 712 +++++++++--------- 1 file changed, 352 insertions(+), 360 deletions(-) diff --git a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java index 257de0e..2198ead 100644 --- a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java +++ b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java @@ -17,11 +17,54 @@ * * @see SimpleHttpExchange * @since 02.00.00 - * @version 02.03.00 + * @version 03.04.00 * @author Ktt Development */ @SuppressWarnings("SpellCheckingInspection") -abstract class SimpleHttpExchangeImpl { +class SimpleHttpExchangeImpl extends SimpleHttpExchange { + + private final HttpServer httpServer; + private final HttpExchange httpExchange; + + private final URI URI; + private final InetSocketAddress publicAddr, localAddr; + + private final HttpContext httpContext; + private final HttpPrincipal httpPrincipal; + private final String protocol; + + private final Headers requestHeaders; + private final RequestMethod requestMethod; + + private final String rawGet; + private final HashMap getMap; + private final boolean hasGet; + + private final String rawPost; + @SuppressWarnings("rawtypes") + private final HashMap postMap; + private final boolean hasPost; + + private final HashMap cookies; + + private final OutputStream outputStream; + + @SuppressWarnings("FieldCanBeLocal") + private final Function> parseWwwFormEnc = s -> { + final LinkedHashMap OUT = new LinkedHashMap<>(); + final String[] pairs = s.split("&"); + + for(final String pair : pairs){ + if(pair.contains("=")){ + final String[] kv = pair.split("="); + OUT.put( + URLDecoder.decode(kv[0],StandardCharsets.UTF_8), + kv.length == 2 ? URLDecoder.decode(kv[1],StandardCharsets.UTF_8) : null + ); + } + } + return OUT; + }; /** * Creates a {@link SimpleHttpExchange}. @@ -34,420 +77,369 @@ abstract class SimpleHttpExchangeImpl { * @since 02.00.00 * @author Ktt Development */ - @SuppressWarnings({"rawtypes","unchecked"}) - static SimpleHttpExchange createSimpleHttpExchange(final HttpExchange exchange){ - return new SimpleHttpExchange() { - - private final HttpServer httpServer; - private final HttpExchange httpExchange; - - private final URI URI; - private final InetSocketAddress publicAddr, localAddr; - - private final HttpContext httpContext; - private final HttpPrincipal httpPrincipal; - private final String protocol; - - private final Headers requestHeaders; - private final RequestMethod requestMethod; - - private final String rawGet; - private final HashMap getMap; - private final boolean hasGet; - - private final String rawPost; - @SuppressWarnings("rawtypes") - private final HashMap postMap; - private final boolean hasPost; - - private final HashMap cookies; - - private final OutputStream outputStream; - - // - - private final Function> parseWwwFormEnc = s -> { - final LinkedHashMap OUT = new LinkedHashMap<>(); - final String[] pairs = s.split("&"); - - for(final String pair : pairs){ - if(pair.contains("=")){ - final String[] kv = pair.split("="); - OUT.put( - URLDecoder.decode(kv[0],StandardCharsets.UTF_8), - kv.length == 2 ? URLDecoder.decode(kv[1],StandardCharsets.UTF_8) : null - ); - } - } - return OUT; - }; - - // - - { - httpServer = (httpContext = exchange.getHttpContext()).getServer(); - httpExchange = exchange; - // - URI = httpExchange.getRequestURI(); - publicAddr = httpExchange.getRemoteAddress(); - localAddr = httpExchange.getLocalAddress(); - // - httpPrincipal = httpExchange.getPrincipal(); - protocol = httpExchange.getProtocol(); - // - requestHeaders = httpExchange.getRequestHeaders(); - switch(exchange.getRequestMethod()){ - case "GET": - requestMethod = RequestMethod.GET; break; - case "HEAD": - requestMethod = RequestMethod.HEAD; break; - case "POST": - requestMethod = RequestMethod.POST; break; - case "PUT": - requestMethod = RequestMethod.PUT; break; - case "DELETE": - requestMethod = RequestMethod.DELETE; break; - case "CONNECT": - requestMethod = RequestMethod.CONNECT; break; - case "OPTIONS": - requestMethod = RequestMethod.OPTIONS; break; - case "TRACE": - requestMethod = RequestMethod.TRACE; break; - case "PATCH": - requestMethod = RequestMethod.PATCH; break; - default: - requestMethod = RequestMethod.UNSUPPORTED; break; - } - // - hasGet = (rawGet = URI.getQuery()) != null; - getMap = hasGet ? parseWwwFormEnc.apply(rawGet) : new HashMap<>(); - - // - String OUT; - - try(InputStream IN = httpExchange.getRequestBody(); final Scanner scanner = new Scanner(IN, StandardCharsets.UTF_8)){ - OUT = scanner.useDelimiter("\\A").next(); - }catch(final IOException | NoSuchElementException ignored){ - OUT = null; - } + static SimpleHttpExchange create(final HttpExchange exchange){ + return new SimpleHttpExchangeImpl(exchange); + } - hasPost = (rawPost = OUT) != null; - - if(hasPost){ - final String content_type = requestHeaders.getFirst("Content-type"); - if(content_type != null && content_type.startsWith("multipart/form-data")){ - final Pattern boundaryHeaderPattern = Pattern.compile("(.*): (.*?)(?:$|; )(.*)"); // returns the headers listed after each webkit boundary - final Pattern contentDispositionKVPPattern = Pattern.compile("(.*?)=\"(.*?)\"(?:; |$)"); // returns the keys, values, and parameters for the content disposition header - - final String webkitBoundary = content_type.substring(content_type.indexOf("; boundary=") + 11); - final String startBoundary = "--" + webkitBoundary + "\r\n"; - final String endBoundary = "--" + webkitBoundary + "--\r\n"; // the final boundary in the request - - postMap = new HashMap<>(); - final String[] pairs = OUT.replace(endBoundary,"").split(Pattern.quote(startBoundary)); - for(String pair : pairs){ - final HashMap postHeaders = new HashMap<>(); - if(pair.contains("\r\n\r\n")){ - final String[] headers = pair.substring(0, pair.indexOf("\r\n\r\n")).split("\r\n"); - - for (String header : headers) { - final HashMap headerMap = new HashMap<>(); - final HashMap val = new HashMap<>(); - - final Matcher headerMatcher = boundaryHeaderPattern.matcher(header); - if (headerMatcher.find()) { - final Matcher contentDispositionKVPMatcher = contentDispositionKVPPattern.matcher(headerMatcher.group(3)); - while (contentDispositionKVPMatcher.find()) - val.put(contentDispositionKVPMatcher.group(1), contentDispositionKVPMatcher.group(2)); - - headerMap.put("header-name", headerMatcher.group(1)); - headerMap.put("header-value", headerMatcher.group(2)); - headerMap.put("parameter", val); - } - postHeaders.put((String) headerMap.get("header-name"), headerMap); - } - - final HashMap row = new HashMap(); - row.put("headers",postHeaders); - row.put("value",pair.substring(pair.indexOf("\r\n\r\n")+4,pair.lastIndexOf("\r\n"))); - - postMap.put( - ((HashMap) postHeaders.get("Content-Disposition").get("parameter")).get("name"), - row - ); + @SuppressWarnings({"unchecked", "rawtypes"}) + SimpleHttpExchangeImpl(final HttpExchange exchange){ + httpServer = (httpContext = exchange.getHttpContext()).getServer(); + httpExchange = exchange; + // + URI = httpExchange.getRequestURI(); + publicAddr = httpExchange.getRemoteAddress(); + localAddr = httpExchange.getLocalAddress(); + // + httpPrincipal = httpExchange.getPrincipal(); + protocol = httpExchange.getProtocol(); + // + requestHeaders = httpExchange.getRequestHeaders(); + switch(exchange.getRequestMethod()){ + case "GET": + requestMethod = RequestMethod.GET; break; + case "HEAD": + requestMethod = RequestMethod.HEAD; break; + case "POST": + requestMethod = RequestMethod.POST; break; + case "PUT": + requestMethod = RequestMethod.PUT; break; + case "DELETE": + requestMethod = RequestMethod.DELETE; break; + case "CONNECT": + requestMethod = RequestMethod.CONNECT; break; + case "OPTIONS": + requestMethod = RequestMethod.OPTIONS; break; + case "TRACE": + requestMethod = RequestMethod.TRACE; break; + case "PATCH": + requestMethod = RequestMethod.PATCH; break; + default: + requestMethod = RequestMethod.UNSUPPORTED; break; + } + // + hasGet = (rawGet = URI.getQuery()) != null; + getMap = hasGet ? parseWwwFormEnc.apply(rawGet) : new HashMap<>(); + + // + String OUT; + + try(InputStream IN = httpExchange.getRequestBody(); final Scanner scanner = new Scanner(IN, StandardCharsets.UTF_8)){ + OUT = scanner.useDelimiter("\\A").next(); + }catch(final IOException | NoSuchElementException ignored){ + OUT = null; + } + + hasPost = (rawPost = OUT) != null; + + if(hasPost){ + final String content_type = requestHeaders.getFirst("Content-type"); + if(content_type != null && content_type.startsWith("multipart/form-data")){ + final Pattern boundaryHeaderPattern = Pattern.compile("(.*): (.*?)(?:$|; )(.*)"); // returns the headers listed after each webkit boundary + final Pattern contentDispositionKVPPattern = Pattern.compile("(.*?)=\"(.*?)\"(?:; |$)"); // returns the keys, values, and parameters for the content disposition header + + final String webkitBoundary = content_type.substring(content_type.indexOf("; boundary=") + 11); + final String startBoundary = "--" + webkitBoundary + "\r\n"; + final String endBoundary = "--" + webkitBoundary + "--\r\n"; // the final boundary in the request + + postMap = new HashMap<>(); + final String[] pairs = OUT.replace(endBoundary,"").split(Pattern.quote(startBoundary)); + for(String pair : pairs){ + final HashMap postHeaders = new HashMap<>(); + if(pair.contains("\r\n\r\n")){ + final String[] headers = pair.substring(0, pair.indexOf("\r\n\r\n")).split("\r\n"); + + for (String header : headers) { + final HashMap headerMap = new HashMap<>(); + final HashMap val = new HashMap<>(); + + final Matcher headerMatcher = boundaryHeaderPattern.matcher(header); + if (headerMatcher.find()) { + final Matcher contentDispositionKVPMatcher = contentDispositionKVPPattern.matcher(headerMatcher.group(3)); + while (contentDispositionKVPMatcher.find()) + val.put(contentDispositionKVPMatcher.group(1), contentDispositionKVPMatcher.group(2)); + + headerMap.put("header-name", headerMatcher.group(1)); + headerMap.put("header-value", headerMatcher.group(2)); + headerMap.put("parameter", val); } + postHeaders.put((String) headerMap.get("header-name"), headerMap); } - }else{ - postMap = parseWwwFormEnc.apply(rawPost); - } - }else{ - postMap = new HashMap(); - } - final String rawCookie = requestHeaders.getFirst("Cookie"); - cookies = new HashMap<>(); - if(rawCookie != null && !rawCookie.isEmpty()){ - final String[] cookedCookie = rawCookie.split("; "); // pair - for(final String pair : cookedCookie){ - String[] value = pair.split("="); - cookies.put(value[0],value[1]); + final HashMap row = new HashMap(); + row.put("headers",postHeaders); + row.put("value",pair.substring(pair.indexOf("\r\n\r\n")+4,pair.lastIndexOf("\r\n"))); + + postMap.put( + ((HashMap) postHeaders.get("Content-Disposition").get("parameter")).get("name"), + row + ); } } - - outputStream = exchange.getResponseBody(); + }else{ + postMap = parseWwwFormEnc.apply(rawPost); } + }else{ + postMap = new HashMap(); + } - // - - @Override - public final HttpServer getHttpServer(){ - return httpServer; + final String rawCookie = requestHeaders.getFirst("Cookie"); + cookies = new HashMap<>(); + if(rawCookie != null && !rawCookie.isEmpty()){ + final String[] cookedCookie = rawCookie.split("; "); // pair + for(final String pair : cookedCookie){ + String[] value = pair.split("="); + cookies.put(value[0],value[1]); } + } - @Override - public final HttpExchange getHttpExchange(){ - return httpExchange; - } + outputStream = exchange.getResponseBody(); + } - // + @Override + public final HttpServer getHttpServer(){ + return httpServer; + } - @Override - public final URI getURI(){ - return URI; - } + @Override + public final HttpExchange getHttpExchange(){ + return httpExchange; + } - @Override - public final InetSocketAddress getPublicAddress(){ - return publicAddr; - } +// - @Override - public final InetSocketAddress getLocalAddress(){ - return localAddr; - } + @Override + public final URI getURI(){ + return URI; + } - // + @Override + public final InetSocketAddress getPublicAddress(){ + return publicAddr; + } - @Override - public final HttpContext getHttpContext(){ - return httpContext; - } + @Override + public final InetSocketAddress getLocalAddress(){ + return localAddr; + } - @Override - public final HttpPrincipal getHttpPrincipal(){ - return httpPrincipal; - } +// - @Override - public final String getProtocol(){ - return protocol; - } + @Override + public final HttpContext getHttpContext(){ + return httpContext; + } - // + @Override + public final HttpPrincipal getHttpPrincipal(){ + return httpPrincipal; + } - @Override - public final Headers getRequestHeaders(){ - return requestHeaders; - } + @Override + public final String getProtocol(){ + return protocol; + } - @Override - public final RequestMethod getRequestMethod(){ - return requestMethod; - } + // - // + @Override + public final Headers getRequestHeaders(){ + return requestHeaders; + } - @Override - public final String getRawGet(){ - return rawGet; - } + @Override + public final RequestMethod getRequestMethod(){ + return requestMethod; + } - @Override - public final HashMap getGetMap(){ - return getMap; - } +// - @Override - public final boolean hasGet(){ - return hasGet; - } + @Override + public final String getRawGet(){ + return rawGet; + } - // + @Override + public final HashMap getGetMap(){ + return getMap; + } - @Override - public final String getRawPost(){ - return rawPost; - } + @Override + public final boolean hasGet(){ + return hasGet; + } - @Override @SuppressWarnings("rawtypes") - public final HashMap getPostMap(){ - return postMap; - } +// - @Override - public final boolean hasPost(){ - return hasPost; - } + @Override + public final String getRawPost(){ + return rawPost; + } - // + @Override @SuppressWarnings("rawtypes") + public final HashMap getPostMap(){ + return postMap; + } - @Override - public final Headers getResponseHeaders(){ - return httpExchange.getResponseHeaders(); - } + @Override + public final boolean hasPost(){ + return hasPost; + } - @Override - public final int getResponseCode(){ - return httpExchange.getResponseCode(); - } +// - // + @Override + public final Headers getResponseHeaders(){ + return httpExchange.getResponseHeaders(); + } + @Override + public final int getResponseCode(){ + return httpExchange.getResponseCode(); + } - @Override - public final HashMap getCookies(){ - return new HashMap<>(cookies); - } +// - @Override - public synchronized final void setCookie(final String key, final String value){ - setCookie(new SimpleHttpCookie.Builder(key,value).build()); - } - @Override - public synchronized final void setCookie(final SimpleHttpCookie cookie){ - final String cstring = cookie.toCookieHeaderString(); - getResponseHeaders().add("Set-Cookie",cstring); - } + @Override + public final HashMap getCookies(){ + return new HashMap<>(cookies); + } - // - - @Override - public final OutputStream getOutputStream(){ - return outputStream; - } + @Override + public synchronized final void setCookie(final String key, final String value){ + setCookie(new SimpleHttpCookie.Builder(key,value).build()); + } - // + @Override + public synchronized final void setCookie(final SimpleHttpCookie cookie){ + final String cstring = cookie.toCookieHeaderString(); + getResponseHeaders().add("Set-Cookie",cstring); + } - @Override - public synchronized final void sendResponseHeaders(final int code, final long length) throws IOException{ - httpExchange.sendResponseHeaders(code, length); - } +// - @Override - public synchronized final void send(final int responseCode) throws IOException{ - sendResponseHeaders(responseCode,0); - } + @Override + public final OutputStream getOutputStream(){ + return outputStream; + } - @Override - public synchronized final void send(final byte[] response) throws IOException{ - send(response, HttpCode.HTTP_OK, false); - } + // - @Override - public final void send(final byte[] response, final boolean gzip) throws IOException{ - send(response, HttpCode.HTTP_OK, gzip); - } + @Override + public synchronized final void sendResponseHeaders(final int code, final long length) throws IOException{ + httpExchange.sendResponseHeaders(code, length); + } - @Override - public synchronized final void send(final byte[] response, final int responseCode) throws IOException { - send(response,responseCode,false); - } + @Override + public synchronized final void send(final int responseCode) throws IOException{ + sendResponseHeaders(responseCode,0); + } - @Override - public final void send(final byte[] response, final int responseCode, final boolean gzip) throws IOException{ - if(gzip){ - exchange.getResponseHeaders().set("Accept-Encoding","gzip"); - exchange.getResponseHeaders().set("Content-Encoding","gzip"); - exchange.getResponseHeaders().set("Connection","keep-alive"); - sendResponseHeaders(responseCode, 0); - try(GZIPOutputStream OUT = new GZIPOutputStream(exchange.getResponseBody())){ - OUT.write(response); - OUT.finish(); - OUT.flush(); - } - }else{ - sendResponseHeaders(responseCode,response.length); - try(final OutputStream OUT = exchange.getResponseBody()){ - OUT.write(response); - OUT.flush(); - } - } - } + @Override + public synchronized final void send(final byte[] response) throws IOException{ + send(response, HttpCode.HTTP_OK, false); + } - @Override - public synchronized final void send(final String response) throws IOException{ - send(response.getBytes(StandardCharsets.UTF_8), HttpCode.HTTP_OK, false); - } + @Override + public final void send(final byte[] response, final boolean gzip) throws IOException{ + send(response, HttpCode.HTTP_OK, gzip); + } - @Override - public final void send(final String response, final boolean gzip) throws IOException{ - send(response.getBytes(StandardCharsets.UTF_8), HttpCode.HTTP_OK, gzip); - } + @Override + public synchronized final void send(final byte[] response, final int responseCode) throws IOException { + send(response,responseCode,false); + } - @Override - public synchronized final void send(final String response, final int responseCode) throws IOException{ - send(response.getBytes(StandardCharsets.UTF_8),responseCode,false); - } + @Override + public final void send(final byte[] response, final int responseCode, final boolean gzip) throws IOException{ + if(gzip){ + httpExchange.getResponseHeaders().set("Accept-Encoding","gzip"); + httpExchange.getResponseHeaders().set("Content-Encoding","gzip"); + httpExchange.getResponseHeaders().set("Connection","keep-alive"); + sendResponseHeaders(responseCode, 0); + try(GZIPOutputStream OUT = new GZIPOutputStream(httpExchange.getResponseBody())){ + OUT.write(response); + OUT.finish(); + OUT.flush(); + } + }else{ + sendResponseHeaders(responseCode,response.length); + try(final OutputStream OUT = httpExchange.getResponseBody()){ + OUT.write(response); + OUT.flush(); + } + } + } - @Override - public final void send(final String response, final int responseCode, final boolean gzip) throws IOException{ - send(response.getBytes(StandardCharsets.UTF_8),responseCode,gzip); - } + @Override + public synchronized final void send(final String response) throws IOException{ + send(response.getBytes(StandardCharsets.UTF_8), HttpCode.HTTP_OK, false); + } - // + @Override + public final void send(final String response, final boolean gzip) throws IOException{ + send(response.getBytes(StandardCharsets.UTF_8), HttpCode.HTTP_OK, gzip); + } - @Override - public synchronized final void close(){ - try{ - outputStream.close(); - }catch(final IOException ignored){ } - exchange.close(); - } + @Override + public synchronized final void send(final String response, final int responseCode) throws IOException{ + send(response.getBytes(StandardCharsets.UTF_8),responseCode,false); + } - // + @Override + public final void send(final String response, final int responseCode, final boolean gzip) throws IOException{ + send(response.getBytes(StandardCharsets.UTF_8),responseCode,gzip); + } - @Override - public final Object getAttribute(final String name){ - return httpExchange.getAttribute(name); - } + // - @Override - public synchronized final void setAttribute(final String name, final Object value){ - httpExchange.setAttribute(name, value); - } + @Override + public synchronized final void close(){ + try{ + outputStream.close(); + }catch(final IOException ignored){ } + httpExchange.close(); + } - // - - @SuppressWarnings("StringBufferReplaceableByString") - @Override - public final String toString(){ - final StringBuilder OUT = new StringBuilder(); - OUT.append("SimpleHttpExchange").append('{'); - OUT.append("httpServer") .append('=') .append(httpServer) .append(", "); - OUT.append("httpExchange") .append('=') .append(httpExchange) .append(", "); - OUT.append("URI") .append('=') .append(URI) .append(", "); - OUT.append("publicAddress") .append('=') .append(publicAddr) .append(", "); - OUT.append("localAddress") .append('=') .append(localAddr) .append(", "); - OUT.append("httpContext") .append('=') .append(httpContext) .append(", "); - OUT.append("httpPrincipal") .append('=') .append(httpPrincipal) .append(", "); - OUT.append("protocol") .append('=') .append(protocol) .append(", "); - OUT.append("requestHeaders") .append('=') .append(requestHeaders) .append(", "); - OUT.append("requestMethod") .append('=') .append(requestMethod) .append(", "); - OUT.append("responseHeaders") .append('=') .append(getResponseHeaders()) .append(", "); - OUT.append("responseCode") .append('=') .append(getResponseCode()) .append(", "); - OUT.append("rawGet") .append('=') .append(rawGet) .append(", "); - OUT.append("getMap") .append('=') .append(getMap) .append(", "); - OUT.append("hasGet") .append('=') .append(hasGet) .append(", "); - OUT.append("rawPost") .append('=') .append(rawPost) .append(", "); - OUT.append("postMap") .append('=') .append(postMap) .append(", "); - OUT.append("hasPost") .append('=') .append(hasPost) .append(", "); - OUT.append("cookies") .append('=') .append(cookies); - OUT.append('}'); - return OUT.toString(); - } +// - }; + @Override + public final Object getAttribute(final String name){ + return httpExchange.getAttribute(name); } + @Override + public synchronized final void setAttribute(final String name, final Object value){ + httpExchange.setAttribute(name, value); + } + +// + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public final String toString(){ + final StringBuilder OUT = new StringBuilder(); + OUT.append("SimpleHttpExchange").append('{'); + OUT.append("httpServer") .append('=') .append(httpServer) .append(", "); + OUT.append("httpExchange") .append('=') .append(httpExchange) .append(", "); + OUT.append("URI") .append('=') .append(URI) .append(", "); + OUT.append("publicAddress") .append('=') .append(publicAddr) .append(", "); + OUT.append("localAddress") .append('=') .append(localAddr) .append(", "); + OUT.append("httpContext") .append('=') .append(httpContext) .append(", "); + OUT.append("httpPrincipal") .append('=') .append(httpPrincipal) .append(", "); + OUT.append("protocol") .append('=') .append(protocol) .append(", "); + OUT.append("requestHeaders") .append('=') .append(requestHeaders) .append(", "); + OUT.append("requestMethod") .append('=') .append(requestMethod) .append(", "); + OUT.append("responseHeaders") .append('=') .append(getResponseHeaders()) .append(", "); + OUT.append("responseCode") .append('=') .append(getResponseCode()) .append(", "); + OUT.append("rawGet") .append('=') .append(rawGet) .append(", "); + OUT.append("getMap") .append('=') .append(getMap) .append(", "); + OUT.append("hasGet") .append('=') .append(hasGet) .append(", "); + OUT.append("rawPost") .append('=') .append(rawPost) .append(", "); + OUT.append("postMap") .append('=') .append(postMap) .append(", "); + OUT.append("hasPost") .append('=') .append(hasPost) .append(", "); + OUT.append("cookies") .append('=') .append(cookies); + OUT.append('}'); + return OUT.toString(); + } } From 623e0f2bcf804a564f41bebe2992a16c33356448 Mon Sep 17 00:00:00 2001 From: Katsute Date: Sun, 10 May 2020 12:20:45 -0400 Subject: [PATCH 2/4] Adapt --- .../kttdevelopment/simplehttpserver/SimpleHttpExchange.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchange.java b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchange.java index b5a35da..725ce9e 100644 --- a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchange.java +++ b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchange.java @@ -46,7 +46,7 @@ * * @see HttpExchange * @since 02.00.00 - * @version 02.00.00 + * @version 03.04.00 * @author Ktt Development */ @SuppressWarnings("SpellCheckingInspection") @@ -55,7 +55,7 @@ public abstract class SimpleHttpExchange { /** * Create an empty {@link SimpleHttpExchange}. Applications don't use this method. * - * @see SimpleHttpExchangeImpl#createSimpleHttpExchange(HttpExchange) + * @see SimpleHttpExchangeImpl#create(HttpExchange) * @since 02.00.00 * @author Ktt Development */ @@ -74,7 +74,7 @@ public abstract class SimpleHttpExchange { * @author Ktt Development */ static SimpleHttpExchange create(final HttpExchange exchange){ - return SimpleHttpExchangeImpl.createSimpleHttpExchange(exchange); + return SimpleHttpExchangeImpl.create(exchange); } // From 35358d9c3a5d0c2b935486f2721bc4c2915dcfce Mon Sep 17 00:00:00 2001 From: Katsute Date: Sun, 10 May 2020 12:21:15 -0400 Subject: [PATCH 3/4] final --- .../kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java index 2198ead..7ecf8fc 100644 --- a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java +++ b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java @@ -21,7 +21,7 @@ * @author Ktt Development */ @SuppressWarnings("SpellCheckingInspection") -class SimpleHttpExchangeImpl extends SimpleHttpExchange { +final class SimpleHttpExchangeImpl extends SimpleHttpExchange { private final HttpServer httpServer; private final HttpExchange httpExchange; From 832da19754aad5b4b395c00e140115e8e4a33057 Mon Sep 17 00:00:00 2001 From: Katsute <58778985+Katsute@users.noreply.github.com> Date: Sun, 10 May 2020 12:28:35 -0400 Subject: [PATCH 4/4] Update SimpleHttpExchangeImpl.java --- .../kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java index 7ecf8fc..7be8f09 100644 --- a/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java +++ b/src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java @@ -74,7 +74,7 @@ final class SimpleHttpExchangeImpl extends SimpleHttpExchange { * * @see SimpleHttpExchange * @see HttpExchange - * @since 02.00.00 + * @since 03.04.00 * @author Ktt Development */ static SimpleHttpExchange create(final HttpExchange exchange){