<commit_before>package com.plexiti.helper;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;

import javax.servlet.http.HttpServletRequest;

public final class Servlets {
	
	protected static Logger log = Logger.getLogger(Servlets.class.getName());
	
	public static String parseFilename(String urlString, boolean withExtension) {
		String path;
		try {
			path = new URL(urlString).getPath();
			String fileName = path.substring(path.lastIndexOf('/') + 1);
			return withExtension || !fileName.contains(".") ? fileName : fileName.substring(0, fileName.lastIndexOf('.'));
		} catch (MalformedURLException e) {
			throw new RuntimeException(e);
		}
	}
	
    public static String browser(HttpServletRequest request) {
        String userAgent= request.getHeader("user-agent");
        log.info("Logging request from User agent [" + userAgent + "]");
        String[] browsers = {"chrome", "safari", "firefox", "opera", "msie"};
        userAgent = userAgent.toLowerCase();
        for (String shortCut: browsers) {
            if (userAgent.indexOf(shortCut) != -1 ) {
            	shortCut = shortCut.equals("msie") ? "ie" : shortCut;
            	log.info("Detected User agent type: [" + shortCut + "]");
            	return shortCut;
            }
        }
    	log.warning("Could not detect Browser Vendor.");
        return "";
    }
	
}<commit_msg>Added camino detection (before firefox)<commit_after>package com.plexiti.helper;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;

import javax.servlet.http.HttpServletRequest;

public final class Servlets {
	
	protected static Logger log = Logger.getLogger(Servlets.class.getName());
	
	public static String parseFilename(String urlString, boolean withExtension) {
		String path;
		try {
			path = new URL(urlString).getPath();
			String fileName = path.substring(path.lastIndexOf('/') + 1);
			return withExtension || !fileName.contains(".") ? fileName : fileName.substring(0, fileName.lastIndexOf('.'));
		} catch (MalformedURLException e) {
			throw new RuntimeException(e);
		}
	}
	
    public static String browser(HttpServletRequest request) {
        String userAgent= request.getHeader("user-agent");
        log.info("Logging request from User agent [" + userAgent + "]");
        final String[] browsers = {"chrome", "safari", "camino", "firefox", "opera", "msie"}; // Beware: order might be important for detection!
        userAgent = userAgent.toLowerCase();
        for (String shortCut: browsers) {
            if (userAgent.indexOf(shortCut) != -1 ) {
            	shortCut = shortCut.equals("msie") ? "ie" : shortCut;
            	log.info("Detected User agent type: [" + shortCut + "]");
            	return shortCut;
            }
        }
    	log.warning("Could not detect Browser Vendor.");
        return "";
    }
	
}
{'fraction_non_alphanumeric': 0.13215400624349635, 'fraction_numerical': 0.002081165452653486, 'mean_word_length': 3.247422680412371, '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': '2486259', 'n_tokens_mistral': 855, 'n_tokens_neox': 820, 'n_words': 203}