<commit_before>/*
 * Copyright 2008-2011 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.nominanuda.web.http;

import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import com.nominanuda.lang.Collections;

import static org.apache.http.HttpStatus.*;


public interface HttpProtocol {
	String GET = "GET";
	String POST = "POST";
	String PUT = "PUT";
	String DELETE = "DELETE";
	String HEAD = "HEAD";
	String OPTIONS = "OPTIONS";

	String HDR_VIA = "Via";
	String HDR_DATE = "Date";
	String HDR_LOCATION = "Location";
	String HDR_CONTENT_ENCODING = "Content-Encoding";
	String HDR_CONTENT_TYPE = "Content-Type";
	String HDR_CONTENT_LENGTH = "Content-Length";
	String HDR_AUTHORIZATION = "Authorization";
	String HDR_WWW_AUTHENTICATE = "WWW-Authenticate";
	String HDR_CONNECTION = "Connection";
	String HDR_CLOSE = "close";
	String HDR_KEEP_ALIVE = "keep-alive";
	String HDR_HOST = "host";

	String UTF_8 = "UTF-8";
	Charset CS_UTF_8 = Charset.forName(UTF_8);
	String ISO_8859_1 = "ISO-8859-1";
	String ASCII = "ASCII";
	String CT_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded";
	String CT_WWW_FORM_URLENCODED_CS_UTF8 = "application/x-www-form-urlencoded; charset=UTF-8";
	String CT_TEXT_JAVASCRIPT = "text/javascript";
	String CT_TEXT_JAVASCRIPT_CS_UTF8 = "text/javascript; charset=UTF-8";
	String CT_TEXT_CSS = "text/css";
	String CT_TEXT_XML_CS_UTF8 = "text/xml; charset=UTF-8";
	String CT_TEXT_XML = "text/xml";
	String CT_APPLICATION_XML_CS_UTF8 = "application/xml; charset=UTF-8";
	String CT_APPLICATION_XML = "application/xml";
	String CT_TEXT_HTML_CS_UTF8 = "text/html; charset=UTF-8";
	String CT_TEXT_HTML = "text/html";
	String CT_TEXT_PLAIN_CS_UTF8 = "text/plain; charset=UTF-8";
	String CT_TEXT_PLAIN = "text/plain";
	String CT_ATOM_CS_UTF8 = "application/atom+xml; charset=UTF-8";
	String CT_ATOM = "application/atom+xml";
	String CT_APPLICATION_XQUERY_CS_UTF8 = "application/xquery; charset=UTF-8";
	String CT_APPLICATION_XQUERY = "application/xquery";
	String CT_APPLICATION_OCTET_STREAM = "application/octect-stream";
	String CT_APPLICATION_JSON_CS_UTF8 = "application/json; charset=UTF-8";
	String CT_APPLICATION_JSON = "application/json";
	String CT_IMAGE_JPEG = "image/jpeg";
	String CT_IMAGE_GIF = "image/gif";
	String CT_IMAGE_PNG = "image/png";

	Set<String> ONE_HOP_HEADERS = Collections.hashSet(
"proxy-connection","connection","keep-alive","transfer-encoding","te","trailer","proxy-authorization","proxy-authenticate","upgrade","content-length"
	);

	Map<Integer, String> statusToReason = Collections.buildMap(HashMap.class,
			SC_OK, "200 OK",
			SC_CREATED, "201 Created",
			SC_MOVED_PERMANENTLY, "301 Moved Permanently",
			SC_MOVED_TEMPORARILY, "302 Moved Temporarily",
			SC_NOT_MODIFIED, "304 Not Modified",
			SC_TEMPORARY_REDIRECT, "307 Temporary Redirect",
			SC_BAD_REQUEST, "400 Bad Request",
			SC_UNAUTHORIZED, "401 Unauthorized",
			SC_FORBIDDEN, "403 Forbidden",
			SC_NOT_FOUND, "404 Not Found",
			SC_METHOD_NOT_ALLOWED, "405 Method Not Allowed",
			SC_REQUEST_TIMEOUT, "408 Request Timeout",
			SC_INTERNAL_SERVER_ERROR, "500 Server Error",<commit_msg>added "image/x-icon"<commit_after>/*
 * Copyright 2008-2011 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.nominanuda.web.http;

import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import com.nominanuda.lang.Collections;

import static org.apache.http.HttpStatus.*;


public interface HttpProtocol {
	String GET = "GET";
	String POST = "POST";
	String PUT = "PUT";
	String DELETE = "DELETE";
	String HEAD = "HEAD";
	String OPTIONS = "OPTIONS";

	String HDR_VIA = "Via";
	String HDR_DATE = "Date";
	String HDR_LOCATION = "Location";
	String HDR_CONTENT_ENCODING = "Content-Encoding";
	String HDR_CONTENT_TYPE = "Content-Type";
	String HDR_CONTENT_LENGTH = "Content-Length";
	String HDR_AUTHORIZATION = "Authorization";
	String HDR_WWW_AUTHENTICATE = "WWW-Authenticate";
	String HDR_CONNECTION = "Connection";
	String HDR_CLOSE = "close";
	String HDR_KEEP_ALIVE = "keep-alive";
	String HDR_HOST = "host";

	String UTF_8 = "UTF-8";
	Charset CS_UTF_8 = Charset.forName(UTF_8);
	String ISO_8859_1 = "ISO-8859-1";
	String ASCII = "ASCII";
	String CT_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded";
	String CT_WWW_FORM_URLENCODED_CS_UTF8 = "application/x-www-form-urlencoded; charset=UTF-8";
	String CT_TEXT_JAVASCRIPT = "text/javascript";
	String CT_TEXT_JAVASCRIPT_CS_UTF8 = "text/javascript; charset=UTF-8";
	String CT_TEXT_CSS = "text/css";
	String CT_TEXT_XML_CS_UTF8 = "text/xml; charset=UTF-8";
	String CT_TEXT_XML = "text/xml";
	String CT_APPLICATION_XML_CS_UTF8 = "application/xml; charset=UTF-8";
	String CT_APPLICATION_XML = "application/xml";
	String CT_TEXT_HTML_CS_UTF8 = "text/html; charset=UTF-8";
	String CT_TEXT_HTML = "text/html";
	String CT_TEXT_PLAIN_CS_UTF8 = "text/plain; charset=UTF-8";
	String CT_TEXT_PLAIN = "text/plain";
	String CT_ATOM_CS_UTF8 = "application/atom+xml; charset=UTF-8";
	String CT_ATOM = "application/atom+xml";
	String CT_APPLICATION_XQUERY_CS_UTF8 = "application/xquery; charset=UTF-8";
	String CT_APPLICATION_XQUERY = "application/xquery";
	String CT_APPLICATION_OCTET_STREAM = "application/octect-stream";
	String CT_APPLICATION_JSON_CS_UTF8 = "application/json; charset=UTF-8";
	String CT_APPLICATION_JSON = "application/json";
	String CT_IMAGE_JPEG = "image/jpeg";
	String CT_IMAGE_GIF = "image/gif";
	String CT_IMAGE_PNG = "image/png";
	String CT_IMAGE_X_ICON = "image/x-icon";

	Set<String> ONE_HOP_HEADERS = Collections.hashSet(
"proxy-connection","connection","keep-alive","transfer-encoding","te","trailer","proxy-authorization","proxy-authenticate","upgrade","content-length"
	);

	Map<Integer, String> statusToReason = Collections.buildMap(HashMap.class,
			SC_OK, "200 OK",
			SC_CREATED, "201 Created",
			SC_MOVED_PERMANENTLY, "301 Moved Permanently",
			SC_MOVED_TEMPORARILY, "302 Moved Temporarily",
			SC_NOT_MODIFIED, "304 Not Modified",
			SC_TEMPORARY_REDIRECT, "307 Temporary Redirect",
			SC_BAD_REQUEST, "400 Bad Request",
			SC_UNAUTHORIZED, "401 Unauthorized",
			SC_FORBIDDEN, "403 Forbidden",
			SC_NOT_FOUND, "404 Not Found",
			SC_METHOD_NOT_ALLOWED, "405 Method Not Allowed",
			SC_REQUEST_TIMEOUT, "408 Request Timeout",
			SC_INTERNAL_SERVER_ERROR, "500 Server Error",
{'fraction_non_alphanumeric': 0.11469054939179255, 'fraction_numerical': 0.022189546852025132, 'mean_word_length': 5.422317596566524, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 12}, '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': '6962294', 'n_tokens_mistral': 2807, 'n_tokens_neox': 2600, 'n_words': 613}