- 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 class
HttpResourceServlet.FileEntry
protected class
HttpResourceServlet.WatchThread
-
从类继承的嵌套类/接口 org.redkale.net.http.HttpServlet
HttpServlet.ActionEntry
-
-
字段概要
字段 修饰符和类型 字段 说明 protected LongAdder
cachedLength
protected long
cachelengthmax
protected long
cachelimit
protected ConcurrentHashMap<String,HttpResourceServlet.FileEntry>
files
protected String
indexHtml
protected ConcurrentHashMap<WatchKey,Path>
keymaps
protected AbstractMap.SimpleEntry<Pattern,String>[]
locationRewrites
protected Logger
logger
protected String[]
renderSuffixs
protected File
root
protected boolean
watch
protected HttpResourceServlet.WatchThread
watchThread
-
从类继承的字段 org.redkale.net.Servlet
_nonBlocking
-
-
构造器概要
构造器 构造器 说明 HttpResourceServlet()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 protected HttpResourceServlet.FileEntry
createFileEntry(String uri)
void
destroy(HttpContext context, AnyValue config)
void
execute(HttpRequest request, HttpResponse response)
void
init(HttpContext context, AnyValue config)
protected static long
parseLenth(String value, long defValue)
void
setRoot(File file)
void
setRoot(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)
-
-