Same as locateDirectory(dirName), but also creates it if it doesn't exist. @param dirName @return @throws IOException
(String dirName)
| 221 | * @throws IOException |
| 222 | */ |
| 223 | public static String locateOrCreateDirectory(String dirName) throws IOException { |
| 224 | String path = locateDirectory(dirName); |
| 225 | |
| 226 | if (path == null) { |
| 227 | File file = new File(dirName); |
| 228 | file.mkdirs(); |
| 229 | path = file.getCanonicalPath(); |
| 230 | } |
| 231 | |
| 232 | return path; |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * @param path |
no test coverage detected