public void replaceContentWith ( final Path newContentFile ) throws IOException { acquireWriteLock ( ) ; try { close ( ) ; Files . copy ( newContentFile , osFile , StandardCopyOption . REPLACE_EXISTING ) ; open ( ) ; } finally { releaseWriteLock ( ) ; } }
Replaces the file content with the content of the provided file .