'Processes the results of the ListDirectory client action.
Args:
responses: a flow Responses object.'

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

    if (not responses.success):
        raise flow.FlowError('Unable    to    list    directory.')
    for response in responses:
        stat_entry = rdf_client.StatEntry(response)
        filesystem.CreateAFF4Object(stat_entry, self.client_id, self.token, sync=False)
        self.SendReply(stat_entry)
        aff4.FACTORY.Flush()
