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
In Java 7 i do it like this:
if(Files.isWritable(path)){ //ok, write }
Docs