This tutorial demonstrate that how to rectify a file whether it have read permission or not.
This tutorial demonstrate that how to rectify a file whether it have read permission or not.This example demonstrate how to check a file have read permission or not at a specified path. The method canRead() of the File class check for its read property of a file. As in the file path we see '\' (backslash) that is used to denote file separation but here in this example File.separator is used.
import java.io.File;
|
The output of this example is either true or false depends on the file have read property at the specified path that is set in the program above.