FtpWriter is unable to write file in root directory
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 5.7k
- PR merge metrics
- No merged PRs in 30d
Description
`String parentDir = filePath.substring(0,StringUtils.lastIndexOf(filePath, IOUtils.DIR_SEPARATOR))` returns empty string when filePath is something like `/test.txt`. The empty string will cause error of changing directory command.
Use `FilenameUtils.getFullPathNoEndSeparator` instead to solve this issue in the [PR](https://github.com/alibaba/DataX/pull/960)
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate FtpWriter and review the path-handling code described in the issue, then inspect PR #960 for the proposed context. Verify the root-directory case such as /test.txt no longer produces an invalid empty directory, and run the relevant existing tests or add coverage if the project provides them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100