<commit_before>package org.openqa.selenium.server.browserlaunchers;

import java.io.*;

public class KonquerorLauncher extends AbstractBrowserLauncher {
	private static final String KONQUEROR_PROFILE_SRC_LOCATION = "/konqueror";

	private static final String KONQUEROR_PROFILE_DEST_LOCATION = System.getProperty("user.home") + "/.kde/share/config";

	private static final String DEFAULT_KONQUEROR_LOCATION = "/usr/bin/konqueror";

	private Process process;

	private String browserLaunchLocation;

	private int port;

	public KonquerorLauncher(int port, String sessionId) {
		this(port, sessionId, DEFAULT_KONQUEROR_LOCATION);
	}

	public KonquerorLauncher(int port, String sessionId, String browserLaunchLocation) {
		super(sessionId);
		this.port = port;
		this.browserLaunchLocation = browserLaunchLocation;
	}

	@Override
	protected void launch(String url) {
		try {
			makeCustomProfile();
		} catch (IOException e) {
			e.printStackTrace();
		}
		exec(browserLaunchLocation + " " + url);
	}

	private void makeCustomProfile() throws IOException {
        File profileDest = new File(KONQUEROR_PROFILE_DEST_LOCATION);
        ResourceExtractor.extractResourcePath(getClass(), KONQUEROR_PROFILE_SRC_LOCATION, profileDest);
		

		File pacFile = LauncherUtils.makeProxyPAC(new File(KONQUEROR_PROFILE_DEST_LOCATION), port);

		File kioslaverc = new File(KONQUEROR_PROFILE_DEST_LOCATION, "kioslaverc");
		PrintStream out = new PrintStream(new FileOutputStream(kioslaverc));
		out.println("PersistentProxyConnection=false");
		out.println("[Proxy Settings]");
		out.println("AuthMode=0");
		out.println("Proxy Config Script=file://" + pacFile.getAbsolutePath());
		out.println("ProxyType=2");
		out.println("ReversedException=false");
		out.close();

	}

	public void close() {
		if (process == null) return;
        AsyncExecute.killProcess(process);
	}

    public Process getProcess() {
        return process;
    }

    protected void exec(String command) {

		try {
			process = Runtime.getRuntime().exec(command);
		} catch (IOException e) {
			throw new RuntimeException("Error starting browser by executing command " + command + ": " + e);
		}
	}

}<commit_msg>if konqueror can;t be found, point to help URL<commit_after>package org.openqa.selenium.server.browserlaunchers;

import java.io.*;

public class KonquerorLauncher extends AbstractBrowserLauncher {
	private static final String KONQUEROR_PROFILE_SRC_LOCATION = "/konqueror";

	private static final String KONQUEROR_PROFILE_DEST_LOCATION = System.getProperty("user.home") + "/.kde/share/config";

	private static final String DEFAULT_KONQUEROR_LOCATION = "/usr/bin/konqueror";

	private Process process;

	private String browserLaunchLocation;

	private int port;

	public KonquerorLauncher(int port, String sessionId) {
		this(port, sessionId, DEFAULT_KONQUEROR_LOCATION);
	}

	public KonquerorLauncher(int port, String sessionId, String browserLaunchLocation) {
		super(sessionId);
		this.port = port;
		this.browserLaunchLocation = browserLaunchLocation;
	}

	@Override
	protected void launch(String url) {
		try {
			makeCustomProfile();
		} catch (IOException e) {
			e.printStackTrace();
		}
		exec(browserLaunchLocation + " " + url);
	}

	private void makeCustomProfile() throws IOException {
        File profileDest = new File(KONQUEROR_PROFILE_DEST_LOCATION);
        ResourceExtractor.extractResourcePath(getClass(), KONQUEROR_PROFILE_SRC_LOCATION, profileDest);
		

		File pacFile = LauncherUtils.makeProxyPAC(new File(KONQUEROR_PROFILE_DEST_LOCATION), port);

		File kioslaverc = new File(KONQUEROR_PROFILE_DEST_LOCATION, "kioslaverc");
		PrintStream out = new PrintStream(new FileOutputStream(kioslaverc));
		out.println("PersistentProxyConnection=false");
		out.println("[Proxy Settings]");
		out.println("AuthMode=0");
		out.println("Proxy Config Script=file://" + pacFile.getAbsolutePath());
		out.println("ProxyType=2");
		out.println("ReversedException=false");
		out.close();

	}

	public void close() {
		if (process == null) return;
        AsyncExecute.killProcess(process);
	}

    public Process getProcess() {
        return process;
    }

    protected void exec(String command) {

		try {
			process = Runtime.getRuntime().exec(command);
		} catch (IOException e) {
			throw new RuntimeException("Error starting browser by executing command " + command + ": " + e + "\n See http://openqa.org/selenium-rc/help/launching-konqueror.html");
		}
	}

}
{'fraction_non_alphanumeric': 0.1080594326879784, 'fraction_numerical': 0.0009004952723998199, 'mean_word_length': 4.963758389261745, 'pattern_counts': {'":': 2, '<': 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': '1121641', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1364, 'n_words': 293}