001/* 002 * oauth2-oidc-sdk 003 * 004 * Copyright 2012-2016, Connect2id Ltd and contributors. 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use 007 * this file except in compliance with the License. You may obtain a copy of the 008 * License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software distributed 013 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 014 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 015 * specific language governing permissions and limitations under the License. 016 */ 017 018package com.nimbusds.oauth2.sdk.http; 019 020 021import javax.mail.internet.ContentType; 022import javax.mail.internet.ParameterList; 023 024 025/** 026 * Common content types used in the OAuth 2.0 protocol and implementing 027 * applications. The character set all of content types is set to 028 * {@link #DEFAULT_CHARSET UTF-8}. 029 */ 030public final class CommonContentTypes { 031 032 033 /** 034 * The default character set. 035 */ 036 public static final String DEFAULT_CHARSET = "UTF-8"; 037 038 039 /** 040 * The default content type parameter list. 041 */ 042 private static final ParameterList PARAM_LIST = new ParameterList(); 043 044 045 /** 046 * Content type {@code application/json}. 047 */ 048 public static final ContentType APPLICATION_JSON = new ContentType("application", "json", PARAM_LIST); 049 050 051 /** 052 * Content type {@code application/jose}. 053 */ 054 public static final ContentType APPLICATION_JOSE = new ContentType("application", "jose", PARAM_LIST); 055 056 057 /** 058 * Content type {@code application/jwt}. 059 */ 060 public static final ContentType APPLICATION_JWT = new ContentType("application", "jwt", PARAM_LIST); 061 062 063 /** 064 * Content type {@code application/x-www-form-urlencoded}. 065 */ 066 public static final ContentType APPLICATION_URLENCODED = new ContentType("application", "x-www-form-urlencoded", PARAM_LIST); 067 068 069 static { 070 PARAM_LIST.set("charset", DEFAULT_CHARSET); 071 } 072}