Returns whether the given file is a symbolic link.

@since 1.16
546476
public static boolean isSymbolicLink(File file) throws IOException {
    // first try using Java 7
    try {
      // use reflection here
      Class<?> filesClass = Class.forName("java.nio.file.Files");
      Class<?> pathClass = Class.forName("java.nio.file.Path");
      Object path = File.class.getMethod("toPath").invoke(file);
      return ((Boolean) filesClass.getMethod("isSymbolicLink", pathClass).invoke(null, path))
          .booleanValue();
    } catch (InvocationTargetException exception) {
      Throwable cause = exception.getCause();
      Throwables.propagateIfPossible(cause, IOException.class);
      // shouldn't reach this point, but just in case...
      throw new RuntimeException(cause);
    } catch (ClassNotFoundException exception) {
      // handled below
    } catch (IllegalArgumentException exception) {
      // handled below
    } catch (SecurityException exception) {
      // handled below
    } catch (IllegalAccessException exception) {
      // handled below
    } catch (NoSuchMethodException exception) {
      // handled below
    }
    // backup option compatible with earlier Java
    // this won't work on Windows, which is where separator char is '\\'
    if (File.separatorChar == '\\') {
      return false;
    }
    File canonical = file;
    if (file.getParent() != null) {
      canonical = new File(file.getParentFile().getCanonicalFile(), file.getName());
    }
    return !canonical.getCanonicalFile().equals(canonical.getAbsoluteFile());
  }
47573
public static boolean canReadFile(File file) {		
		if(file!=null && file.canRead() && !file.isDirectory()){
			return true;
		} else {
			return false;
		}		
	}
791256
private boolean isSymlink(File base, String path) {
        return isSymlink(base, SelectorUtils.tokenizePath(path));
    }
1155383
public JimfsPath readSymbolicLink(JimfsPath path) throws IOException {
    if (!store.supportsFeature(Feature.SYMBOLIC_LINKS)) {
      throw new UnsupportedOperationException();
    }

    SymbolicLink symbolicLink =
        (SymbolicLink)
            lookUpWithLock(path, Options.NOFOLLOW_LINKS).requireSymbolicLink(path).file();

    return symbolicLink.target();
  }
209184
def is_dir_url(link):
    # type: (Link) -> bool
    
    link_path = url_to_path(link.url_without_fragment)
    return os.path.isdir(link_path)
1039864
def IsLink(self):
    
    if self._stat_object is None:
      self._stat_object = self._GetStat()
    if self._stat_object is not None:
      self.entry_type = self._stat_object.type
    return self.entry_type == definitions.FILE_ENTRY_TYPE_LINK
31875
private static boolean isValidFileSystemUri(URI uri) {
    // would like to just check null, but fragment appears to be the empty string when not present
    return isNullOrEmpty(uri.getPath())
        && isNullOrEmpty(uri.getQuery())
        && isNullOrEmpty(uri.getFragment());
  }
598359
function is_link($path)
    {
        $result = $this->_get_lstat_cache_prop($path, 'type');
        if ($result === false) {
            return false;
        }
        return $result === NET_SFTP_TYPE_SYMLINK;
    }
229204
public static boolean isInSubDirectory(File dir, File file)
    {
        if (file == null)
            return false;

        if (file.equals(dir))
            return true;

        return isInSubDirectory(dir, file.getParentFile());
    }
261060
protected boolean isSourceFile(File file) {
        String name = file.getName();
        String extension = Files.getExtension(name).toLowerCase();
        return sourceFileExtensions.contains(extension) || sourceFileNames.contains(name);
    }
38019
public static function isSymbolicLink(string $path) : bool
    {
        try {
            return ErrorCatcher::run(static function() use ($path) {
                return is_link($path);
            });
        } catch (\ErrorException $e) {
            throw new IoException('Error checking if ' . $path . ' is a symbolic link', 0, $e);
        }
    }
450750
public static boolean isFile(Resource resource) {
        return resource.isResourceType(ResourceUtil.TYPE_FILE) ||
                resource.isResourceType(ResourceUtil.TYPE_LINKED_FILE);
    }
380257
public static boolean isImage(File file)
  {
    return file != null ? IMAGE_FILE_EXTENSIONS.contains(Files.getExtension(file)) : false;
  }
497690
public static boolean isFile(Path path, boolean isFollowLinks) {
		if (null == path) {
			return false;
		}
		final LinkOption[] options = isFollowLinks ? new LinkOption[0] : new LinkOption[] { LinkOption.NOFOLLOW_LINKS };
		return Files.isRegularFile(path, options);
	}
1340419
def is_file_writable(test_file):
    
    p = Path(test_file)

    if p.is_symlink():
        p = p.resolve(strict=False)

    # p.is_file() throws an exception in some cases
    if p.exists() and p.is_file():
        return os.access(
            os.fspath(p),
            os.W_OK,
            effective_ids=(os.access in os.supports_effective_ids),
        )
    else:
        try:
            fp = p.open('wb')
        except OSError:
            return False
        else:
            fp.close()
            with suppress(OSError):
                p.unlink()
        return True
772094
public boolean isIncludeFile()
    {
        if (value != null && value.length() > 0 && CmdLine.INCLUDE_FILE_PREFIX.charAt(0) == value.charAt(0))
            return true;
        return false;
    }
6535
function SymbolicLinkFinder(options) {
  this.scanDirs = options && options.scanDirs || ['.'];
  this.extensions = options && options.extensions || ['.js'];
  this.ignore = options && options.ignore || null;
}