Java Path Exist nio checkPathExistence(String path)

Here you can find the source of checkPathExistence(String path)

Description

check Path Existence

License

Open Source License

Declaration

public static boolean checkPathExistence(String path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean checkPathExistence(String path) {
        java.nio.file.Path p;/*from  www  . j ava2s. c  om*/
        try {
            p = java.nio.file.Paths.get(path);
        } catch (java.nio.file.InvalidPathException ipe) {
            return false;
        }
        return java.nio.file.Files.exists(p);
    }
}

Related

  1. checkFileExists(Path path, LinkOption... options)
  2. checkFileExists(String path)
  3. directoryExist(String path)
  4. ensureDirectoryExists(final Path fileLocation)
  5. exist(Path... paths)
  6. exists(Path file)