<commit_before>package fr.openwide.core.basicapp.init;

import java.io.File;
import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import fr.openwide.core.basicapp.init.config.spring.BasicApplicationInitConfig;
import fr.openwide.core.basicapp.init.util.SpringContextWrapper;
import fr.openwide.core.jpa.exception.SecurityServiceException;
import fr.openwide.core.jpa.exception.ServiceException;

public final class BasicApplicationInitFromExcelMain {

	private static final Logger LOGGER = LoggerFactory.getLogger(BasicApplicationInitFromExcelMain.class);

	public static void main(String[] args) throws ServiceException, SecurityServiceException, IOException {
		ApplicationContext context = new AnnotationConfigApplicationContext(BasicApplicationInitConfig.class);
		
		SpringContextWrapper contextWrapper = context.getBean("springContextWrapper",
				SpringContextWrapper.class);
		
		contextWrapper.openEntityManager();
		contextWrapper.importDirectory(new File("src/main/resources/init"));
		
		contextWrapper.reindexAll();
		contextWrapper.closeEntityManager();
		
		LOGGER.info("Initialization complete");
		
		System.exit(0);
	}
	
	private BasicApplicationInitFromExcelMain() {
	}<commit_msg>fermeture propre du contexte Spring avant de quitter<commit_after>package fr.openwide.core.basicapp.init;

import java.io.File;
import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import fr.openwide.core.basicapp.init.config.spring.BasicApplicationInitConfig;
import fr.openwide.core.basicapp.init.util.SpringContextWrapper;
import fr.openwide.core.jpa.exception.SecurityServiceException;
import fr.openwide.core.jpa.exception.ServiceException;

public final class BasicApplicationInitFromExcelMain {

	private static final Logger LOGGER = LoggerFactory.getLogger(BasicApplicationInitFromExcelMain.class);

	public static void main(String[] args) throws ServiceException, SecurityServiceException, IOException {
		ConfigurableApplicationContext context = null;
		try {
			context = new AnnotationConfigApplicationContext(BasicApplicationInitConfig.class);
			
			SpringContextWrapper contextWrapper = context.getBean("springContextWrapper",
					SpringContextWrapper.class);
			
			contextWrapper.openEntityManager();
			contextWrapper.importDirectory(new File("src/main/resources/init"));
			
			contextWrapper.reindexAll();
			contextWrapper.closeEntityManager();
			
			LOGGER.info("Initialization complete");
		} finally {
			if (context != null) {
				context.close();
			}
			System.exit(0);
		}
	}
	
	private BasicApplicationInitFromExcelMain() {
	}
{'fraction_non_alphanumeric': 0.0893163861216077, 'fraction_numerical': 0.0020611473720371005, 'mean_word_length': 6.409669211195928, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1226151', 'n_tokens_mistral': 843, 'n_tokens_neox': 763, 'n_words': 133}