GhidraFile createFile(String fileName, DomainObject obj, TaskMonitor monitor)
			throws InvalidNameException, IOException, CancelledException {
		synchronized (fileSystem) {
			if (fileSystem.isReadOnly()) {
				throw new AssertException("createFile permitted within writeable project only");
			}
			DomainObjectAdapter doa = (DomainObjectAdapter) obj;

			if (doa.isClosed()) {
				throw new ClosedException();
			}
			if (!doa.lock(null)) {
				throw new IOException("Object is busy and can not be saved");
			}

			DomainFile oldDf = doa.getDomainFile();
			try {
				ContentHandler<?> ch = DomainObjectAdapter.getContentHandler(doa);
				ch.createFile(fileSystem, null, getPathname(), fileName, obj, monitor);

				if (oldDf != null) {
					listener.domainFileObjectClosed(oldDf, doa);
				}

				fileChanged(fileName);

				GhidraFile file = getDomainFile(fileName);
				if (file == null) {
					throw new IOException("File creation failed for unknown reason");
				}

				projectData.setDomainObject(file.getPathname(), doa);
				doa.setDomainFile(file);
				doa.setChanged(false);

				projectData.trackDomainFileInUse(doa);

				listener.domainFileObjectOpenedForUpdate(file, doa);

				return file;
			}
			finally {
				doa.unlock();
			}
		}
	}
Add a domain object to this folder.
@param fileName domain file name
@param obj domain object to be stored
@param monitor progress monitor
@return domain file created as a result of adding
the domain object to this folder
@throws DuplicateFileException thrown if the file name already exists
@throws InvalidNameException if name is an empty string
or if it contains characters other than alphanumerics.
@throws IOException if IO or access error occurs
@throws CancelledException if the user cancels the create.
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/GhidraFolderData.java