Java Path Exist nio exists(Path path)

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

Description

Tests whether a file exists.

License

Open Source License

Parameter

Parameter Description
path the path to the file to test.

Return

true if the file exists; false if the file does not exist or its existence cannot be determined.

Declaration

public static boolean exists(Path path) 

Method Source Code

//package com.java2s;

import java.nio.file.*;

public class Main {
    /**//from w w w.ja v  a 2s  .c  om
     * Tests whether a file exists.
     *
     * @param path the path to the file to test.
     * @return true if the file exists; false if the file does not exist or its
     * existence cannot be determined.
     */
    public static boolean exists(Path path) {
        return Files.exists(path);
    }
}

Related

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