001    package com.nimbusds.oauth2.sdk.http;
002    
003    
004    import javax.mail.internet.ContentType;
005    import javax.mail.internet.ParameterList;
006    
007    
008    /**
009     * Common content types used in the OAuth 2.0 protocol and implementing 
010     * applications. The character set all of content types is set to 
011     * {@link #DEFAULT_CHARSET UTF-8}.
012     *
013     * @author Vladimir Dzhuvinov
014     */
015    public final class CommonContentTypes {
016    
017    
018            /**
019             * The default character set.
020             */
021            public static final String DEFAULT_CHARSET = "UTF-8";
022    
023    
024            /**
025             * The default content type parameter list.
026             */
027            private static final ParameterList PARAM_LIST = new ParameterList();
028    
029    
030            /**
031             * Content type {@code application/json}.
032             */
033            public static final ContentType APPLICATION_JSON = new ContentType("application", "json", PARAM_LIST);
034            
035            
036            /**
037             * Content type {@code application/jwt}.
038             */
039            public static final ContentType APPLICATION_JWT = new ContentType("application", "jwt", PARAM_LIST);
040            
041            
042            /**
043             * Content type {@code application/x-www-form-urlencoded}.
044             */
045            public static final ContentType APPLICATION_URLENCODED = new ContentType("application", "x-www-form-urlencoded", PARAM_LIST);
046    
047    
048            static {
049    
050                    PARAM_LIST.set("charset", DEFAULT_CHARSET);
051            }
052    }