程序包 com.sh.handler
类 HttpFileRequest
java.lang.Object
com.sh.handler.HttpFileRequest
- 直接已知子类:
HttpZipRequest
Description:
Title:首亨软件 - TSS/CRM等
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected static FilecheckAndWaitFile(File fileObj, Map<String, String> parmMap) 判断如果文件不存在时,是否等待指定时间后再次检测protected static FilecheckNotExistsDirEx(File fileObj, String baseDir) 文件不存在时,从扩展路径中去取protected static boolean检查权限convertPath2FileList(File sourceFile, Map<String, String> paramMap, int zipFileNameIndex) 将URL中的path参数进行转换为文件对象static HttpFileRequestvoidprocess(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest request) protected void获取参数,转换为对应的文件的别名,如:压缩文件指定压缩包里的文件名protected static voidsendError(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpResponseStatus status, io.netty.handler.codec.http.FullHttpRequest request, String msg) protected static voidsendNotModified(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest request) When file timestamp is the same as what the browser is sending up, send a "304 Not Modified"protected static voidsetDateAndCacheHeaders(io.netty.handler.codec.http.HttpResponse response, File fileToCache) Sets the Date and Cache headers for the HTTP Responseprotected static voidsetDateHeader(io.netty.handler.codec.http.FullHttpResponse response)
-
字段详细资料
-
构造器详细资料
-
HttpFileRequest
protected HttpFileRequest()
-
-
方法详细资料
-
getInstance
-
process
public void process(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest request) throws Exception - 抛出:
Exception
-
convertPath2FileList
protected List<FileInfo> convertPath2FileList(File sourceFile, Map<String, String> paramMap, int zipFileNameIndex) 将URL中的path参数进行转换为文件对象- 参数:
sourceFile- 默认文件,有可能为空paramMap-zipFileNameIndex- 自定义文件名开始索引 -1 不检查- 返回:
-
processFileToFileName
获取参数,转换为对应的文件的别名,如:压缩文件指定压缩包里的文件名- 参数:
fileList-paramMap-
-
setDateHeader
protected static void setDateHeader(io.netty.handler.codec.http.FullHttpResponse response) -
sendError
protected static void sendError(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpResponseStatus status, io.netty.handler.codec.http.FullHttpRequest request, String msg) -
sendNotModified
protected static void sendNotModified(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest request) When file timestamp is the same as what the browser is sending up, send a "304 Not Modified"- 参数:
ctx-request-
-
setDateAndCacheHeaders
protected static void setDateAndCacheHeaders(io.netty.handler.codec.http.HttpResponse response, File fileToCache) Sets the Date and Cache headers for the HTTP Response- 参数:
response-fileToCache-
-
checkNotExistsDirEx
文件不存在时,从扩展路径中去取- 参数:
fileObj-- 返回:
- 只有有效的扩展文件夹时才返回
-
checkAndWaitFile
判断如果文件不存在时,是否等待指定时间后再次检测- 参数:
fileObj-- 返回:
-
checkVcl
检查权限- 参数:
paramMap-path-- 返回:
-