def AddFile(self, fd, sync=False):
    hash_urn = self.FindFile(fd)
    if not hash_urn:
      return False

    # Open file and add 'fd' to the index.
    try:
      with aff4.FACTORY.Open(hash_urn, "NSRLFile", mode="w",
                             token=self.token) as hash_fd:
        hash_fd.AddIndex(fd.urn)
        return hash_urn
    except aff4.InstantiationError:
      pass
    return False
Hash the AFF4Stream and add it to the NSRLFile's index.
dataset/ETHPy150Open google/grr/grr/lib/aff4_objects/filestore.py/NSRLFileStore.AddFile