Java:检查符号链接文件是否存在 [英] Java: check symbolic link file existence

查看:136
本文介绍了Java:检查符号链接文件是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在这里讨论java 1.6。由于尚未支持symoblic链接,如何检查它们的存在。

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

1:告诉链接文件本身是否存在(即使链接断开也返回true)

1: tell wheather the link file itself exists (return true even if the link is broken)

2:点击链接告诉我们底层文件存在。

2: follow the link and tell wheather underlying file exists.

真的没有办法实现这个除了JNI?

Is there really no way to realize this except JNI?

推荐答案

现在看起来那样......除非你使用openjdk http://openjdk.java.net/projects/nio/javadoc/ java / nio / file / attribute / BasicFileAttributes.html#isSymbolicLink()

looks that way for now... unless you go with openjdk http://openjdk.java.net/projects/nio/javadoc/java/nio/file/attribute/BasicFileAttributes.html#isSymbolicLink()

这篇关于Java:检查符号链接文件是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