public void renamePackageOrDirectory(@Nonnull DirectoryPathNode path) throws IncompletePathException {
		String directoryName = path.getValue();

		Workspace workspace = path.getValueOfType(Workspace.class);
		WorkspaceResource resource = path.getValueOfType(WorkspaceResource.class);
		Bundle<?> bundle = path.getValueOfType(Bundle.class);
		if (workspace == null) {
			logger.error("Cannot resolve required path nodes for directory '{}', missing workspace in path", directoryName);
			throw new IncompletePathException(Workspace.class);
		}
		if (resource == null) {
			logger.error("Cannot resolve required path nodes for directory '{}', missing resource in path", directoryName);
			throw new IncompletePathException(WorkspaceResource.class);
		}
		if (bundle == null) {
			logger.error("Cannot resolve required path nodes for directory '{}', missing bundle in path", directoryName);
			throw new IncompletePathException(ClassBundle.class);
		}

		if (bundle instanceof FileBundle fileBundle)
			renameDirectory(workspace, resource, fileBundle, directoryName);
		else if (bundle instanceof JvmClassBundle classBundle)
			renamePackage(workspace, resource, classBundle, directoryName);
	}
Prompts the user to rename the given directory.

@param path
		Path to directory.

@throws IncompletePathException
		When the path is missing parent elements.
recaf-ui/src/main/java/software/coley/recaf/services/navigation/Actions.java