code: public static boolean isSymlink(File file) throws IOException {
          if (file == null) {
              throw new NullPointerException("File must not be null");
          }
          if (File.separatorChar == '\\') {
              return false;
          }
          File fileInCanonicalDir;
          if (file.getParent() == null) {
              fileInCanonicalDir = file;
          } else {
              File canonicalDir = file.getParentFile().getCanonicalFile();
              fileInCanonicalDir = new File(canonicalDir, file.getName());
          }
  
          return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile());
      }
docs: Determines whether the specified file is a Symbolic Link rather than an
  actual file.
  <p>
  Will not return true if there is a Symbolic Link anywhere in the path,
  only if the specific file is.
  <p>
  <b>Note:</b> the current implementation always returns {@code false} if
  the system is detected as Windows.
  
  Copied from org.apache.commons.io.FileuUils
  
  @param file the file to check
  @return true if the file is a Symbolic Link
  @throws IOException if an IO error occurs while checking the file