// check directory
SecurityManager securityManager = pageContext.getConfig().getSecurityManager();
securityManager.checkFileLocation(pageContext.getConfig(),directory,serverPassword);
if(type!=TYPE_ALL) {
ResourceFilter typeFilter = (type==TYPE_DIR)?DIRECTORY_FILTER:FILE_FILTER;
if(filter==null) filter=typeFilter;
else filter=new AndResourceFilter(new ResourceFilter[]{typeFilter,filter});
}