public class FileRender extends Render
Modifier and Type | Field and Description |
---|---|
protected static String |
baseDownloadPath |
protected static String |
DEFAULT_CONTENT_TYPE |
protected String |
downloadFileName |
protected File |
file |
protected static javax.servlet.ServletContext |
servletContext |
Constructor and Description |
---|
FileRender(File file) |
FileRender(File file,
String downloadFileName) |
FileRender(String fileName) |
FileRender(String fileName,
String downloadFileName) |
Modifier and Type | Method and Description |
---|---|
String |
encodeFileName(javax.servlet.http.HttpServletRequest request,
String fileName)
依据浏览器判断编码规则
|
protected String |
encodeFileName(String fileName) |
protected void |
normalRender() |
protected void |
processRange(Long[] range)
Examples of byte-ranges-specifier values (assuming an entity-body of length 10000):
The first 500 bytes (byte offsets 0-499, inclusive): bytes=0-499
The second 500 bytes (byte offsets 500-999, inclusive): bytes=500-999
The final 500 bytes (byte offsets 9500-9999, inclusive): bytes=-500
Or bytes=9500-
|
protected void |
rangeRender() |
void |
render()
Render to client
|
getDevMode, getEncoding, getView, setContext, setContext, setView
protected static final String DEFAULT_CONTENT_TYPE
protected static String baseDownloadPath
protected static javax.servlet.ServletContext servletContext
protected File file
protected String downloadFileName
public FileRender(File file)
public FileRender(String fileName)
public void render()
Render
public String encodeFileName(javax.servlet.http.HttpServletRequest request, String fileName)
protected void normalRender()
protected void rangeRender()
protected void processRange(Long[] range)
Copyright © 2018. All rights reserved.