protected void writeClassList ( File file , Collection < String > classNames ) throws IOException { File baseDir = file . getParentFile ( ) ; if ( baseDir . isDirectory ( ) || baseDir . mkdirs ( ) ) { Files . write ( file . toPath ( ) , classNames , StandardCharsets . UTF_8 ) ; } else { throw new IOException ( baseDir + " does not exist and could not be created" ) ; } }
Helper method which writes a list of class names to the given file .