We have a Java application with a particular module that checks if a temporary directory is \'writable\' before executing its function. To test this, we have a JUnit test th
If you're on Windows, it's probably related to this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6728842
Apparently setWritable(false) never really worked for directories on Windows, because the readonly flag doesn't actually make a directory readonly.
setWritable(false)