protected void scanResources()
	{
		try {
			File scriptDirFile=new File(scriptDir);
			if(scriptDirFile.exists() && scriptDirFile.isDirectory())
			{
				if(scanFilter==null || (scanFilter!=null && scanFilter.accpetJars()))
				{
					for(File file:FileUtil.findJarFileByDir(scriptDirFile))
					{//扫描jar
						cacheJars.add(file.toURI().toURL());
					}
				}
				if(scanFilter==null || (scanFilter!=null && scanFilter.accpetDirClass()))
				{
					HashMap<String, File> map=FileUtil.findClassByDirAndSub(scriptDirFile);
					if(!map.isEmpty())
					{//扫描class文件
						DefaultDirClassFile df=new DefaultDirClassFile(new ArrayList<>(map.keySet()),
								scriptDirFile.toURI().toURL());
						cacheDirClassFile.add(df);
					}
				}
			}
		} catch (Exception e) {
			log.error(e.getMessage(),e);
		}
	}
protected void scanResources ( ) { try { File scriptDirFile = new File ( scriptDir ) ; if ( scriptDirFile . exists ( ) && scriptDirFile . isDirectory ( ) ) { if ( scanFilter == null || ( scanFilter != null && scanFilter . accpetJars ( ) ) ) { for ( File file : FileUtil . findJarFileByDir ( scriptDirFile ) ) { cacheJars . add ( file . toURI ( ) . toURL ( ) ) ; } } if ( scanFilter == null || ( scanFilter != null && scanFilter . accpetDirClass ( ) ) ) { HashMap < String , File > map = FileUtil . findClassByDirAndSub ( scriptDirFile ) ; if ( ! map . isEmpty ( ) ) { DefaultDirClassFile df = new DefaultDirClassFile ( new ArrayList < > ( map . keySet ( ) ) , scriptDirFile . toURI ( ) . toURL ( ) ) ; cacheDirClassFile . add ( df ) ; } } } } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } }
扫描可用资源到缓存