java tutorial - How to Check file permission and Set file permission - java programming - learn java - java basics - java for beginners
Learn java - java tutorial - check file permission and set file permission - java examples - java programs
Check file permission :
- canExecute() :
true
if and only if the abstract pathname occurs and the application is allowed to the file execute. - canWrite() :
true
if and only if the file system contains a file denoted by this abstract pathname and the application is permitted to write the file otherwise it hasfalse
to write the file. - canRead() :
true
if and only if the file identified by this abstract pathname exists and can be read by the application otherwise it hasfalse.
Set file permission :
- setExecutable() : If
true
sets the right to use permit to the executable operations; elsefalse
to stop the execute operations - setWritable() : If
true
sets the right to use permit to the writable operations; elsefalse
to stop the write operations - setReadable() : If
true
sets the right to use permit to the readable operations; elsefalse
to stop the read operations