<commit_before>/**
 * Copyright (c) 2016 NumberFour AG.
 * 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:
 *   NumberFour AG - Initial API and implementation
 */
package org.eclipse.n4js.tester.server.resources;

import static com.google.common.base.Strings.nullToEmpty;
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
import static org.apache.log4j.Logger.getLogger;

import java.io.BufferedReader;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.eclipse.n4js.tester.fsm.TestFsmRegistry;

import com.google.inject.Inject;

/**
 * Base class of the HTTP resources.
 */
public abstract class BaseResource {

	/** Shared logger instance. */
	protected static final Logger LOGGER = getLogger(BaseResource.class);

	@Inject
	private TestFsmRegistry fsmRegistry;

	/**
	 * Handles the HTTP method. In case of supported request media type it reads the request body and delegates to
	 * {@link #doHandle(String, String)} method. sets the response status code and the response body.
	 *
	 * @param req
	 *            the HTTP servlet request.
	 * @param resp
	 *            the HTTP servlet response.
	 * @param escapedPathInfo
	 *            the escaped path info of the requested resource<commit_msg>GH-173: Fix wrong param in comment (#184)<commit_after>/**
 * Copyright (c) 2016 NumberFour AG.
 * 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:
 *   NumberFour AG - Initial API and implementation
 */
package org.eclipse.n4js.tester.server.resources;

import static com.google.common.base.Strings.nullToEmpty;
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
import static org.apache.log4j.Logger.getLogger;

import java.io.BufferedReader;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.eclipse.n4js.tester.fsm.TestFsmRegistry;

import com.google.inject.Inject;

/**
 * Base class of the HTTP resources.
 */
public abstract class BaseResource {

	/** Shared logger instance. */
	protected static final Logger LOGGER = getLogger(BaseResource.class);

	@Inject
	private TestFsmRegistry fsmRegistry;

	/**
	 * Handles the HTTP method. In case of supported request media type it reads the request body and delegates to
	 * {@link #doHandle(String, String)} method. sets the response status code and the response body.
	 *
	 * @param req
	 *            the HTTP servlet request.
	 * @param resp
	 *            the HTTP servlet response.
	 * @param pathInfo
	 *            the path info of the requested resource
{'fraction_non_alphanumeric': 0.08498324703015535, 'fraction_numerical': 0.009137983551629607, 'mean_word_length': 4.029096477794793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2375931', 'n_tokens_mistral': 932, 'n_tokens_neox': 890, 'n_words': 302}