import java.io.File;
public class ShowFileName {
public static void main(String[] args) {
File file = new File("F:\\");
showFiles(file);
}
private static void showFiles(File file) {
File[] fileArray = file.listFiles();
if (fileArray != null) {
for (File f : fileArray) {
if (f.isDirectory()) {
showFiles(f);
} else {
if (f.getName().endsWith(".avi")) {
System.out.println(f.getAbsolutePath());
}
}
}
}
}
}
|
|