public abstract class ResourceServlet
extends javax.servlet.http.HttpServlet
| 限定符和类型 | 字段和说明 |
|---|---|
protected List<IPRange> |
allowList |
protected List<IPRange> |
denyList |
private static Log |
LOG |
static String |
PARAM_NAME_ALLOW |
static String |
PARAM_NAME_DENY |
static String |
PARAM_NAME_PASSWORD |
static String |
PARAM_NAME_USERNAME |
static String |
PARAM_REMOTE_ADDR |
protected String |
password |
protected String |
remoteAddressHeader |
protected String |
resourcePath |
static String |
SESSION_USER_KEY |
protected String |
username |
| 构造器和说明 |
|---|
ResourceServlet(String resourcePath) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkLoginParam(javax.servlet.http.HttpServletRequest request) |
boolean |
ContainsUser(javax.servlet.http.HttpServletRequest request) |
protected String |
getFilePath(String fileName) |
protected String |
getRemoteAddress(javax.servlet.http.HttpServletRequest request) |
void |
init() |
private void |
initAuthEnv() |
boolean |
isPermittedRequest(javax.servlet.http.HttpServletRequest request) |
boolean |
isPermittedRequest(String remoteAddress) |
boolean |
isRequireAuth() |
protected abstract String |
process(String url) |
protected void |
returnResourceFile(String fileName,
String uri,
javax.servlet.http.HttpServletResponse response) |
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceprivate static final Log LOG
protected String username
protected String password
protected final String resourcePath
protected String remoteAddressHeader
public ResourceServlet(String resourcePath)
public void init()
throws javax.servlet.ServletException
init 在类中 javax.servlet.GenericServletjavax.servlet.ServletExceptionprivate void initAuthEnv()
public boolean isPermittedRequest(String remoteAddress)
protected void returnResourceFile(String fileName, String uri, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
javax.servlet.ServletExceptionIOExceptionpublic void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
service 在类中 javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic boolean ContainsUser(javax.servlet.http.HttpServletRequest request)
public boolean checkLoginParam(javax.servlet.http.HttpServletRequest request)
public boolean isRequireAuth()
public boolean isPermittedRequest(javax.servlet.http.HttpServletRequest request)
protected String getRemoteAddress(javax.servlet.http.HttpServletRequest request)
Copyright © 2013–2019 Alibaba Group. All rights reserved.