<commit_before>package com.timepath.maven;

import com.timepath.launcher.util.IOUtils;
import com.timepath.launcher.util.JARUtils;
import com.timepath.launcher.util.Utils;
import com.timepath.launcher.util.XMLUtils;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import java.util.regex.Pattern;

/**
 * @author TimePath
 */
public class MavenResolver {

    public static final  String  REPO_CENTRAL = "http://repo.maven.apache.org/maven2";
    public static final  String  REPO_CUSTOM  = "https://dl.dropboxusercontent.com/u/42745598/maven2";
    private static final Pattern RE_VERSION   = Pattern.compile("(\\d*)\\.(\\d*)\\.(\\d*)");
    private static final Collection<String> repositories;
    private static final Logger              LOG           = Logger.getLogger(MavenResolver.class.getName());
    private static final long                META_LIFETIME = 10 * 60 * 1000;
    private static       Map<String, String> pomCache      = Collections.synchronizedMap(new HashMap<String, String>());
    private static       Map<String, String> urlCache      = Collections.synchronizedMap(new HashMap<String, String>());

    static {
        repositories = new LinkedHashSet<>();
        addRepository(REPO_CUSTOM);
        addRepository(REPO_CENTRAL);
    }

    private MavenResolver() {}

    /**
     * Add a repository
     *
     * @param url
     *         the URL
     */
    public static void addRepository(String url) {
        repositories.add(sanitize(url));
    }

    /**
     * Sanitize a repository URL
     *
     * @param url
     *         the URL
     *
     * @return the sanitized URL<commit_msg>Repository management<commit_after>package com.timepath.maven;

import com.timepath.launcher.util.IOUtils;
import com.timepath.launcher.util.JARUtils;
import com.timepath.launcher.util.Utils;
import com.timepath.launcher.util.XMLUtils;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import java.util.regex.Pattern;

/**
 * @author TimePath
 */
public class MavenResolver {

    private static final Collection<String> repositories;
    private static final String  REPO_CENTRAL   = "http://repo.maven.apache.org/maven2";
    private static final String  REPO_CUSTOM    = "https://dl.dropboxusercontent.com/u/42745598/maven2";
    private static final String  REPO_JETBRAINS = "http://repository.jetbrains.com/all";
    private static final Pattern RE_VERSION     = Pattern.compile("(\\d*)\\.(\\d*)\\.(\\d*)");
    private static final Logger  LOG            = Logger.getLogger(MavenResolver.class.getName());
    private static final long    META_LIFETIME  = 10 * 60 * 1000;

    static {
        repositories = new LinkedHashSet<>();
        addRepository(REPO_CUSTOM);
        addRepository(REPO_JETBRAINS);
        addRepository(REPO_CENTRAL);
    }

    private static Map<String, String> pomCache = Collections.synchronizedMap(new HashMap<String, String>());
    private static Map<String, String> urlCache = Collections.synchronizedMap(new HashMap<String, String>());

    private MavenResolver() {}

    /**
     * Add a repository
     *
     * @param url
     *         the URL
     */
    public static void addRepository(String url) {
        repositories.add(sanitize(url));
    }

    /**
     * Sanitize a repository URL
     *
     * @param url
     *         the URL
     *
     * @return the sanitized URL
{'fraction_non_alphanumeric': 0.11440369200874423, 'fraction_numerical': 0.009230021860578091, 'mean_word_length': 3.2322713257965057, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '3743988', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1241, 'n_words': 265}