diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SimpleServer.java b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SimpleServer.java index d2a11b9ac..1f130c825 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SimpleServer.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SimpleServer.java @@ -188,7 +188,7 @@ public class SimpleServer { * @return this */ public SimpleServer setRoot(final File root) { - this.engine.setHandler(new RootHandler(root)); + addAction("/", new RootHandler(root)); return this; } diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerBase.java b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerExchangeBase.java similarity index 92% rename from hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerBase.java rename to hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerExchangeBase.java index 98e5ab952..d45293013 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerBase.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerExchangeBase.java @@ -27,7 +27,7 @@ import java.io.Closeable; * @author looly * @since 5.2.6 */ -public class SunServerBase implements Closeable { +public class SunServerExchangeBase implements Closeable { protected final HttpExchange httpExchange; @@ -36,7 +36,7 @@ public class SunServerBase implements Closeable { * * @param httpExchange {@link HttpExchange} */ - public SunServerBase(final HttpExchange httpExchange) { + public SunServerExchangeBase(final HttpExchange httpExchange) { this.httpExchange = httpExchange; } diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerRequest.java b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerRequest.java index c9432d758..f1d298212 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerRequest.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerRequest.java @@ -47,7 +47,7 @@ import java.util.Map; * * @author Looly */ -public class SunServerRequest extends SunServerBase implements ServerRequest { +public class SunServerRequest extends SunServerExchangeBase implements ServerRequest { private Map cookieCache; private ListValueMap paramsCache; diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerResponse.java b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerResponse.java index acec7524a..b18559725 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerResponse.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/sun/SunServerResponse.java @@ -37,7 +37,7 @@ import java.util.Map; * @author looly * @since 6.0.0 */ -public class SunServerResponse extends SunServerBase implements ServerResponse { +public class SunServerResponse extends SunServerExchangeBase implements ServerResponse { private Charset charset; /**