[Request for Comments] File extension redux
Brian Burkhalter
brian.burkhalter at oracle.com
Wed Oct 11 18:39:39 UTC 2023
On Oct 11, 2023, at 11:33 AM, Roger Riggs <roger.riggs at oracle.com<mailto:roger.riggs at oracle.com>> wrote:
Typically a leading "." (for the directories "." and "..") would not be considered the start of an extension. (As was spec'd earlier). Both "/." and "/.." have an empty extension.
Agreed.
I would suggest that `removeExtension()` would be more useful if it removed the final ".", if any.
`addExtension("txt")` would be smart enough to handle both "abc." and "abc" resulting in "abc.txt”.
I think that would work.
Aside from “.”, “..”, a leading “.” to denote hidden files on UNIX, and various edge cases to be ignored for the moment, I look at the “.” as a separator character somewhat analogous to File.separatorChar.
Thanks,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20231011/e9b74990/attachment.htm>
More information about the nio-dev
mailing list