private void lockSourceAndCopy(File sourceFile, File copyFile) {
    sourceFile.opened();
    ReadWriteLock sourceLock = sourceFile.contentLock();
    if (sourceLock != null) {
      sourceLock.readLock().lock();
    }
    ReadWriteLock copyLock = copyFile.contentLock();
    if (copyLock != null) {
      copyLock.writeLock().lock();
    }
  }
Locks source and copy files before copying content. Also marks the source file as opened so
that its content won't be deleted until after the copy if it is deleted.
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java