类 FileOut

java.lang.Object
com.gdxsoft.easyweb.script.servlets.FileOut

public class FileOut extends Object
  • 字段详细资料

  • 构造器详细资料

    • FileOut

      public FileOut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
  • 方法详细资料

    • getImageResizedFile

      public static File getImageResizedFile(File image, String resize)
    • getImageResize

      public static Dimension getImageResize(String resize)
      Parse the size string to the dimension, filter invalid char
      参数:
      resize - 800x600
      返回:
      null or dimension
    • initFile

      public boolean initFile(String filePath)
    • outBufferedImage

      public boolean outBufferedImage(BufferedImage image)
    • initFile

      public boolean initFile(File file)
    • outContetType

      public void outContetType()
    • outContetType

      public void outContetType(String ext)
    • addCacheControl

      public void addCacheControl(Long cacheLife)
    • chcekIfNotModified

      public boolean chcekIfNotModified()
    • download

      public int download(String downloadName)
      Download the file
      参数:
      downloadName -
    • outFileBytesInline

      public int outFileBytesInline()
      Out file bytes in-line, e.g. image, pdf, and check the header flag If-Modified(304) and output the header Cache-control(OneWeek)
      返回:
      The length of the file
    • outFileBytesInline

      public int outFileBytesInline(boolean checkIfModified, Long cacheLife)
      Out file bytes in-line, e.g. image, pdf
      参数:
      checkIfModified - Whether to check the header If-Modified flag (304)
      cacheLife - Whether to output the Cache-Control header
      返回:
      The length of the file
    • outFileBytesInline

      public int outFileBytesInline(RestfulResult<Object> result, boolean checkIfModified, Long cacheLife)
    • outFileBytesToClient

      public int outFileBytesToClient()
      Out the file's bytes to user client(response)
      参数:
      file - the file
      response - HttpServletResponse
      返回:
      out bytes length
    • getRequest

      public javax.servlet.http.HttpServletRequest getRequest()
    • getResponse

      public javax.servlet.http.HttpServletResponse getResponse()
    • getFile

      public File getFile()
    • getHttpStatusCode

      public int getHttpStatusCode()