<commit_before>package ${package}.webservices.internal;

import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

import com.coreoz.plume.jersey.security.basic.BasicAuthenticator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.base.Throwables;

import ${package}.services.configuration.ConfigurationService;

import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.models.Swagger;
import io.swagger.util.Json;

@Path("/swagger")
@Singleton
public class SwaggerWs {

	private final String swaggerDefinition;
	private final BasicAuthenticator<String> basicAuthenticator;

	@Inject
	public SwaggerWs(ConfigurationService configurationService) {
		BeanConfig beanConfig = new BeanConfig();
		beanConfig.setResourcePackage("${package}.webservices.api");
		beanConfig.setBasePath("/api");
		beanConfig.setTitle("API ${artifactId}");
		// this is not only a setter, it also starts the Swagger classes analyzing process 
		beanConfig.setScan(true);

		// the swagger object can be changed to add security definition
		// or to alter the generated mapping
		Swagger swagger = beanConfig.getSwagger();

		// serialization of the Swagger definition
		try {
			this.swaggerDefinition = Json.mapper().writeValueAsString(swagger);
		} catch (JsonProcessingException e) {
			throw Throwables.propagate(e);
		}

		// require authentication to access the API documentation
		this.basicAuthenticator = BasicAuthenticator.fromSingleCredentials(
			configurationService.swaggerAccessUsername(),
			configurationService.swaggerAccessPassword(),<commit_msg>Guava update<commit_after>package ${package}.webservices.internal;

import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;

import com.coreoz.plume.jersey.security.basic.BasicAuthenticator;
import com.fasterxml.jackson.core.JsonProcessingException;

import ${package}.services.configuration.ConfigurationService;

import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.models.Swagger;
import io.swagger.util.Json;

@Path("/swagger")
@Singleton
public class SwaggerWs {

	private final String swaggerDefinition;
	private final BasicAuthenticator<String> basicAuthenticator;

	@Inject
	public SwaggerWs(ConfigurationService configurationService) {
		BeanConfig beanConfig = new BeanConfig();
		beanConfig.setResourcePackage("${package}.webservices.api");
		beanConfig.setBasePath("/api");
		beanConfig.setTitle("API ${artifactId}");
		// this is not only a setter, it also starts the Swagger classes analyzing process 
		beanConfig.setScan(true);

		// the swagger object can be changed to add security definition
		// or to alter the generated mapping
		Swagger swagger = beanConfig.getSwagger();

		// serialization of the Swagger definition
		try {
			this.swaggerDefinition = Json.mapper().writeValueAsString(swagger);
		} catch (JsonProcessingException e) {
			throw new RuntimeException(e);
		}

		// require authentication to access the API documentation
		this.basicAuthenticator = BasicAuthenticator.fromSingleCredentials(
			configurationService.swaggerAccessUsername(),
			configurationService.swaggerAccessPassword(),
{'fraction_non_alphanumeric': 0.09894796701734433, 'fraction_numerical': 0.0, 'mean_word_length': 5.637735849056604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6006045', 'n_tokens_mistral': 1055, 'n_tokens_neox': 985, 'n_words': 229}