Simple test case:
public class AccessDenied {
public static void main(String[] args) {
try {
java.io.File file = new java.io.File("hugo");
boolean result = file.createNewFile();
System.out.println(result);
} catch (java.io.IOException ex) {
System.out.println("Error: " + ex.getMessage());
}
}
}
When I run this on either Solaris or Windows and "hugo" does
not exist, I get the expected output "true".
When "hugo" exists and is a file, I get the expected output
"false" on either platform.
When "hugo" exists and is a directory, I get "false" on
Solaris and an "Access is Denied" exception is thrown
on Windows.
This is a problem for SAP since their application depends on the
correct behaviour, i. e. the access denied exception as unexpected
behaviour is not acceptable since it introduces a platform
dependency.