public void ftplist()
   {
       String server="......";
       //输入的FTP服务器的IP地址
       String user="....";    
       //登录FTP服务器的用户名
       String password=".....";
       //登录FTP服务器的用户名的口令
       String path="/update";
       //FTP服务器上的路径
      try 
      {
       FtpClient ftpClient=new FtpClient();
           //创建FtpClient对象
       ftpClient.openServer(server);
           //连接FTP服务器
       ftpClient.login(user, password);
           //登录FTP服务器
           if (path.length()!=0) ftpClient.cd(path);
       TelnetInputStream is=ftpClient.list();
       int c;
       while ((c=is.read())!=-1) {
           System.out.print((char) c);}
           is.close();
           ftpClient.closeServer();//退出FTP服务器
        }
           catch (IOException ex) {;}
   }
   我用这个的,不知道行不行