<commit_before>package ca.uhn.fhir.rest.api;

/*
 * #%L
 * HAPI FHIR - Core Library
 * %%
 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
 * %%
 * 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.
 * #L%
 */

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.apache.commons.lang3.StringUtils.defaultIfBlank;

public class Constants {

	public static final String CT_TEXT_CSV = "text/csv";
	public static final String HEADER_REQUEST_ID = "X-Request-ID";
	public static final String HEADER_REQUEST_SOURCE = "X-Request-Source";
	public static final String CACHE_CONTROL_MAX_RESULTS = "max-results";
	public static final String CACHE_CONTROL_NO_CACHE = "no-cache";
	public static final String CACHE_CONTROL_NO_STORE = "no-store";
	public static final String CHARSET_NAME_UTF8 = "UTF-8";
	public static final Charset CHARSET_UTF8;
	public static final String CHARSET_UTF8_CTSUFFIX = "; charset=" + CHARSET_NAME_UTF8;
	/**
	 * Contains a standard set of headers which are used by FHIR / HAPI FHIR, and therefore
	 * would make a useful set for CORS AllowedHeader declarations
	 */
	public static final Set<String> CORS_ALLOWED_HEADERS;
	/**
	 * Contains a standard set of HTTP Methods which are used by FHIR / HAPI FHIR, and therefore
	 * would make a useful set for CORS AllowedMethod declarations
	 */
	public static final Set<String> CORS_ALLWED_METHODS;
	public static final String CT_FHIR_JSON = "application/json+fhir";
	public static final String CT_RDF_TURTLE = "application/x-turtle";
	/**
	 * The FHIR MimeType for JSON encoding in FHIR DSTU3+
	 */
	public static final String CT_FHIR_JSON_NEW = "application/fhir+json";
	public static final String CT_FHIR_XML = "application/xml+fhir";


	/**
	 * The FHIR MimeType for XML encoding in FHIR DSTU3+
	 */
	public static final String CT_FHIR_XML_NEW = "application/fhir+xml";
	public static final String CT_HTML = "text/html";
	public static final String CT_HTML_WITH_UTF8 = "text/html" + CHARSET_UTF8_CTSUFFIX;
	public static final String CT_JSON = "application/json";
	public static final String CT_GRAPHQL = "application/graphql";
	public static final String CT_JSON_PATCH = "application/json-patch+json";
	public static final String CT_OCTET_STREAM = "application/octet-stream";
	public static final String CT_TEXT = "text/plain";
	public static final String CT_TEXT_WITH_UTF8 = CT_TEXT + CHARSET_UTF8_CTSUFFIX;
	public static final String CT_X_FORM_URLENCODED = "application/x-www-form-urlencoded";
	public static final String CT_XML = "application/xml";
	public static final String CT_XML_PATCH = "application/xml-patch+xml";
	public static final String ENCODING_GZIP = "gzip";
	public static final String EXTOP_PROCESS_MESSAGE = "$process-message"; //Used in messaging
	public static final String EXTOP_VALIDATE = "$validate";
	public static final String EXTOP_VALIDATE_MODE = "mode";
	public static final String EXTOP_VALIDATE_PROFILE = "profile";
	public static final String EXTOP_VALIDATE_RESOURCE = "resource";
	public static final String FORMAT_HTML = "html";
	public static final String FORMAT_JSON = "json";
        public static final String FORMAT_NDJSON = "ndjson";
	public static final String FORMAT_XML = "xml";
	public static final String CT_RDF_TURTLE_LEGACY = "text/turtle";
	public static final String FORMAT_TURTLE = "ttl";


