public static void createDirectories ( final String directory ) { if ( directory == null ) return ; final File f = new File ( directory ) ; if ( ! f . isDirectory ( ) ) { if ( ! f . mkdirs ( ) ) throw new RuntimeException ( "couldn't create " + directory ) ; } }
Create the provided directory and all necessary subdirectories if they do not already exist .