Class FileServerHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
-
- pro.gravit.launchserver.socket.handlers.fileserver.FileServerHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class FileServerHandler extends io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.format.DateTimeFormatterdateFormatterstatic intHTTP_CACHE_SECONDSstatic java.lang.StringREAD
-
Constructor Summary
Constructors Constructor Description FileServerHandler(java.nio.file.Path base, boolean fullOut, boolean showHiddenFiles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest request)voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)-
Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
dateFormatter
public static final java.time.format.DateTimeFormatter dateFormatter
-
READ
public static final java.lang.String READ
- See Also:
- Constant Field Values
-
HTTP_CACHE_SECONDS
public static final int HTTP_CACHE_SECONDS
-
-
Method Detail
-
channelRead0
public void channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest request) throws java.lang.Exception- Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-
-