public static void ensureDirectoryExists ( final File directory , final String descriptionLabel ) { if ( ! directory . exists ( ) ) { if ( ! directory . mkdirs ( ) ) { throw new IllegalArgumentException ( "could not create " + descriptionLabel + " directory: " + directory ) ; } } }
Create a directory if it doesn t already exist .