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, toString
public void setAllowedExtensions(String[] extensions)
public boolean isFiltering(javax.servlet.http.HttpServletRequest request)
ParameterParserFilter
有些filter可以根据URL来确定是否要过滤参数。
isFiltering
in interface ParameterParserFilter
protected void init() throws Exception
BeanSupport
init
in class BeanSupport
Exception
public org.apache.commons.fileupload.FileItem filter(String key, org.apache.commons.fileupload.FileItem file)
UploadedFileFilter
null
表示忽略该文件。
注意,file
可能是null
。
filter
in interface UploadedFileFilter
Copyright © 2006–2018 TinyGroup. All rights reserved.