package com.usr.files;
import java.io.File;
public class ListFiles {
public static void main(String[] args) {
File rootDir=new File("E:\\songs");
listAllFiles(rootDir);
}
private static void listAllFiles(File file) {
if(file.isDirectory()){
System.out.println("Directory Name is:"+file.getName());
for(int i=0;i<file.listFiles().length;i++){
listAllFiles(file.listFiles()[i]);
}
System.out.println("File Name is:"+file.getName());
}
}
}