use collectFirst instand of a var and iterate

Will this continue to try to delete the remaining directories if one fails? That depends on the laziness of the underlying data structure, right?

This is certainly more concise, but I'm not sure it's clearer. I think the latter is more important, especially when dealing with potential failure scenarios.