I have a Path
object, but it appears it does not have a getCanonicalPath()
method like in the File
class. Reason is I have dots in the Path that I want to eliminate to get something "unique":
/some/path/./something
# should be
/some/path/something
See normalize and toRealPath.
It seems that getRealPath()
does the job. If not you can always call path.toFile().getCanonicalPath()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With