protected final long createFile(DomainObjectAdapterDB domainObj, String contentType,
			FileSystem fs, String path, String name, TaskMonitor monitor)
			throws InvalidNameException, CancelledException, IOException {
		DBHandle dbh = domainObj.getDBHandle();
		ManagedBufferFile bf = fs.createDatabase(path, name, FileIDFactory.createFileID(),
			contentType, dbh.getBufferSize(), SystemUtilities.getUserName(), null);
		long checkoutId = bf.getCheckinID();  // item remains checked-out after saveAs
		boolean success = false;
		try {
			dbh.saveAs(bf, true, monitor);
			success = true;
		}
		finally {
			if (!success) {
				try {
					bf.delete();
				}
				catch (IOException e) {
					// ignore
				}
				abortCreate(fs, path, name, checkoutId);
			}
		}
		return checkoutId;
	}
Create a new database file from an open database handle.
If fs is versioned, the resulting item is marked as checked-out
within the versioned file-system.  The specified domainObj
will become associated with the newly created database.
@param domainObj domain object
@param contentType the content type
@param fs the domain object file system
@param path the path of the new file
@param name the name of the new file
@param monitor the monitor that allows the user to cancel
@return checkout ID for new file
@throws InvalidNameException if the name contains invalid characters
@throws CancelledException if the user cancels the operation
@throws IOException if an i/o error occurs
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/DBContentHandler.java