[快速入口区]  没泪水的泪眼 | 落泪的百合  |  风过留痕 | 风枫轩 |  美文欣赏  |  红袖文学  |  潇湘琴韵文集收藏   |   九九文章网   |  网站优化  |  PHP 学习区  | 需求分析 欢迎大家来聚!

曾经沧海难为水 除却巫山不是云

    朋友就是无形中伴你走过风雨,永远支持你的力量 朋友就是一种无法言喻的美好感觉 朋友就是在别人面 前永远护著你的那个人 朋友就是即使是一点小感动,一点小事情都想一起分享 朋友就是当你抱头痛哭的时候,扶著你肩膀的那个人 朋友就是当你面对人生挫折时,一直紧握你的那双手 喜欢下雨,因为你不会知道我流泪…… 你能够看到他是你与他的缘份 你能够和你身边的人做朋友也是你与他的缘份 纵使你不知道这颗流星会何时消失 但如若你好好珍惜看到这流星的每一刻 那就算流星走了你也不会后悔 请大家好好珍惜身边的每一个人 珍惜这段友谊!

广告位招租:[ 中国图书网   |  京东商城  | 健康平安网  | C I 2.1手册 ]

导航

从一个目录下读取txt 文本的资源

//从一个目录下取txt 文件的资源来读取
	private static Set<String> getDirResoureList(String dirpath) throws IOException{
		LOG.debug("START  Get DIR_path  Resource Info to mysql !path={}",dirpath);
		if (StringUtils.isNotBlank(dirpath)) {
			File dir = new File(dirpath);
			if (dir.exists() && dir.isDirectory() && dir.isAbsolute()) {
				
				File [] files= dir.listFiles(); 
				for (File f : files) {
					String filepath= f.getPath();
					
					LOG.debug("get file info name = {}  path = {}",f.getName(),f.getPath());
					if(f.getName().endsWith(".txt")){
						//取这个文件中的所有资源
						Set<String> links = getResource(filepath);
						
						SavaSQLByLinks(filepath+".sql", links);
					}
				}
				
			}else{
				LOG.debug("dir is not exists ! or dir is hidden ! or not is directory !");
				return null;
			}
			
		}else{
			LOG.debug("path is NULL ;");
			return null;
		}
		return null;
	}

 

posted on 2011-11-30 14:25  曾经沧海 云淡风轻  阅读(191)  评论(0编辑  收藏  举报