Here you can find the source of isFile(Path file)
We are using java.io because sonar has suggested as a performance update https://sonarqube.com/coding_rules#rule_key=squid%3AS3725
public static boolean isFile(Path file)
//package com.java2s; //License from project: LGPL import java.nio.file.Path; public class Main { /**/*www. j a v a 2 s. c om*/ * We are using java.io because sonar has suggested as a performance update * https://sonarqube.com/coding_rules#rule_key=squid%3AS3725 * * @since 2017-03-16 */ public static boolean isFile(Path file) { return file != null && file.toFile().isFile(); } }