akka / alpakka

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
https://doc.akka.io/docs/alpakka/current/
Other
1.26k stars 645 forks source link

[FTP] connectionSettings should be passed implicitly #421

Open l15k4 opened 7 years ago

l15k4 commented 7 years ago

https://github.com/akka/alpakka/blob/master/ftp/src/main/scala/akka/stream/alpakka/ftp/scaladsl/FtpApi.scala#L74 https://github.com/akka/alpakka/blob/master/ftp/src/main/scala/akka/stream/alpakka/ftp/scaladsl/FtpApi.scala#L109

The problem is that when you need to use generics :

def foo[C, S <: RemoteFileSettings](ftpPath: String, ftpApi: FtpApi[C], ftpConf: S)

You'd get error :

overloaded method value ls with alternatives

The reason why people cannot use concrete implementations directly is that usually production FTP servers use SFTP and testing servers use FTP.

ennru commented 6 years ago

This could be achieved by implementing a factory similar to the construct in the FTP tests.