private void refreshFiles(TaskMonitor monitor) throws IOException {

		String path = getPathname();

		Map<String, LocalFolderItem> localItemMap = Map.of();
		Map<String, FolderItem> versionedItemMap = Map.of();

		HashSet<String> newSet = new HashSet<>();
		if (folderExists) {
			try {
				localItemMap = itemMapOf(fileSystem.getItems(path));
				newSet.addAll(localItemMap.keySet());
			}
			catch (IOException e) {
				if (parent != null) {
					parent.folderRemoved(name);
				}
				throw e;
			}
		}
		if (versionedFolderExists) {
			try {
				versionedItemMap = itemMapOf(versionedFileSystem.getItems(path));
				newSet.addAll(versionedItemMap.keySet());
			}
			catch (Exception e) {
				Msg.error(this, "versioned folder refresh failed: " + e.getMessage());
				versionedFolderExists = false;
			}
		}

		HashSet<String> oldSet = new HashSet<>();
		for (String file : fileDataCache.keySet()) {
			oldSet.add(file);
		}
		HashSet<String> oldSetClone = new HashSet<>(oldSet);

		// find deleted files
		oldSet.removeAll(newSet);
		for (String fileName : oldSet) {
			fileRemoved(fileName);
		}

		// refresh existing
		for (GhidraFileData fileData : fileDataCache.values()) {
			String fileName = fileData.getName();
			LocalFolderItem localFolderItem = localItemMap.get(fileName);
			FolderItem versionedFolderItem = versionedItemMap.get(fileName);
			if (localFolderItem == null && versionedFolderItem == null) {
				fileRemoved(fileName);
			}
			else {
				fileData.refresh(localItemMap.get(fileName), versionedItemMap.get(fileName));
			}
		}

		// find new files
		newSet.removeAll(oldSetClone);
		for (String fileName : newSet) {
			if (monitor != null && monitor.isCancelled()) {
				break;
			}
			LocalFolderItem localFolderItem = localItemMap.get(fileName);
			FolderItem versionedFolderItem = versionedItemMap.get(fileName);

			GhidraFileData fileData = addFileData(fileName, localFolderItem, versionedFolderItem);
			if (visited) {
				listener.domainFileAdded(fileData.getDomainFile());
			}
		}
	}
Refresh set of sub-folder names and identify added/removed folders.
@param recursive recurse into visited subfolders if true
@param monitor recursion task monitor - break from recursion if cancelled
@throws IOException if an IO error occurs during the refresh
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/GhidraFolderData.java