<commit_before>package ru.szhernovoy;

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

/**
 * Created by admin on 23.07.2016.
 */
public class Find {

    private LogWriter lgwr = new LogWriter();
    private String[] keys;
    private FilenameFilter filter;
    private ValidateKeys valid ;
    private String directory;

    public Find(String...keys) throws IOException {
        this.keys = new String[keys.length];
        int index = 0;
        for (String key: keys) {
            this.keys[index++] = key;
        }
        valid =new ValidateKeys(this.keys);
    }

    public  void work(){
        if(this.valid.validate()){
           this.filter = valid.getAction();
           this.directory = valid.getDirectory();
           StringBuilder builder = new StringBuilder();
           String result = getFileNames(this.directory,this.filter,builder).toString();
           lgwr.init();
           lgwr.writeLog(result);
           System.out.println("It's fine !!!");
        }
    }

    public StringBuilder getFileNames(String directory, FilenameFilter obj,StringBuilder builder){

           File file = new File(directory);
           for(File name : file.listFiles(obj)){
               //File itCatalog = new File(name);
               if(name.exists() && name.isDirectory()){
                   this.getFileNames(directory,obj,builder);
               }
               else{
                   builder.append(String.format("\n%s", name.getName()));
               }
           }
           return  builder;
    }

    public static void main(String[] args) throws IOException {
        Find find = new Find(args);
        find.work();
    }

}<commit_msg>find is ready<commit_after>package ru.szhernovoy;

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

/**
 * Created by admin on 23.07.2016.
 */
public class Find {

    private LogWriter lgwr = new LogWriter();
    private String[] keys;
    private FilenameFilter filter;
    private ValidateKeys valid ;
    private String directory;

    public Find(String...keys) throws IOException {
        this.keys = new String[keys.length];
        int index = 0;
        for (String key: keys) {
            this.keys[index++] = key;
        }
        valid =new ValidateKeys(this.keys);
    }

    public  void work(){
        if(this.valid.validate()){
           this.filter = valid.getAction();
           this.directory = valid.getDirectory();
           StringBuilder builder = new StringBuilder();
           String result = getFileNames(this.directory,this.filter,builder).toString();
           lgwr.init();
           lgwr.writeLog(result);
           System.out.println("It's find OK!!! Let's see log file");
        }
    }

    public StringBuilder getFileNames(String directory, FilenameFilter obj,StringBuilder builder){

           File file = new File(directory);

           for(File nameFile : file.listFiles(obj)){
               builder.append(String.format("\npath:%s\tname:%s",directory, nameFile.getName()));
           }

           for(File nameDirectory : file.listFiles()){
               //File itCatalog = new File(name);
               if(nameDirectory.exists() && nameDirectory.isDirectory()){
                   this.getFileNames(nameDirectory.getAbsolutePath(),obj,builder);
               }
              }

           return  builder;
    }

    public static void main(String[] args) throws IOException {
        Find find = new Find(args);
        find.work();
    }

}
{'fraction_non_alphanumeric': 0.11669963266459452, 'fraction_numerical': 0.005086182537439954, 'mean_word_length': 2.1079894644424932, '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': '1884187', 'n_tokens_mistral': 960, 'n_tokens_neox': 926, 'n_words': 227}