public LocalManagedBufferFile openDatabase(long checkoutId, String user) throws IOException {
		synchronized (fileSystem) {
			validate();
			repository.validateWritePrivilege(user);
			ItemCheckoutStatus coStatus = databaseItem.getCheckout(checkoutId);
			if (coStatus == null) {
				throw new IOException("Illegal checkin");
			}
			if (!coStatus.getUser().equals(user)) {
				throw new IOException(
					"Checkin not permitted, checkout was made by " + coStatus.getUser());
			}
			LocalManagedBufferFile bf = databaseItem.openForUpdate(checkoutId);
			repository.log(getPathname(), "check-in started", user);
			return bf;
		}
	}
Open the current version for checkin use.
@param checkoutId checkout ID
@param user user who initiated the request
@return open BufferFile for update/checkin use
@throws UserAccessException if user is denied write access
@throws IOException if an IO error occurs
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/store/RepositoryFile.java