import java.io.File;
import java.io.IOException;
import java.util.Scanner;
public class fileTest {
/**
*
* @param file 需要查询的文件
* @throws IOException
*/
public static void getChildName(File file)throws IOException{
if(file!=null){
if(file.isDirectory()){
//文件夹
System.out.println(file.getName()+":");
File[] files = file.listFiles();
if(files!=null){
for(File f:files){
//递归调用
getChildName(f);
}
}
}else{
//文件
System.out.println(file.getName());
}
}
}
public static void main(String[] args)throws IOException {
//输入一个文件名
Scanner sc = new Scanner(System.in);
String name = sc.nextLine();
String filename=name;
File file=new File(filename);
getChildName(file);
}
}