'Collect the directory listing and store in the data store.'

@flow.StateHandler()
def List(self, responses):

    if (not responses.success):
        raise flow.FlowError(str(responses.status))
    if responses:
        for response in responses:
            self.state.responses.append(response)
        self.state.request.iterator = responses.iterator
        self.CallClient(server_stubs.IteratedListDirectory, self.state.request, next_state='List')
    else:
        self.StoreDirectory()
