Here you can find the source of exists(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 exists(Path file)
//package com.java2s; //License from project: LGPL import java.nio.file.Path; public class Main { /**//from w ww . ja 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 exists(Path file) { return file != null && file.toFile().exists(); } }