public static void mkdirIfNotExists ( UnderFileSystem ufs , String path ) throws IOException { if ( ! ufs . isDirectory ( path ) ) { if ( ! ufs . mkdirs ( path ) ) { throw new IOException ( "Failed to make folder: " + path ) ; } } }
Attempts to create the directory if it does not already exist .