Fetches files from the target directory, and - if recursive
            mode is on, all subdirectories.

            Returns a list of all found files

def _fetchFilesFromFolder(self, target, recursive):
        '''
            Fetches files from the target directory, and - if recursive
            mode is on, all subdirectories.

            Returns a list of all found files
        '''
        directory_items = os.walk(target)

        # If recursive is false, fetch only the first tuple
        if not recursive:
            directory_items = [next(directory_items)]

        targets = []
        for dir_name, folders, files in directory_items:
            for f in files:
                targets.append(os.path.join(dir_name, f))

        return targets