A Swedish court convicted a man on Friday of plotting to carry out a bombing in the name of Islamic State, sentencing him to seven years in prison followed by expulsion from the country.