import java.io.*;
import sun.net.ftp.FtpClient;
import java.util.StringTokenizer;public class Application1 {public static void main(String args[]) throws Exception {FtpClient fc;String host = "172.18.25.211";String path = "";
String username = "xiruo";
String password = "xiruojiang";FtpClient client = new FtpClient(host);
client.login(username, password);
client.binary();
client.cd(".");//这里是设置相对于host主目录的子目录,如果有很多子目录(未知),应如何解决,//DataInputStream dis =new DataInputStream(client.list());
BufferedReader dr = new BufferedReader(new InputStreamReader(client.list()));
int readCount;
String s="";
String filename="";
while((s=dr.readLine())!=null) {
if((filename=a(s)).toUpperCase().endsWith(".TXT"))
  System.out.println(filename);
}
}public static String a(String s) {
  String s1="";
  StringTokenizer st=new StringTokenizer(s," ");
  s1=st.nextToken();
  while(st.hasMoreTokens())
    s=st.nextToken();
  return s1.indexOf("-")==-1?"Folder:"+s:"File:"+s;
}
}以下是我的问题
client.cd(".");//这里是设置相对于host主目录的子目录,如果有很多子目录(未知),应如何解决?我的本意是遍厉,ftp目录下包括子目录的所有相同文件名的文件。