类 HttpHeaderUtils

java.lang.Object
com.github.aqiu202.util.http.HttpHeaderUtils

public abstract class HttpHeaderUtils extends Object
  • 构造器详细资料

    • HttpHeaderUtils

      public HttpHeaderUtils()
  • 方法详细资料

    • getContentType

      public static String getContentType(String typeName)
      得到需要写入的 html http 类型
      参数:
      typeName - 类型名,一般以后缀名呈现
      返回:
      String
    • setHeaderForDownload

      public static void setHeaderForDownload(jakarta.servlet.http.HttpServletResponse response, String typeName, String fileName)
      设置返回头
      参数:
      response - 响应对象
      fileName - 文件名
      typeName - 类型名
    • setContentType

      public static void setContentType(jakarta.servlet.http.HttpServletResponse response, String fileName)
    • setHeaderForDownload

      public static void setHeaderForDownload(jakarta.servlet.http.HttpServletResponse response, String fileName)
      设置返回头
      参数:
      response - 响应对象
      fileName - 文件名
    • buildContentDisposition

      public static String buildContentDisposition(String fileName)
    • formatAttachmentFileName

      public static String formatAttachmentFileName(String fileName)
    • main

      public static void main(String[] args)