Java: check symbolic link file existence

后端 未结 5 781
醉梦人生
醉梦人生 2021-01-11 13:58

We talk about java 1.6 here. Since symoblic link is not yet supported, how can examine the existence of them.

1: tell wheather the link file itself exists (return tr

5条回答
  •  伪装坚强ぢ
    2021-01-11 14:52

    It is slow but you could compare getAbsolutePath() and getCanonicalPath() of a File. So use only outside a performance critical code path.

提交回复
热议问题