Here you can find the source of isSymLink(File file)
Parameter | Description |
---|---|
file | The file that is checked if it has a canonical path. |
Parameter | Description |
---|---|
IOException | an exception |
public static boolean isSymLink(File file) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { /**//from ww w.j a va 2 s .c o m * * @param file * The file that is checked if it has * a canonical path. * @return * True if the absolute path of the file * differs from the canonical path, false * otherwise. * @throws IOException */ public static boolean isSymLink(File file) throws IOException { return !file.getAbsolutePath().equals(file.getCanonicalPath()); } }