-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Inconsistent behaviour between listing and downloading the files. #9123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For
For
So, maybe this is a problem and we can try to normalize path if it does not start with |
Yes, both commands should threat the dirPath in the same way. Here probably the GET should normalize the path as the LIST command does. I found unexpected the fact that one command without "/" does not work while it works for the other. |
Additionally, in the message's header |
@SimoneGiusso , do you mean for the |
Fixes: #9123 The `/` at the beginning of the remote dir path is not necessary when listing files, although it is necessary to download them The `SftpTemplate.get()` should work also with `remote-dir/MyFile.csv` as input. * Fix `SftpSession.readRaw()` to call `sftpClient.canonicalPath(source)` if the path does not start with a `/`. Something similar what is does * Delegate to `SftpSession.readRaw()` from the `SftpSession.read()` * Reuse `normalizePath()` for `doList()` (cherry picked from commit a2215af)
Fixes: #9123 The `/` at the beginning of the remote dir path is not necessary when listing files, although it is necessary to download them The `SftpTemplate.get()` should work also with `remote-dir/MyFile.csv` as input. * Fix `SftpSession.readRaw()` to call `sftpClient.canonicalPath(source)` if the path does not start with a `/`. Something similar what is does * Delegate to `SftpSession.readRaw()` from the `SftpSession.read()` * Reuse `normalizePath()` for `doList()` (cherry picked from commit a2215af)
The canonical path has been fixed.
Thanks |
If you enable the logging level to debug, you should see that Example:
But's this is a minor problem. |
Sure! But what I have to run to follow such a debug procedure ? |
If you run my demo in the other opened issue with this config in the logging:
level:
org.springframework.integration.*: debug You should see logged something similar to
As you'll see |
Thanks, @SimoneGiusso . |
Yes it is this one. Thanks |
Right. When I change my test for this |
Fixes: spring-projects#9123 The `/` at the beginning of the remote dir path is not necessary when listing files, although it is necessary to download them The `SftpTemplate.get()` should work also with `remote-dir/MyFile.csv` as input. * Fix `SftpSession.readRaw()` to call `sftpClient.canonicalPath(source)` if the path does not start with a `/`. Something similar what is does * Delegate to `SftpSession.readRaw()` from the `SftpSession.read()` * Reuse `normalizePath()` for `doList()` **Auto-cherry-pick to `6.2.x` & `6.1.x`**
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 themTo Reproduce
Expected behavior
sftpTemplate.get
should work also with"remote-dir/MyFile.csv"
as input.See also stackOverflow question.
The text was updated successfully, but these errors were encountered: