Java IO Tutorial - Java Files.isWritable(Path path)








Syntax

Files.isWritable(Path path) has the following syntax.

public static boolean isWritable(Path path)

Example

In the following code shows how to use Files.isWritable(Path path) method.

//  ww w. j a  va  2  s. 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 is_writable = Files.isWritable(path);
    }
}