Java Path Exist nio exists(Path file)

Here you can find the source of exists(Path file)

Description

We are using java.io because sonar has suggested as a performance update https://sonarqube.com/coding_rules#rule_key=squid%3AS3725

License

LGPL

Declaration

public static boolean exists(Path file) 

Method Source Code

//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();
    }
}

Related

  1. checkFileExists(String path)
  2. checkPathExistence(String path)
  3. directoryExist(String path)
  4. ensureDirectoryExists(final Path fileLocation)
  5. exist(Path... paths)
  6. exists(Path path)
  7. exists(Path path, LinkOption... options)
  8. exists(Path value)
  9. exists(Path... files)