Skip to content

Instantly share code, notes, and snippets.

@MangoLiu
Created December 6, 2013 07:13
Show Gist options
  • Save MangoLiu/7819792 to your computer and use it in GitHub Desktop.
Save MangoLiu/7819792 to your computer and use it in GitHub Desktop.
Process each file in specified the floder.(遍历并处理指定文件夹下的每一个文件)
public void floderProcesser() throws IOException {
//testfloder是一个文件夹,和.project文件在同一目录下。
String path = "test";
File f=new File(path);
File[] list=f.listFiles();
int fileNum = list.length;
String name;
for(int i = 0;i<fileNum;i++){
name = list[i].getName();
System.out.println(name);
//some code..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment