类 FileOut
java.lang.Object
com.gdxsoft.easyweb.script.servlets.FileOut
-
字段概要
字段 -
构造器概要
构造器构造器说明FileOut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) -
方法概要
修饰符和类型方法说明voidaddCacheControl(Long cacheLife) booleanintDownload the filegetFile()intstatic DimensiongetImageResize(String resize) Parse the size string to the dimension, filter invalid charstatic FilegetImageResizedFile(File image, String resize) javax.servlet.http.HttpServletRequestjavax.servlet.http.HttpServletResponsebooleanbooleanbooleanoutBufferedImage(BufferedImage image) voidvoidoutContetType(String ext) intOut file bytes in-line, e.g. image, pdf, and check the header flag If-Modified(304) and output the header Cache-control(OneWeek)intoutFileBytesInline(boolean checkIfModified, Long cacheLife) Out file bytes in-line, e.g. image, pdfintoutFileBytesInline(RestfulResult<Object> result, boolean checkIfModified, Long cacheLife) intOut the file's bytes to user client(response)
-
字段详细资料
-
MAP
-
DEF_DOWNLOAD_TYPE
-
-
构造器详细资料
-
FileOut
public FileOut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
-
-
方法详细资料
-
getImageResizedFile
-
getImageResize
Parse the size string to the dimension, filter invalid char- 参数:
resize- 800x600- 返回:
- null or dimension
-
initFile
-
outBufferedImage
-
initFile
-
outContetType
public void outContetType() -
outContetType
-
addCacheControl
-
chcekIfNotModified
public boolean chcekIfNotModified() -
download
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
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 fileresponse- HttpServletResponse- 返回:
- out bytes length
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest() -
getResponse
public javax.servlet.http.HttpServletResponse getResponse() -
getFile
-
getHttpStatusCode
public int getHttpStatusCode()
-