GH-9129: SFTP: Remove extra / for the file_remoteDirectory header
Fixes: #9129
If `.remoteDirectory("/sftpSource")`, then `FileHeaders.REMOTE_DIRECTORY` is `//sftpSource`
* Fix `AbstractInboundFileSynchronizer` to not add `/` if one is already present in the beginning of the `remoteDirectoryPath`
(cherry picked from commit d87a7098ca)
This commit is contained in:
committed by
Spring Builds
parent
a7a9d47850
commit
f18626fdce
@@ -505,7 +505,10 @@ public abstract class AbstractInboundFileSynchronizer<F>
|
||||
try {
|
||||
String remoteFileMetadata =
|
||||
new URI(protocol(), null, host, Integer.parseInt(port),
|
||||
'/' + remoteDirectoryPath, null, remoteFileName)
|
||||
remoteDirectoryPath.charAt(0) == '/'
|
||||
? remoteDirectoryPath :
|
||||
'/' + remoteDirectoryPath,
|
||||
null, remoteFileName)
|
||||
.toString();
|
||||
this.remoteFileMetadataStore.put(buildMetadataKey(localFile), remoteFileMetadata);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user