public class UploadedFileExtensionWhitelist extends BeanSupport implements UploadedFileFilter
| Constructor and Description |
|---|
UploadedFileExtensionWhitelist() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.commons.fileupload.FileItem |
filter(String key,
org.apache.commons.fileupload.FileItem file)
过滤指定文件,如果返回
null表示忽略该文件。 |
protected void |
init()
初始化bean。
|
boolean |
isFiltering(javax.servlet.http.HttpServletRequest request)
是否需要过滤,如果返回否,则对于该请求的所有参数均不执行该过滤器。
|
void |
setAllowedExtensions(String[] extensions) |
afterPropertiesSet, assertInitialized, destroy, dispose, getBeanDescription, getBeanDescription, getBeanInterface, getBeanName, isInitialized, postDispose, postInit, preDispose, preInit, resolveBeanInterface, setBeanName, toStringpublic void setAllowedExtensions(String[] extensions)
public boolean isFiltering(javax.servlet.http.HttpServletRequest request)
ParameterParserFilter有些filter可以根据URL来确定是否要过滤参数。
isFiltering in interface ParameterParserFilterprotected void init()
throws Exception
BeanSupportinit in class BeanSupportExceptionpublic org.apache.commons.fileupload.FileItem filter(String key, org.apache.commons.fileupload.FileItem file)
UploadedFileFilternull表示忽略该文件。
注意,file可能是null。
filter in interface UploadedFileFilterCopyright © 2006–2018 TinyGroup. All rights reserved.