Description
public static final String DEFAULT_BACKUP_PATH = System.getProperty("java.io.tmpdir"); ...... String scheme = corruptPath.toUri().getScheme(); String authority = corruptPath.toUri().getAuthority(); String filePath = corruptPath.toUri().getPath(); if (backup.equals(DEFAULT_BACKUP_PATH)) { backupDataPath = new Path(scheme, authority, DEFAULT_BACKUP_PATH + filePath); } else { backupDataPath = Path.mergePaths(new Path(backup), corruptPath); }
1. System.getProperty("java.io.tmpdir") gets a path that may or may not end in Path.SEPARATOR, as seen in the Travis ci example, the path generated directly by DEFAULT_BACKUP_PATH + filePath may not be correct.
2. corruptPath is the path entered by the user, which may be absolute or relative. The second argument of Path.mergePaths is expected to be a path starting with Path.SEPARATOR, so when the user enters a relative path, Path.mergePaths(new Path(backup), corruptPath) the result is also incorrect.
Attachments
Issue Links
- links to