![](/img/trans.png)
[英]getCanonicalPath different from getAbsolutePath - adding “/private”
[英]Why getCanonicalPath throws checked exception while getAbsolutePath does not?
我通過閱讀一些相關文本來了解兩者之間的差異。 但我很好奇為什么getCanonicalPath()
拋出檢查異常而getAbsolutePath()
不拋出任何東西?
但我很好奇為什么
getCanonicalPath()
拋出檢查異常而getAbsolutePath()
不拋出任何東西?
它說明了為什么在getCanonicalPath
的文檔中 :
IOException
- 如果發生I / O錯誤,這是可能的,因為規范路徑名的構造可能需要文件系統查詢
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.