public class HttpResourceServlet extends HttpServlet
详情见: https://redkale.org
限定符和类型 | 类和说明 |
---|---|
protected static class |
HttpResourceServlet.FileEntry |
protected class |
HttpResourceServlet.WatchThread |
HttpServlet.InnerActionEntry
限定符和类型 | 字段和说明 |
---|---|
protected java.util.concurrent.atomic.LongAdder |
cachedLength |
protected long |
cachelengthmax |
protected long |
cachelimit |
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,HttpResourceServlet.FileEntry> |
files |
protected java.lang.String |
indexHtml |
protected java.util.concurrent.ConcurrentHashMap<java.nio.file.WatchKey,java.nio.file.Path> |
keymaps |
protected java.util.AbstractMap.SimpleEntry<java.util.regex.Pattern,java.lang.String>[] |
locationRewrites |
protected java.util.logging.Logger |
logger |
protected java.io.File |
root |
protected boolean |
watch |
protected HttpResourceServlet.WatchThread |
watchThread |
RET_METHOD_ERROR, RET_SERVER_ERROR
构造器和说明 |
---|
HttpResourceServlet() |
限定符和类型 | 方法和说明 |
---|---|
protected HttpResourceServlet.FileEntry |
createFileEntry(java.lang.String uri) |
void |
destroy(HttpContext context,
AnyValue config) |
void |
execute(HttpRequest request,
HttpResponse response) |
void |
init(HttpContext context,
AnyValue config) |
protected static long |
parseLenth(java.lang.String value,
long defValue) |
void |
setRoot(java.io.File file) |
void |
setRoot(java.lang.String rootstr) |
authenticate, postStart, preExecute
protected final java.util.logging.Logger logger
protected final java.util.concurrent.atomic.LongAdder cachedLength
protected long cachelimit
protected long cachelengthmax
protected boolean watch
protected java.io.File root
protected java.lang.String indexHtml
protected final java.util.concurrent.ConcurrentHashMap<java.lang.String,HttpResourceServlet.FileEntry> files
protected final java.util.concurrent.ConcurrentHashMap<java.nio.file.WatchKey,java.nio.file.Path> keymaps
protected java.util.AbstractMap.SimpleEntry<java.util.regex.Pattern,java.lang.String>[] locationRewrites
protected HttpResourceServlet.WatchThread watchThread
public void init(HttpContext context, AnyValue config)
init
在类中 Servlet<HttpContext,HttpRequest,HttpResponse>
public void destroy(HttpContext context, AnyValue config)
destroy
在类中 Servlet<HttpContext,HttpRequest,HttpResponse>
public void setRoot(java.lang.String rootstr)
public void setRoot(java.io.File file)
protected static long parseLenth(java.lang.String value, long defValue)
public void execute(HttpRequest request, HttpResponse response) throws java.io.IOException
execute
在类中 HttpServlet
java.io.IOException
protected HttpResourceServlet.FileEntry createFileEntry(java.lang.String uri)