Details
Description
new Path(String str) calls Path.normalizePath to normalize the str, however, it does not remove all the slashes of the str.
Path.java
/** * Normalize a path string to use non-duplicated forward slashes as * the path separator and remove any trailing path separators. * * @param scheme the URI scheme. Used to deduce whether we * should replace backslashes or not * @param path the scheme-specific part * @return the normalized path string */ private static String normalizePath(String scheme, String path) {
Javadoc says "remove any trailing path separators", but it removes only one trailing slash.
Credit: This issue was found by ayushtkn in HDFS-14369.
Attachments
Attachments
Issue Links
- is depended upon by
-
HDFS-14369 RBF: Fix trailing "/" for webhdfs
- Resolved
- relates to
-
HADOOP-16957 NodeBase.normalize doesn't removing all trailing slashes.
- Resolved