private List < LogEntry > createScribePayload ( final File file , final CallbackHandler handler ) { try { final List < Event > events = Events . fromFile ( file ) ; final List < LogEntry > list = new ArrayList < LogEntry > ( events . size ( ) ) ; for ( final Event event : events ) { final String logEntryMessage = eventToLogEntryMessage ( event ) ; list . add ( new LogEntry ( event . getName ( ) , logEntryMessage ) ) ; } return list ; } catch ( ClassNotFoundException e ) { handler . onError ( new Throwable ( e ) , file ) ; return null ; } catch ( IOException e ) { handler . onError ( new Throwable ( e ) , file ) ; return null ; } }
Give a file of events generate LogEntry messages for Scribe