hansva commented on PR #9043:
URL: https://github.com/apache/hop/pull/9043#issuecomment-6292634039
**1. Must fix: `SftpClient` still sends `//X` as is.** `chdir()`,
`folderExists()`, `createFolder()` (and `getFileType()`, `delete()`,
`renameFile()` with absolute paths) don't add the trailing slash, so jsch still
turns a single-level data set path into `/X` for `ActionSftp` and
`ActionSftpPut`. Move the rule into one helper and use it in
`SftpFileObject.remotePath` and in those methods:
```java
public static String keepDataSetPrefix(String path) {
return path != null && path.length() > 2 && path.startsWith("//")
&& path.charAt(2) != '/' && path.indexOf('/', 2) < 0
? path + "/"
: path;
}
```
Add `SftpClient` cases to `SftpDoubleSlashPathTest`. If you'd rather leave
this out of the PR, change "fixes #9033" to "addresses #9033" and open a
follow-up issue.
**2. Must fix: PR description.** It's still the template text. Add the
cause, the fix, and what stays open from #9033: the hint for invalid data set
names, and the jsch upstream report.
**3. Should do: check a sequential data set.** Every single-level path now
ends in `/`, files included. Read and write one single-level sequential data
set on z/OS. If `//HLQ.SEQ/` is refused, say in the comment on `remotePath`
that only folders work.
**4. Nit:** add the z/OS sentence of `SftpPut.Error.TargetIsNotAFile` only
for `//` paths (`targetFile.getName() instanceof IRootPrefixFileName p &&
!p.getRootPrefix().isEmpty()`).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]