private static File generateDefaultConfigFile ( ) { final File jaasConfFile ; try { Path jaasConfPath = Files . createTempFile ( "jaas-" , ".conf" ) ; try ( InputStream resourceStream = JaasModule . class . getClassLoader ( ) . getResourceAsStream ( JAAS_CONF_RESOURCE_NAME ) ) { Files . copy ( resourceStream , jaasConfPath , StandardCopyOption . REPLACE_EXISTING ) ; } jaasConfFile = jaasConfPath . toFile ( ) ; jaasConfFile . deleteOnExit ( ) ; } catch ( IOException e ) { throw new RuntimeException ( "unable to generate a JAAS configuration file" , e ) ; } return jaasConfFile ; }
Generate the default JAAS config file .