<commit_before>package com.metacodestudio.hotsuploader.files;

import com.google.gson.Gson;
import com.metacodestudio.hotsuploader.providers.Provider;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Paths;
import java.nio.file.WatchService;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;

import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;

public class FileHandler extends Service<ReplayFile> {

    public static final String ACCOUNT_FOLDER_FILTER = "(\\d+[^A-Za-z,.\\-()\\s])";
    public static final String HOTS_ACCOUNT_FILTER = "(\\d-Hero-\\d-\\d{6})";
    private final List<File> watchDirectories;
    private WatchService watchService;
    private Map<Status, ObservableList<ReplayFile>> fileMap;
    private List<Provider> providers = Provider.getAll();
    private BlockingQueue<ReplayFile> uploadQueue;
    private final Gson gson;

    public FileHandler(final File root) throws IOException {
        gson = new Gson();
        uploadQueue = new ArrayBlockingQueue<>(2500);
        fileMap = new HashMap<>();
        watchDirectories = getWatchDirectories(root);
        watchDirectories.forEach(System.out::println);

        watchService = FileSystems.getDefault().newWatchService();
        watchDirectories.stream().map(file -> Paths.get(file.toString())).forEach(path -> {
            try {
                path.register(watchService, ENTRY_CREATE, ENTRY_MODIFY);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        });
        registerInitial();<commit_msg>fix regex matching(apparently they weren't -all- 6 digits)<commit_after>package com.metacodestudio.hotsuploader.files;

import com.google.gson.Gson;
import com.metacodestudio.hotsuploader.providers.Provider;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Paths;
import java.nio.file.WatchService;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;

import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;

public class FileHandler extends Service<ReplayFile> {

    public static final String ACCOUNT_FOLDER_FILTER = "(\\d+[^A-Za-z,.\\-()\\s])";
    public static final String HOTS_ACCOUNT_FILTER = "(\\d-Hero-\\d-\\d{1,6})";
    private final List<File> watchDirectories;
    private WatchService watchService;
    private Map<Status, ObservableList<ReplayFile>> fileMap;
    private List<Provider> providers = Provider.getAll();
    private BlockingQueue<ReplayFile> uploadQueue;
    private final Gson gson;

    public FileHandler(final File root) throws IOException {
        gson = new Gson();
        uploadQueue = new ArrayBlockingQueue<>(2500);
        fileMap = new HashMap<>();
        watchDirectories = getWatchDirectories(root);
        watchDirectories.forEach(System.out::println);

        watchService = FileSystems.getDefault().newWatchService();
        watchDirectories.stream().map(file -> Paths.get(file.toString())).forEach(path -> {
            try {
                path.register(watchService, ENTRY_CREATE, ENTRY_MODIFY);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        });
        registerInitial();
{'fraction_non_alphanumeric': 0.11081667068176343, 'fraction_numerical': 0.002890869669959046, 'mean_word_length': 4.026634382566586, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '2562012', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1191, 'n_words': 238}