从一个目录下读取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;
}
当你有事情忙的时候,你会觉得时间过得很快 很快。可能你会感觉有点累。但这是一个人成功的历程。请坚信,我一定会好好的。



浙公网安备 33010602011771号