File delete

/*	File file = new File(".");//对应到%Tomcat%/bin目录
		File[] subFiles = file.listFiles();
		
		for(File f : subFiles){
			if(f.getName().endsWith("xls")){
				f.delete();
			}
		}*/
		
		File file = new File(".");//对应到%Tomcat%/bin目录
		File[] subFiles = file.listFiles(new FileFilter(){
				public boolean accept(File pathname){
					if(pathname.getName().endsWith("xls")){
						return true;
					}
					return false;
				}
			});
		for(File f : subFiles){
			f.delete();
		}

 

你可能感兴趣的:(tomcat,F#)