Why does getCanonicalPath throw a validation exception but getAbsolutePath does not?

I know the differences between them by reading some related texts. But I'm curious that why getCanonicalPath() throws a validation exception and getAbsolutePath() does not throw?

+6
source share
1 answer

But I'm curious that why getCanonicalPath() throws a validation exception and getAbsolutePath() does not throw?

It says why in the documentation for getCanonicalPath :

IOException - If an I / O error occurs, which is possible because a file system request may be required to build a canonical path

+14
source

Source: https://habr.com/ru/post/897089/


All Articles