public long persist ( File persistFile ) { try { FileOutputStream fileStream = new FileOutputStream ( persistFile ) ; ObjectOutputStream oStream = new ObjectOutputStream ( ( fileStream ) ) ; long persistVersion ; Map < String , ChangedFile > fileListCopy ; synchronized ( this ) { fileListCopy = ( Map < String , ChangedFile > ) fileList . clone ( ) ; fileListCopy . putAll ( reservedFiles ) ; persistVersion = listVersion ; } oStream . writeObject ( fileListCopy ) ; oStream . close ( ) ; return persistVersion ; } catch ( IOException e ) { throw new RuntimeException ( "Unable to persist File Changed List:" + e . getMessage ( ) , e ) ; } }
Writes out the current state of the ChangeList to the given file .