@Override
	public synchronized void saveCompleted(boolean commit) throws IOException {
		if (saveFile == null) {
			throw new IOException("Save is not in progress");
		}
		if (!commit) {
			disposeSaveFiles();
			startPreSave();
			return;
		}

		int newVersion = version + 1;
		File newFile = bfMgr.getBufferFile(newVersion);
		boolean success = false;
		try {
			if (saveChangeFile != null) {
				saveChangeFile.close();
			}

			// Rename saveFile and enable transfer versioning settings
			if (saveFile.renameFile(newFile)) {
				saveFile.version = newVersion;
				saveFile.bfMgr = bfMgr;
				saveFile.checkinId = checkinId;

				if (saveChangeFile != null) {
					comitSaveChangeDataFile();
				}

				cleanupOldPreSaveFiles(newFile.getParentFile(), 0);

				// commits new version and starts new pre-save on saveFile
				saveFile.setReadOnly();

				success = true;
			}
		}
		finally {
			if (!success) {
				saveFile.delete();
			}
			saveFile = null;
			saveChangeFile = null;
		}
		if (!success) {
			throw new IOException("File error during save");
		}
	}
Returns a Save file if available.  Returns null if
a save can not be performed.  This method may block for an extended
period of time if the pre-save process has not already completed.
This method does not accept a monitor since a remote TaskMonitor does
not yet exist.
@param monitor optional monitor for canceling pre-save (may be null)
@throws IOException if an I/O error occurs
@throws CancelledException if monitor specified and pre-save cancelled
Ghidra/Framework/DB/src/main/java/db/buffers/LocalManagedBufferFile.java