本帖最后由 hxj1225 于 2010-07-05 11:36:18 编辑

解决方案 »

  1.   

    试试添加下面的代码FTPClientConfig config=new FTPClientConfig();
    config.setServerLanguageCode(FTPClientConfig.SYST_UNIX);
    ftpClient=new FTPClient();
    ftpClient.configure(config);
      

  2.   

    有没有相关权限,现在命令行ftp看看能取到列表不,
      

  3.   


    public List getFilenameList(String remotePath) throws IOException {
    ftpClient.binary();
    TelnetInputStream tis = null;
    try {
    tis = ftpClient.nameList(remotePath);
    } catch (IOException e) {
    throw new IOException("路径下已经没有文件");
    }
    BufferedReader bufferedReader = new BufferedReader(
    new InputStreamReader(tis));
    List filenameList = new ArrayList();
    String filename = "";
    while ((filename = bufferedReader.readLine()) != null) {
    filenameList.add(filename);
    }
    return filenameList;
    }
    换成sun的ftp包就可以