ok, understood that you want to avoid the extra stats, hence now checking return value in a different way here

mkdirs() fails if the directory is already existing so this will not fail the subsequent createNewFile() call.