- java.lang.Object
-
- org.redkale.net.Servlet<HttpContext,HttpRequest,HttpResponse>
-
- org.redkale.net.http.HttpServlet
-
- org.redkale.net.http.HttpResourceServlet
-
public class HttpResourceServlet extends HttpServlet
静态资源HttpServlet详情见: https://redkale.org
- 作者:
- zhangjx
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static classHttpResourceServlet.FileEntryprotected classHttpResourceServlet.WatchThread-
从类继承的嵌套类/接口 org.redkale.net.http.HttpServlet
HttpServlet.ActionEntry
-
-
字段概要
字段 修饰符和类型 字段 说明 protected LongAddercachedLengthprotected longcachelengthmaxprotected longcachelimitprotected ConcurrentHashMap<String,HttpResourceServlet.FileEntry>filesprotected StringindexHtmlprotected ConcurrentHashMap<WatchKey,Path>keymapsprotected AbstractMap.SimpleEntry<Pattern,String>[]locationRewritesprotected Loggerloggerprotected String[]renderSuffixsprotected Filerootprotected booleanwatchprotected HttpResourceServlet.WatchThreadwatchThread-
从类继承的字段 org.redkale.net.Servlet
_nonBlocking
-
-
构造器概要
构造器 构造器 说明 HttpResourceServlet()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 protected HttpResourceServlet.FileEntrycreateFileEntry(String uri)voiddestroy(HttpContext context, AnyValue config)voidexecute(HttpRequest request, HttpResponse response)voidinit(HttpContext context, AnyValue config)protected static longparseLenth(String value, long defValue)voidsetRoot(File file)voidsetRoot(String rootstr)-
从类继承的方法 org.redkale.net.http.HttpServlet
authenticate, finish404, finish405, postStart, preExecute
-
从类继承的方法 org.redkale.net.Servlet
isNonBlocking
-
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
cachedLength
protected final LongAdder cachedLength
-
cachelimit
protected long cachelimit
-
cachelengthmax
protected long cachelengthmax
-
watch
protected boolean watch
-
root
protected File root
-
indexHtml
protected String indexHtml
-
files
protected final ConcurrentHashMap<String,HttpResourceServlet.FileEntry> files
-
keymaps
protected final ConcurrentHashMap<WatchKey,Path> keymaps
-
locationRewrites
protected AbstractMap.SimpleEntry<Pattern,String>[] locationRewrites
-
watchThread
protected HttpResourceServlet.WatchThread watchThread
-
renderSuffixs
protected String[] renderSuffixs
-
-
方法详细资料
-
init
public void init(HttpContext context, AnyValue config)
- 覆盖:
init在类中Servlet<HttpContext,HttpRequest,HttpResponse>
-
destroy
public void destroy(HttpContext context, AnyValue config)
- 覆盖:
destroy在类中Servlet<HttpContext,HttpRequest,HttpResponse>
-
setRoot
public void setRoot(String rootstr)
-
setRoot
public void setRoot(File file)
-
parseLenth
protected static long parseLenth(String value, long defValue)
-
execute
public void execute(HttpRequest request, HttpResponse response) throws IOException
- 覆盖:
execute在类中HttpServlet- 抛出:
IOException
-
createFileEntry
protected HttpResourceServlet.FileEntry createFileEntry(String uri)
-
-