public void registerEventID ( String description , String key , String value ) { BufferedWriter bufferedWriter ; FileOutputStream out = null ; try { out = new FileOutputStream ( eventPropertiesPath , true ) ; bufferedWriter = new BufferedWriter ( new OutputStreamWriter ( out ) ) ; doWithLock ( out . getChannel ( ) , lock -> { unlockedReloadFile ( ) ; if ( getEventID ( key ) != null ) { return ; } try { bufferedWriter . write ( "\n\n" + key + "_DESCRIPTION = " + description + "\n" + key + " = " + value ) ; bufferedWriter . flush ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } ) ; } catch ( FileNotFoundException e ) { error ( "Unable find file" , e ) ; } finally { try { if ( out != null ) { out . close ( ) ; } } catch ( IOException e ) { error ( "Unable to close lock" , e ) ; } } }
Registers or adds an event to the local_events . properties file