	/**
	 * "text/html" and "html"
	 */
	public static final Set<String> FORMATS_HTML;
	public static final String FORMATS_HTML_JSON = "html/json";
	public static final String FORMATS_HTML_XML = "html/xml";<commit_msg>define constant for new text/xml+cda content type (#3207)<commit_after>package ca.uhn.fhir.rest.api;

/*
 * #%L
 * HAPI FHIR - Core Library
 * %%
 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
 * %%
 * 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.
 * #L%
 */

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import static org.apache.commons.lang3.StringUtils.defaultIfBlank;

public class Constants {

	public static final String CT_TEXT_CSV = "text/csv";
	public static final String HEADER_REQUEST_ID = "X-Request-ID";
	public static final String HEADER_REQUEST_SOURCE = "X-Request-Source";
	public static final String CACHE_CONTROL_MAX_RESULTS = "max-results";
	public static final String CACHE_CONTROL_NO_CACHE = "no-cache";
	public static final String CACHE_CONTROL_NO_STORE = "no-store";
	public static final String CHARSET_NAME_UTF8 = "UTF-8";
	public static final Charset CHARSET_UTF8;
	public static final String CHARSET_UTF8_CTSUFFIX = "; charset=" + CHARSET_NAME_UTF8;
	/**
	 * Contains a standard set of headers which are used by FHIR / HAPI FHIR, and therefore
	 * would make a useful set for CORS AllowedHeader declarations
	 */
	public static final Set<String> CORS_ALLOWED_HEADERS;
	/**
	 * Contains a standard set of HTTP Methods which are used by FHIR / HAPI FHIR, and therefore
	 * would make a useful set for CORS AllowedMethod declarations
	 */
	public static final Set<String> CORS_ALLWED_METHODS;
	public static final String CT_FHIR_JSON = "application/json+fhir";
	public static final String CT_RDF_TURTLE = "application/x-turtle";
	/**
	 * The FHIR MimeType for JSON encoding in FHIR DSTU3+
	 */
	public static final String CT_FHIR_JSON_NEW = "application/fhir+json";
	public static final String CT_FHIR_XML = "application/xml+fhir";


	/**
	 * The FHIR MimeType for XML encoding in FHIR DSTU3+
	 */
	public static final String CT_FHIR_XML_NEW = "application/fhir+xml";
	public static final String CT_HTML = "text/html";
	public static final String CT_HTML_WITH_UTF8 = "text/html" + CHARSET_UTF8_CTSUFFIX;
	public static final String CT_JSON = "application/json";
	public static final String CT_GRAPHQL = "application/graphql";
	public static final String CT_JSON_PATCH = "application/json-patch+json";
	public static final String CT_OCTET_STREAM = "application/octet-stream";
	public static final String CT_TEXT = "text/plain";
	public static final String CT_TEXT_WITH_UTF8 = CT_TEXT + CHARSET_UTF8_CTSUFFIX;
	public static final String CT_TEXT_CDA = "text/xml+cda";
	public static final String CT_X_FORM_URLENCODED = "application/x-www-form-urlencoded";
	public static final String CT_XML = "application/xml";
	public static final String CT_XML_PATCH = "application/xml-patch+xml";
	public static final String ENCODING_GZIP = "gzip";
	public static final String EXTOP_PROCESS_MESSAGE = "$process-message"; //Used in messaging
	public static final String EXTOP_VALIDATE = "$validate";
	public static final String EXTOP_VALIDATE_MODE = "mode";
	public static final String EXTOP_VALIDATE_PROFILE = "profile";
	public static final String EXTOP_VALIDATE_RESOURCE = "resource";
	public static final String FORMAT_HTML = "html";
	public static final String FORMAT_JSON = "json";
        public static final String FORMAT_NDJSON = "ndjson";
	public static final String FORMAT_XML = "xml";
	public static final String CT_RDF_TURTLE_LEGACY = "text/turtle";
	public static final String FORMAT_TURTLE = "ttl";


	/**
	 * "text/html" and "html"
	 */
	public static final Set<String> FORMATS_HTML;
	public static final String FORMATS_HTML_JSON = "html/json";
	public static final String FORMATS_HTML_XML = "html/xml";
{'fraction_non_alphanumeric': 0.08411543876114501, 'fraction_numerical': 0.006100422336931018, 'mean_word_length': 4.791440217391305, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 16}, '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': '5831150', 'n_tokens_mistral': 2710, 'n_tokens_neox': 2589, 'n_words': 890}