(File dir)
| 67 | } |
| 68 | |
| 69 | public static boolean createDir(File dir) { |
| 70 | if ((dir.exists() || dir.mkdirs()) && dir.canWrite()) return true; |
| 71 | |
| 72 | if (dir.exists()) { |
| 73 | FileHandler.makeWritable(dir); |
| 74 | return dir.canWrite(); |
| 75 | } |
| 76 | |
| 77 | // Iterate through the parent directories until we find that exists, |
| 78 | // then sink down. |
| 79 | return createDir(dir.getParentFile()); |
| 80 | } |
| 81 | |
| 82 | public static boolean makeWritable(File file) { |
| 83 | return file.canWrite() || file.setWritable(true); |
no test coverage detected