Package org.jboss.resteasy.core

Examples of org.jboss.resteasy.core.AcceptHeaderByFileSuffixFilter


         if (paramMapping != null)
         {
            providerFactory.getContainerRequestFilterRegistry().registerSingleton(new AcceptParameterHttpPreprocessor(paramMapping));
         }

         AcceptHeaderByFileSuffixFilter suffixNegotiationFilter = null;
         if (mediaTypeMappings != null)
         {
            Map<String, MediaType> extMap = new HashMap<String, MediaType>();
            for (Map.Entry<String, String> ext : mediaTypeMappings.entrySet())
            {
               String value = ext.getValue();
               extMap.put(ext.getKey().trim(), MediaType.valueOf(value.trim()));
            }

            if (suffixNegotiationFilter == null)
            {
               suffixNegotiationFilter = new AcceptHeaderByFileSuffixFilter();
               providerFactory.getContainerRequestFilterRegistry().registerSingleton(suffixNegotiationFilter);
            }
            suffixNegotiationFilter.setMediaTypeMappings(extMap);
         }


         if (languageExtensions != null)
         {
            if (suffixNegotiationFilter == null)
            {
               suffixNegotiationFilter = new AcceptHeaderByFileSuffixFilter();
               providerFactory.getContainerRequestFilterRegistry().registerSingleton(suffixNegotiationFilter);
            }
            suffixNegotiationFilter.setLanguageMappings(languageExtensions);
         }
      }
      finally
      {
         ResteasyProviderFactory.removeContextDataLevel();
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.core.AcceptHeaderByFileSuffixFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.