static LocalManagedBufferFile create(final LocalFileSystem fileSystem,
			PropertyFile propertyFile, int bufferSize, String contentType, String fileID,
			String user, String projectPath) throws IOException {

		final LocalDatabaseItem dbItem = new LocalDatabaseItem(fileSystem, propertyFile, true);
		File dbDir = dbItem.getDataDir();

		long checkoutId = DEFAULT_CHECKOUT_ID;
		boolean success = false;
		try {
			if (fileID != null) {
				String oldFileId = propertyFile.getFileID();
				propertyFile.setFileID(fileID);
				fileSystem.fileIdChanged(propertyFile, oldFileId);
			}
			propertyFile.putInt(FILE_TYPE, DATABASE_FILE_TYPE);
			propertyFile.putBoolean(READ_ONLY, false);
			propertyFile.putString(CONTENT_TYPE, contentType);

			LocalManagedBufferFile bfile;
			if (fileSystem.isVersioned()) {
				ItemCheckoutStatus coStatus =
					dbItem.checkout(CheckoutType.NORMAL, user, projectPath);
				checkoutId = coStatus.getCheckoutId();
				dbItem.beginCheckin(checkoutId);
				bfile = VersionedDatabase.createVersionedDatabase(dbDir, bufferSize,
					dbItem.versionedDbListener, checkoutId);
			}
			else {
				bfile = PrivateDatabase.createDatabase(dbDir, (db, version) -> {
					synchronized (fileSystem) {
						if (version == 1) {
							if (dbItem.privateDb == null) {
								db.setSynchronizationObject(dbItem.fileSystem);
								dbItem.privateDb = (PrivateDatabase) db;
							}
							dbItem.fireItemCreated();
						}
					}
				}, bufferSize);
			}

			propertyFile.writeState();
			success = true;
			return bfile;
		}
		finally {
			if (!success) {
				if (fileSystem.isVersioned()) {
					dbItem.endCheckin(checkoutId);
				}
				dbItem.abortCreate();
			}
		}
	}
Create a new LocalDatabaseItem and an empty updateable BufferFile which may be used
to create the initial database content.
 @param fileSystem file system
@param propertyFile database property file
@param bufferSize buffer size to be used for new database
@param contentType user content type
@param fileID unique file ID or null
@param user if versioned, user used for permission check and history data
@param projectPath path of project in versioned database checkout is done (may be null for non-versioned database)
@return open updateable empty BufferFile for initial content writing
@throws IOException if error occurs
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/local/LocalDatabaseItem.java