Java Files.notExists(Path path, LinkOption ... options)

Syntax

Files.notExists(Path path, LinkOption ... options) has the following syntax.

public static boolean notExists(Path path,   LinkOption ... options)

Example

In the following code shows how to use Files.notExists(Path path, LinkOption ... options) method.


/*from   w ww .j a  v  a2s.  c om*/

import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;

public class Main {

    public static void main(String[] args) {

        Path path = FileSystems.getDefault().getPath("C:/tutorial/Java/JavaFX", "Demo.txt");

        boolean path_notexists = Files.notExists(path, new LinkOption[]{LinkOption.NOFOLLOW_LINKS});

        System.out.println("Not exists? " + path_notexists);
    }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio.file »




DirectoryStream.Filter
Files
FileStore
FileSystem
FileVisitor
Path
Paths
WatchService