Check for a behavior change for File setReadOnly, setWritable and canWrite methods

This rule flags java.io.File setReadOnly() , setWritable(boolean arg) , setWritable(boolean arg, boolean user) , canWrite() .

According to Java SE 7 and JDK 7 Compatibility documentation in Java 7, the methods setReadOnly() , setWritable(boolean arg) , setWritable(boolean arg, boolean user) no longer set the Disk Operating System (DOS) read only attribute on directories. These methods will return false when called on a directory in a Microsoft Windows (R) environment. In addition, to preserve the relationship with the canWrite() method, this method in Java 7 now will always return true if called on a directory. According to the documentation: "Applications that want to set directories on Windows to be read only must use the new API. In particular, the Files.isWritable method takes into account the effective access (as determined by the file's discretionary access control list) and whether the file is located on a writable volume."

For additional information, see the Java 7 APIs: