<commit_before>package com.coreoz.plume.mail;

import java.io.ByteArrayInputStream;
import java.util.stream.Collectors;

import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;

import org.simplejavamail.internal.util.ConfigLoader;
import org.simplejavamail.mailer.Mailer;

import com.google.common.base.Charsets;
import com.typesafe.config.Config;

@Singleton
public class MailerProvider implements Provider<Mailer> {

	private final Mailer mailer;

	@Inject
	public MailerProvider(Config config) {
		this.mailer = initializeMailer(config);
	}

	@Override
	public Mailer get() {
		return mailer;
	}

	private static Mailer initializeMailer(Config config) {
		ConfigLoader.loadProperties(
			// Properties are in ISO 8859 1
			new ByteArrayInputStream(readMailConfiguration(config).getBytes(Charsets.ISO_8859_1)),
			true<commit_msg>Correcting build<commit_after>package com.coreoz.plume.mail;

import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.util.stream.Collectors;

import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;

import org.simplejavamail.internal.util.ConfigLoader;
import org.simplejavamail.mailer.Mailer;

import com.typesafe.config.Config;

@Singleton
public class MailerProvider implements Provider<Mailer> {

	private final Mailer mailer;

	@Inject
	public MailerProvider(Config config) {
		this.mailer = initializeMailer(config);
	}

	@Override
	public Mailer get() {
		return mailer;
	}

	private static Mailer initializeMailer(Config config) {
		ConfigLoader.loadProperties(
			// Properties are in ISO 8859 1
			new ByteArrayInputStream(readMailConfiguration(config).getBytes(StandardCharsets.ISO_8859_1)),
			true
{'fraction_non_alphanumeric': 0.08882521489971347, 'fraction_numerical': 0.011461318051575931, 'mean_word_length': 5.689655172413793, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6614799', 'n_tokens_mistral': 575, 'n_tokens_neox': 532, 'n_words': 114}