Access check on folder in java
- by Bhaskar
I'm using the following code to check the access on selected folder. but it's not working.
private boolean writeAccess(String path){
try {
AccessController.checkPermission(new FilePermission(path, "read,write"));/*,*/
// Has permission
return true;
}
catch (SecurityException e) {
// Does not have permission
return false;
}
}
wt is prblm in it. and is there any other options to check the existance and access on the folders/directories?