It seems like it should be something direct, but I can find an elegant solution without converting it to File
.
Considering Path
Path path = Paths.get("/a/b/foo")
How to make a way /a/b/foo.bar
? subpath
returns a relative path regardless of whether the original path is relative or absolute.
I would prefer not to use additional libraries. But maybe this is the only way?
source
share