'Store the content of the directory listing in the AFF4 object.'

def StoreDirectory(self):

    if (not self.state.responses):
        return
    directory_pathspec = self.state.responses[0].pathspec.Dirname()
    urn = directory_pathspec.AFF4Path(self.client_id)
    if (not self.state.urn):
        self.state.urn = urn
    fd = aff4.FACTORY.Create(urn, standard.VFSDirectory, token=self.token)
    fd.Close(sync=False)
    for st in self.state.responses:
        st = rdf_client.StatEntry(st)
        CreateAFF4Object(st, self.client_id, self.token)
        self.SendReply(st)
