Java中File类中getPath,getAbsolutePath,getCanonicalPath方法区别
getPath
官费注解:The string form of this abstract pathname
getPath返回文件路径的抽象路径,如果你new File使用的是相对路径,那么它返回的就是相对路径
getAbsolutePath
官方注解:Returns the absolute pathname string of this abstract pathname.
getAbsolutePath 方法返回的是抽象的绝对路径
getCanonicalPath
官方注解:The canonical pathname string denoting the same file or directory as this abstract pathname
表示与此抽象路径名相同的文件或目录的规范路径名字符串