deepujain commented on code in PR #8307:
URL: https://github.com/apache/hadoop/pull/8307#discussion_r2908545823
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java:
##########
@@ -361,6 +378,48 @@ public static boolean isWindowsAbsolutePath(final String
pathString,
*/
public URI toUri() { return uri; }
+ /**
+ * Return a URI for this path that is suitable for use as a directory base
+ * with {@link URI#resolve(String)}. The returned URI's path component
+ * ends with "/", so that {@code dirUri.resolve("child")} yields
+ * {@code .../dir/child} rather than replacing the last segment.
+ *
+ * @param uri a filesystem or path URI
+ * @return a URI with path ending in "/" (or "/" when path is empty)
+ */
+ public static URI ensureDirectoryUri(URI uri) {
Review Comment:
Good point.
In hadoop-common, new public methods on an otherwise stable class are
usually marked with @InterfaceStability.Evolving so the method can evolve
without changing the class’s stability. Path is already
@InterfaceAudience.Public and @InterfaceStability.Stable, so I added
@InterfaceStability.Evolving on both ensureDirectoryUri(URI) and asDirectory().
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]