if ( includeLog )
{
BackupLog log = BackupManager.INSTANCE.getLog();
ArrayList<BackupLogEntry> logEntries = log.getLog( wrapped.getId() );
BackupLogEntry latestSuccessfulLogEntry = log.getLatestSuccessful( wrapped.getId() );
ArrayList<Object> serializedLog = new ArrayList<Object>();
for ( BackupLogEntry entry : logEntries )
{
serializedLog.add( entry.serialize() );
}
Map<String, Object> logData = new HashMap<String, Object>();
logData.put( LATEST_SUCCESS_LOG_KEY,
latestSuccessfulLogEntry == null ? null
: latestSuccessfulLogEntry.serialize() );
logData.put( LOG_ENTRIES_KEY, serializedLog );
data.put( LOG_KEY, logData );
}