public void renameDirectory(@Nonnull Workspace workspace,
	                            @Nonnull WorkspaceResource resource,
	                            @Nonnull FileBundle bundle,
	                            @Nonnull String directoryName) {
		boolean isRootDirectory = directoryName.isEmpty();
		new NamePopup(newDirectoryName -> {
			if (directoryName.equals(newDirectoryName)) return;

			String prefix = directoryName + "/";
			for (FileInfo value : bundle.valuesAsCopy()) {
				String filePath = value.getName();
				String fileName = shortenPath(filePath);

				// Source is root directory, this file is also in the root directory
				if (isRootDirectory && filePath.indexOf('/') == -1) {
					String name = newDirectoryName + "/" + fileName;
					bundle.remove(filePath);
					bundle.put(value.toFileBuilder().withName(name).build());
				} else {
					// Source is another package, this file matches that package
					if (filePath.startsWith(prefix)) {
						String name;
						if (newDirectoryName.isEmpty()) {
							// Target is root directory
							name = fileName;
						} else if (filePath.startsWith(directoryName)) {
							// Target is another directory
							name = replacePrefix(filePath, directoryName, newDirectoryName);
						} else {
							continue;
						}
						bundle.remove(filePath);
						bundle.put(value.toFileBuilder().withName(name).build());
					}
				}
			}
		}).withInitialPathName(directoryName)
				.forDirectoryRename(bundle)
				.show();
	}
Prompts the user to rename the given directory.

@param workspace
		Containing workspace.
@param resource
		Containing resource.
@param bundle
		Containing bundle.
@param directoryName
		Name of directory to rename.
recaf-ui/src/main/java/software/coley/recaf/services/navigation/Actions.java