<commit_before>package org.fiteagle.core.federationManager.dm;

import java.io.File;
import java.io.FileWriter;
import java.io.Writer;

import javax.inject.Inject;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.fiteagle.api.core.IConfig;
import org.fiteagle.core.federationManager.FederationManager;

@Path("/")
public class FederationManagerREST{
FederationManager restManager;
Writer writer;

//@Inject ControlFilter filter;

	  @POST
	  @Path("/ontology")
	  @Consumes("text/turtle")
	  @Produces("text/html")
	  public Response updateOntology(String ontology) {
		  try{
			File ontologyFile = IConfig.PROPERTIES_DIRECTORY.resolve("Federation.ttl").toFile();
			if (!ontologyFile.exists()) ontologyFile.createNewFile();
			
			writer = new FileWriter(ontologyFile);
			writer.write(ontology);
			writer.flush();
			writer.close();
			
	    	restManager = FederationManager.getManager();
	    	restManager.setup();
	    	return Response.status(Response.Status.OK.getStatusCode()).build();
	    }catch(Exception e){
	    	
	    }
	    return Response.status(Response.Status.CONFLICT.getStatusCode()).build();
	  }
	  
	  @POST
	  @Path("/failedAuth")
	  @Consumes("text/turtle")
	  @Produces("text/html")
	  public Response failedAuthentication() {
	    return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
	  }
}<commit_msg>deleted unneeded method<commit_after>package org.fiteagle.core.federationManager.dm;

import java.io.File;
import java.io.FileWriter;
import java.io.Writer;

import javax.inject.Inject;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.fiteagle.api.core.IConfig;
import org.fiteagle.core.federationManager.FederationManager;

@Path("/")
public class FederationManagerREST{
FederationManager restManager;
Writer writer;

//@Inject ControlFilter filter;

	  @POST
	  @Path("/ontology")
	  @Consumes("text/turtle")
	  @Produces("text/html")
	  public Response updateOntology(String ontology) {
		  try{
			File ontologyFile = IConfig.PROPERTIES_DIRECTORY.resolve("Federation.ttl").toFile();
			if (!ontologyFile.exists()) ontologyFile.createNewFile();
			
			writer = new FileWriter(ontologyFile);
			writer.write(ontology);
			writer.flush();
			writer.close();
			
	    	restManager = FederationManager.getManager();
	    	restManager.setup();
	    	return Response.status(Response.Status.OK.getStatusCode()).build();
	    }catch(Exception e){
	    	
	    }
	    return Response.status(Response.Status.CONFLICT.getStatusCode()).build();
	  }
}
{'fraction_non_alphanumeric': 0.13486725663716814, 'fraction_numerical': 0.0, 'mean_word_length': 4.382857142857143, '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': '685095', 'n_tokens_mistral': 984, 'n_tokens_neox': 900, 'n_words': 149}