StaticServer.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:MarketData 作者:
public HttpServer<ByteBuf, ByteBuf> createServer() {
    try {
        final String ideBasePath = new File(".").getCanonicalPath();
        final File rootDirectory;
        if (ideBasePath.contains(rootDir)) {
            // for eclipse
            rootDirectory = new File(".");
        } else {
            // for intellij
            rootDirectory = new File(rootDir);
        }
        return RxNetty.createHttpServer(port,
                RequestHandlerWithErrorMapper.from(
                        new LocalDirectoryRequestHandler(rootDirectory),
                        new FileErrorResponseMapper()));
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号