Closed
Description
In what version(s) of Spring Integration are you seeing this issue?
6.2.4
Describe the bug
/
at the beginning of the remote dir path is not necessary when listing files although it is necessary to download them
To Reproduce
@Test
fun testFileDownload() {
sftpTemplate.list("remote-dir").forEach { // All the files under remote-dir are listed
log.info { it.filename }
}
log.info { "---- FINISHED TO LIST DIRECTORIES -----\n\n\n\n" }
sftpTemplate.get("/remote-dir/MyFile.csv") { // remote-dir/MyFile.csv won't work
inputStream -> inputStream.use {
localDir.mkdir()
FileUtils.copyInputStreamToFile(inputStream, File(localDir.absolutePath + "test.csv"))
}}
}
Expected behavior
sftpTemplate.get
should work also with "remote-dir/MyFile.csv"
as input.
See also stackOverflow question.