alpakka
alpakka copied to clipboard
Expose setPreserveAttributes to SftpApi clients
Short description
I want a way to setPreserveAttributes(false)
when using Alpakka's SftpApi
. At the moment, Alpakka SFTP uses sshj
's SSHClient
and SFTPClient
to support secure file transfers. See SftpOperations.scala
for how sshj
's SFTPClient
is instantiated.
Often times, the destination server does not allow the requesting server to preserve file attributes/permissions. In sshj
, the SFTPClient
exposes a way to avoid file attribute permission errors by allowing you to directly change the SFTPClient
's file transfer property.
sftpClient.getFileTransfer.setPreserveAttributes(false)
However, to do the above, I would need to forgo using other aspects of Alpakka's SftpApi
that I want and use sshj
directly.
Details
I'd like a way to do the above using the SftpSettings
case class, which would then be used to set the file transfer preserveAttributes
field in SftpOperations.scala
.
Additionally, some way for clients to override or set a custom SFTPclient
would also suffice, the same way SftpApi
has a companion object that has a constructor that accepts a customSshClient
: https://github.com/akka/alpakka/blob/33cc6265d37fe2811f00f23fcdf658476b039be6/ftp/src/main/scala/akka/stream/alpakka/ftp/javadsl/FtpApi.scala#L577-L589
I guess allowing for the same approach as in SftpApi
gives best flexibility to access the underlying implementation.