GhidraFolder setName(String newName) throws InvalidNameException, IOException {
		synchronized (fileSystem) {
			if (parent == null || fileSystem.isReadOnly()) {
				throw new UnsupportedOperationException("setName not permitted on this folder");
			}
			updateExistenceState();
			checkInUse();

			String oldName = name;
			String parentPath = parent.getPathname();

			if (folderExists) {
				fileSystem.renameFolder(parentPath, name, newName);
			}
			if (versionedFolderExists) {
				try {
					versionedFileSystem.renameFolder(parentPath, name, newName);
				}
				catch (IOException e) {
					if (folderExists) {
						// revert local folder name
						fileSystem.renameFolder(parentPath, newName, name);
					}
					throw e;
				}
			}

			parent.folderDataCache.remove(name);

			name = newName;
			parent.folderDataCache.put(newName, this);

			GhidraFolder newFolder = getDomainFolder();

			if (parent.visited) {
				parent.folderList.remove(oldName);
				parent.folderList.add(newName);

				// Must force refresh to ensure that all folder items are properly updted with new parent path
				refresh(true, true, projectData.getProjectDisposalMonitor());

				listener.domainFolderRenamed(newFolder, oldName);
			}

			return newFolder;
		}
	}
Set the name on this domain folder.
@param newName domain folder name
@return renamed domain file (the original DomainFolder object becomes invalid since it is 
immutable)
@throws InvalidNameException if newName contains illegal characters
@throws DuplicateFileException if a folder named newName 
already exists in this files domain folder.
@throws FileInUseException if any file within this folder or its descendants is 
in-use / checked-out.
@throws IOException thrown if an IO or access error occurs.
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/GhidraFolderData.java