At once
!file.getCanonicalFile().equals(file)
is incorrect.Answer:
P. S. For all that, JDK standard library developers are villains, because JDK doesn't provide API to OS-specific functions.
boolean isSymlink(File f) {
File cp = file.getParentFile().getCanonicalFile();
File f1 = new File(cp, f.getName());
return !f1.equals(f1.getCanonicalFile());
}
на русском
No comments:
Post a Comment