question: public static void ensureOutputDirectory ( final File directory ) { if ( ! directory . exists ( ) ) { if ( ! directory . mkdirs ( ) ) { throw new NoTalkbackSlimException ( ErrorType . DIRECTORY_NOT_CREATED , directory . getPath ( ) ) ; } } else { if ( ! directory . isDirectory ( ) ) { throw new NoTalkbackSlimException ( ErrorType . NOT_A_DIRECTORY , directory . getPath ( ) ) ; } } }
target:  Test if the supplied directory is valid for the purposes of writing a SLIM result.  This means the directory either exists or does not exist and can be successfully created (which this method will do).