程序包 com.sh.handler

类 HttpFileRequest

java.lang.Object
com.sh.handler.HttpFileRequest
直接已知子类:
HttpZipRequest

public class HttpFileRequest extends Object

Description:

Title:首亨软件 - TSS/CRM等

  • 字段详细资料

    • HTTP_DATE_FORMAT

      public static final String HTTP_DATE_FORMAT
      另请参阅:
    • HTTP_DATE_GMT_TIMEZONE

      public static final String HTTP_DATE_GMT_TIMEZONE
      另请参阅:
    • HTTP_CACHE_SECONDS

      public static final int HTTP_CACHE_SECONDS
      另请参阅:
  • 构造器详细资料

    • HttpFileRequest

      protected HttpFileRequest()
  • 方法详细资料

    • getInstance

      public static 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

      protected void processFileToFileName(List<FileInfo> fileList, Map<String,String> paramMap)
      获取参数,转换为对应的文件的别名,如:压缩文件指定压缩包里的文件名
      参数:
      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

      protected static File checkNotExistsDirEx(File fileObj, String baseDir)
      文件不存在时,从扩展路径中去取
      参数:
      fileObj -
      返回:
      只有有效的扩展文件夹时才返回
    • checkAndWaitFile

      protected static File checkAndWaitFile(File fileObj, Map<String,String> parmMap)
      判断如果文件不存在时,是否等待指定时间后再次检测
      参数:
      fileObj -
      返回:
    • checkVcl

      protected static boolean checkVcl(Map<String,String> paramMap, String path)
      检查权限
      参数:
      paramMap -
      path -
      返回: