Spring Integration java.io.IOException: Unable to determine system type - response: 550 Permission denied

29 Views Asked by At

I was getting Unable to determine system type - response: 550 Permission denied error while trying to poll files from ftp remote server.

Springboot version: 3.2.1

My FTPS session factory Java Configuration:

  @Bean
  public DefaultFtpsSessionFactory ftpsSessionFactory() {
    DefaultFtpsSessionFactory sessionFactory = new DefaultFtpsSessionFactory();
    sessionFactory.setHost(ftpHost);
    sessionFactory.setUsername(ftpUsername);
    sessionFactory.setPassword(ftpPassword);
    sessionFactory.setPort(ftpPort);
    sessionFactory.setControlEncoding(StandardCharsets.UTF_8.name());
    sessionFactory.setImplicit(true);
    sessionFactory.setProtocol("TLS");
    sessionFactory.setClientMode(FTPSClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE);
    return sessionFactory;
  }
1

There are 1 best solutions below

0
On

This can be achieved in two ways,

System.setProperty(FTPClient.FTP_SYSTEM_TYPE_DEFAULT, FTPClientConfig.SYST_UNIX)

or you can set this configuration directly to the session factory.

    FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
    sessionFactory.setConfig(conf);