<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package se.cybercom.rest.doc;

import java.io.File;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.CodeSource;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;

import org.slf4j.Logger;

/**
 *
 * @author <NAME> <EMAIL>
 */
@Startup
@Singleton
public class RestDocHandler {

   private static final Logger logger = org.slf4j.LoggerFactory.getLogger( RestDocHandler.class.getName() );

   public static RestInfo restInfo = new RestInfo();


   @PostConstruct
   private void init() {


      restInfo.setClassInfo( new ArrayList<>() );
      restInfo.setDataModelInfo( new ArrayList<>() );

      String useRestDoc = System.getProperty( "use.rest-doc" );
      
      if( (useRestDoc != null) && useRestDoc.equals( "yes" ) ) {
         
         // Only do this if the file useRestDoc property is yes

         CodeSource src = RestDocHandler.class.getProtectionDomain().getCodeSource();<commit_msg>Added comment<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package se.cybercom.rest.doc;

import java.io.File;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.CodeSource;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;

import org.slf4j.Logger;

/**
 *
 * @author <NAME> <EMAIL>
 */
@Startup
@Singleton
public class RestDocHandler {

   private static final Logger logger = org.slf4j.LoggerFactory.getLogger( RestDocHandler.class.getName() );

   public static RestInfo restInfo = new RestInfo();

   /**
    * Add the folowing in wildfly
    *
    *  <system-properties>
    *    <property name="use.rest-doc" value="yes"/>
    *  </system-properties>
    */            
   @PostConstruct
   private void init() {


      restInfo.setClassInfo( new ArrayList<>() );
      restInfo.setDataModelInfo( new ArrayList<>() );

      String useRestDoc = System.getProperty( "use.rest-doc" );
      
      if( (useRestDoc != null) && useRestDoc.equals( "yes" ) ) {
         
         // Only do this if the file useRestDoc property is yes

         CodeSource src = RestDocHandler.class.getProtectionDomain().getCodeSource();
{'fraction_non_alphanumeric': 0.11441953830712613, 'fraction_numerical': 0.0013382402141184342, 'mean_word_length': 3.6, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '369101', 'n_tokens_mistral': 899, 'n_tokens_neox': 885, 'n_words': 238}