<commit_before>/*******************************************************************************
 *  Copyright (c) 2012 VMware, Inc.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *      VMware, Inc. - initial API and implementation
 *******************************************************************************/
package com.vmware.vfabric.ide.eclipse.tcserver.reloading;

import java.io.File;
import java.net.URL;
import java.util.Enumeration;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;

/**
 * @author <NAME>
 */
public class TcServerReloadingPlugin extends Plugin {

	private static final String PLUGIN_ID = "com.vmware.vfabric.ide.eclipse.tcserver.reloading";

	private static TcServerReloadingPlugin plugin;

	private static String agentJarPath;

	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}

	public void stop(BundleContext context) throws Exception {
		super.stop(context);
		plugin = null;
	}

	@SuppressWarnings("unchecked")
	public synchronized static String getAgentJarPath() {
		if (agentJarPath == null) {
			Enumeration<URL> libs = plugin.getBundle().findEntries("/lib", "springloaded-*.jar", false);
			while (libs.hasMoreElements()) {
				try {
					agentJarPath = new File(FileLocator.toFileURL(libs.nextElement()).toURI()).getCanonicalPath();
				}
				catch (Exception e) {
					plugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "Error loading tc Server Agent Jar", e));
				}
			}
		}
		return agentJarPath;
	}

}<commit_msg>STS-2833: now getting file path via toFileURL().getPath() instead of toFileURL().toURI()<commit_after>/*******************************************************************************
 *  Copyright (c) 2012 VMware, Inc.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *      VMware, Inc. - initial API and implementation
 *******************************************************************************/
package com.vmware.vfabric.ide.eclipse.tcserver.reloading;

import java.io.File;
import java.net.URL;
import java.util.Enumeration;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;

/**
 * @author <NAME>
 */
public class TcServerReloadingPlugin extends Plugin {

	private static final String PLUGIN_ID = "com.vmware.vfabric.ide.eclipse.tcserver.reloading";

	private static TcServerReloadingPlugin plugin;

	private static String agentJarPath;

	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}

	public void stop(BundleContext context) throws Exception {
		super.stop(context);
		plugin = null;
	}

	@SuppressWarnings("unchecked")
	public synchronized static String getAgentJarPath() {
		if (agentJarPath == null) {
			Enumeration<URL> libs = plugin.getBundle().findEntries("/lib", "springloaded-*.jar", false);
			while (libs.hasMoreElements()) {
				try {
					URL nextLib = libs.nextElement();
					agentJarPath = new File(FileLocator.toFileURL(nextLib).getPath()).getCanonicalPath();
				}
				catch (Exception e) {
					plugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "Error loading tc Server Agent Jar", e));
				}
			}
		}
		return agentJarPath;
	}

}
{'fraction_non_alphanumeric': 0.18460751725901303, 'fraction_numerical': 0.005113781641523907, 'mean_word_length': 4.752941176470588, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4338734', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1114, 'n_words': 282}