question: public static void execute ( String fileName , String tmpPrefix , Callback callback , CopyOption ... options ) throws Exception { Path target = Paths . get ( fileName ) ; Path parentPath = target . getParent ( ) ; Path tempFile = DefaultFilepaths . createTempFile ( parentPath , tmpPrefix , null ) ; SeekableByteChannel channel = Files . newByteChannel ( tempFile , CREATE , WRITE , TRUNCATE_EXISTING , DSYNC ) ; try ( OutputStream out = Channels . newOutputStream ( channel ) ) { callback . save ( out ) ; } if ( options . length == 0 ) { Files . move ( tempFile , target , StandardCopyOption . REPLACE_EXISTING ) ; } else { Files . move ( tempFile , target , options ) ; } }
target:  Atomically executes the given callback as part of the atomic save to the provided filename. If an error occurs no changes to the file will be made.