I would like a code snippet that checks whether a directory has read/write permissions and do something if it does, and does something else if it doesnt. I tried an example
if you just want to check if you can write:
File f = new File("path"); if(f.canWrite()) { // write access } else { // no write access }
for checking read access, there is a function canRead()
canRead()