'Generate and send the Find requests.'

@flow.StateHandler()
def StartRequests(self):

    client = aff4.FACTORY.Open(self.client_id, token=self.token)
    usernames = [('%s\\%s' % (u.userdomain, u.username)) for u in self.state.users]
    usernames = [u.lstrip('\\') for u in usernames]
    condition = rdf_file_finder.FileFinderCondition(condition_type=rdf_file_finder.FileFinderCondition.Type.CONTENTS_REGEX_MATCH, contents_regex_match=rdf_file_finder.FileFinderContentsRegexMatchCondition(regex=self.args.data_regex, mode=rdf_file_finder.FileFinderContentsRegexMatchCondition.Mode.FIRST_HIT))
    for path in self.state.all_paths:
        full_paths = flow_utils.InterpolatePath(path, client, users=usernames)
        for full_path in full_paths:
            self.CallFlow(file_finder.FileFinder.__name__, paths=[os.path.join(full_path, '**5')], pathtype=self.args.pathtype, conditions=[condition], action=rdf_file_finder.FileFinderAction(action_type=rdf_file_finder.FileFinderAction.Action.DOWNLOAD), next_state='HandleResults')
