diff --git a/build.gradle b/build.gradle index 2708ae7..f6f62f4 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ sourceSets { } dependencies { api project (":common") - api 'io.netty:netty-tcnative-boringssl-static:2.0.41.Final' + api 'io.netty:netty-tcnative-boringssl-static:2.0.46.Final' api 'com.google.code.gson:gson:2.8.8' testImplementation 'junit:junit:4.13.2' diff --git a/src/main/src/org/bdware/server/CMDConf.java b/src/main/src/org/bdware/server/CMDConf.java index 4ba8d7e..458362e 100644 --- a/src/main/src/org/bdware/server/CMDConf.java +++ b/src/main/src/org/bdware/server/CMDConf.java @@ -1,6 +1,5 @@ package org.bdware.server; -import com.google.gson.Gson; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bdware.sc.util.JsonUtil; @@ -39,7 +38,7 @@ public class CMDConf { public String clientToClusterPlugins = ""; public String tcpPlugins = ""; - public static CMDConf parseConf(String confPath) { + public static CMDConf parseFile(String confPath) { CMDConf ret = null; File conf = new File(confPath); if (conf.exists()) { @@ -49,7 +48,7 @@ public class CMDConf { while (null != (temp = br.readLine())) { sbl.append(temp); } - ret = new Gson().fromJson(sbl.toString(), CMDConf.class); + ret = JsonUtil.fromJson(sbl.toString(), CMDConf.class); } catch (IOException ignored) { LOGGER.warn("parsing configure from file failed!"); } diff --git a/src/main/src/org/bdware/server/http/HttpFileHandleAdapter.java b/src/main/src/org/bdware/server/http/HttpFileHandleAdapter.java index eedf0d9..b3dc875 100644 --- a/src/main/src/org/bdware/server/http/HttpFileHandleAdapter.java +++ b/src/main/src/org/bdware/server/http/HttpFileHandleAdapter.java @@ -15,9 +15,8 @@ import java.io.RandomAccessFile; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; public class HttpFileHandleAdapter extends SimpleChannelInboundHandler { - - FileFilter fileFilter; private final String location; + FileFilter fileFilter; public HttpFileHandleAdapter(String path, FileFilter fileFilter) { location = path;