I have code like this:
return (new File(pathA + File.separator + pathB + File.separator)).mkdir();
I believe it used to work, but it does not work now. The application only runs on Linux and we have tested it with Mint 9, Ubuntu 10.04, Kubuntu 12.04, etc. It doesn't create the intended directory.
The path is inside a directory with 777 permissions.
The stack track is not very helpful. Because the trace shows a couple calls to java.security methods, I assume it is a permissions problem. But the actual error message is not helpful at all (probably because the exception handling in the code needs to be improved).
What is the best way to create directories in Java on Linux?
new File(path).mkdir()work maybe? The extra separator should never be necessary.