def METHOD_NAME(self, path: str) -> None:
    if path.strip():
        self.path = Path(path)
    else:
        self.path = None
    is_enabled = bool(self.path and self.path.is_dir())
    self.refreshButton.setEnabled(is_enabled)