Apache Commons FTPClient.listFiles

前端 未结 7 1368
深忆病人
深忆病人 2020-12-15 05:48

I am using org.apache.commons.net.ftp.FTPClient in one of my applications to work with a FTP server. I am able to connect, login, pwd

7条回答
  •  孤城傲影
    2020-12-15 06:36

    In my case, on top of applying enterLocalPassiveMode and indicating correct operation system, I also need to set UnparseableEntries to true to make the listFile method work.

    FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
    conf.setUnparseableEntries(true);
    f.configure(conf);
    boolean isLoginSuccess = client.login(username, password);
    

提交回复
热议问题