Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: check symbolic link file existence

Tags:

java

symlink

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 true even if the link is broken)

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

Is there really no way to realize this except JNI?

like image 917
solotim Avatar asked Feb 01 '10 09:02

solotim


1 Answers

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

like image 188
Ryan Fernandes Avatar answered Sep 20 '22 12:09

Ryan Fernandes