'Load artifacts from file paths as json or yaml.'

def _LoadArtifactsFromFiles(self, file_paths, overwrite_if_exists=True):

    loaded_files = []
    loaded_artifacts = []
    for file_path in file_paths:
        try:
            with open(file_path, mode='rb') as fh:
                logging.debug('Loading    artifacts    from    %s', file_path)
                for artifact_val in self.ArtifactsFromYaml(fh.read(1000000)):
                    self.RegisterArtifact(artifact_val, source=('file:%s' % file_path), overwrite_if_exists=overwrite_if_exists)
                    loaded_artifacts.append(artifact_val)
                    logging.debug('Loaded    artifact    %s    from    %s', artifact_val.name, file_path)
            loaded_files.append(file_path)
        except (IOError, OSError) as e:
            logging.error('Failed    to    open    artifact    file    %s.    %s', file_path, e)
        except ArtifactDefinitionError as e:
            logging.error('Invalid    artifact    found    in    file    %s    with    error:    %s', file_path, e)
            raise
    for artifact_value in loaded_artifacts:
        artifact_value.Validate()
