cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1464337 - in /cxf/trunk/rt: frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/ frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ frontend/jaxrs/src/main/jav...
Date Thu, 04 Apr 2013 07:56:47 GMT
Author: sergeyb
Date: Thu Apr  4 07:56:46 2013
New Revision: 1464337

URL: http://svn.apache.org/r1464337
Log:
[CXF-4825] Replacing MediaType.valueOf calls with the internal util calls

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Attachment.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WriterInterceptorMBW.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataSourceProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Attachment.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Attachment.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Attachment.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Attachment.java
Thu Apr  4 07:56:46 2013
@@ -32,6 +32,7 @@ import javax.ws.rs.ext.MessageBodyReader
 import javax.ws.rs.ext.Providers;
 
 import org.apache.cxf.jaxrs.impl.MetadataMap;
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 
 /**
  * This class represents an attachment; generally a multipart part. 
@@ -112,7 +113,7 @@ public class Attachment {
 
     public MediaType getContentType() {
         String value = handler != null ? handler.getContentType() : headers.getFirst("Content-Type");
-        return value == null ? MediaType.TEXT_PLAIN_TYPE : MediaType.valueOf(value);
+        return value == null ? MediaType.TEXT_PLAIN_TYPE : JAXRSUtils.toMediaType(value);
     }
 
     public DataHandler getDataHandler() {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/MultipartBody.java
Thu Apr  4 07:56:46 2013
@@ -24,12 +24,14 @@ import java.util.List;
 
 import javax.ws.rs.core.MediaType;
 
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
+
 public class MultipartBody {
     
     public static final String INBOUND_MESSAGE_ATTACHMENTS = "org.apache.cxf.jaxrs.attachments.inbound";
     public static final String OUTBOUND_MESSAGE_ATTACHMENTS = "org.apache.cxf.jaxrs.attachments.outbound";
     
-    private static final MediaType MULTIPART_RELATED_TYPE = MediaType.valueOf("multipart/related");

+    private static final MediaType MULTIPART_RELATED_TYPE = JAXRSUtils.toMediaType("multipart/related");

     private boolean outbound;
     private List<Attachment> atts;
     private MediaType mt; 

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/HttpHeadersImpl.java
Thu Apr  4 07:56:46 2013
@@ -134,7 +134,7 @@ public class HttpHeadersImpl implements 
 
     public MediaType getMediaType() {
         List<String> values = getListValues(HttpHeaders.CONTENT_TYPE);
-        return values.size() == 0 ? null : MediaType.valueOf(values.get(0));
+        return values.size() == 0 ? null : JAXRSUtils.toMediaType(values.get(0));
     }
 
     public MultivaluedMap<String, String> getRequestHeaders() {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MediaTypeHeaderProvider.java
Thu Apr  4 07:56:46 2013
@@ -45,6 +45,11 @@ public class MediaTypeHeaderProvider imp
     
     public MediaType fromString(String mType) {
         
+        return valueOf(mType);
+    }
+
+    public static MediaType valueOf(String mType) {
+        
         if (mType == null) {
             throw new IllegalArgumentException("Media type value can not be null");
         }
@@ -84,7 +89,7 @@ public class MediaTypeHeaderProvider imp
                              subtype.trim().toLowerCase(), 
                              parameters);
     }
-
+    
     private static void addParameter(Map<String, String> parameters, String token)
{
         int equalSign = token.indexOf('=');
         if (equalSign == -1) {
@@ -110,7 +115,7 @@ public class MediaTypeHeaderProvider imp
         return sb.toString();
     }
 
-    private MediaType handleMediaTypeWithoutSubtype(String mType) {
+    private static MediaType handleMediaTypeWithoutSubtype(String mType) {
         if (mType.startsWith(MediaType.MEDIA_TYPE_WILDCARD)) {
             char next = mType.length() == 1 ? ' ' : mType.charAt(1);
             if (next == ' ' || next == ';') {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
Thu Apr  4 07:56:46 2013
@@ -232,7 +232,7 @@ public final class ResponseImpl extends 
 
     public MediaType getMediaType() {
         String header = getHeader(HttpHeaders.CONTENT_TYPE);
-        return header == null ? null : MediaType.valueOf(header);
+        return header == null ? null : JAXRSUtils.toMediaType(header);
     }
     
     public boolean hasLink(String relation) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WriterInterceptorMBW.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WriterInterceptorMBW.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WriterInterceptorMBW.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WriterInterceptorMBW.java
Thu Apr  4 07:56:46 2013
@@ -31,6 +31,7 @@ import javax.ws.rs.ext.WriterInterceptor
 import javax.ws.rs.ext.WriterInterceptorContext;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 import org.apache.cxf.message.Message;
 
 public class WriterInterceptorMBW implements WriterInterceptor {
@@ -56,7 +57,7 @@ public class WriterInterceptorMBW implem
         }
         MultivaluedMap<String, Object> headers = c.getHeaders();
         Object mtObject = headers.getFirst(HttpHeaders.CONTENT_TYPE);
-        MediaType mt = mtObject == null ? c.getMediaType() : MediaType.valueOf(mtObject.toString());
+        MediaType mt = mtObject == null ? c.getMediaType() : JAXRSUtils.toMediaType(mtObject.toString());
         m.put(Message.CONTENT_TYPE, mtObject.toString());
         writer.writeTo(c.getEntity(), 
                        c.getType(), 

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
Thu Apr  4 07:56:46 2013
@@ -226,7 +226,7 @@ public class JAXRSOutInterceptor extends
         
         responseContentType = (String)responseHeaders.getFirst(HttpHeaders.CONTENT_TYPE);
         MediaType responseMediaType = responseContentType == null ? MediaType.WILDCARD_TYPE

-            : MediaType.valueOf(responseContentType);
+            : JAXRSUtils.toMediaType(responseContentType);
         
         Class<?> targetType = InjectionUtils.getRawResponseClass(entity);
         Type genericType = 
@@ -389,7 +389,7 @@ public class JAXRSOutInterceptor extends
         if (mt.isWildcardType() || mt.isWildcardSubtype() && mt.getType().equals("application"))
{
             return MediaType.APPLICATION_OCTET_STREAM_TYPE;
         } else if (mt.getParameters().containsKey("q")) {
-            return MediaType.valueOf(JAXRSUtils.removeMediaTypeParameter(mt, "q"));
+            return JAXRSUtils.toMediaType(JAXRSUtils.removeMediaTypeParameter(mt, "q"));
         } else {
             return mt;
         }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Thu Apr  4 07:56:46 2013
@@ -115,7 +115,7 @@ import org.apache.ws.commons.schema.XmlS
 public class WadlGenerator implements ContainerRequestFilter {
 
     public static final String WADL_QUERY = "_wadl";
-    public static final MediaType WADL_TYPE = MediaType.valueOf("application/vnd.sun.wadl+xml");
+    public static final MediaType WADL_TYPE = JAXRSUtils.toMediaType("application/vnd.sun.wadl+xml");
     public static final String WADL_NS = "http://wadl.dev.java.net/2009/02";
     
     private static final MediaType DEFAULT_MEDIA_TYPE = MediaType.APPLICATION_XML_TYPE; 
@@ -1672,7 +1672,7 @@ public class WadlGenerator implements Co
     }
 
     public void setDefaultMediaType(String mt) {
-        this.defaultMediaType = MediaType.valueOf(mt);
+        this.defaultMediaType = JAXRSUtils.toMediaType(mt);
     }
 
     private static class SchemaConverter extends DelegatingXMLStreamWriter {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataSourceProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataSourceProvider.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataSourceProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataSourceProvider.java
Thu Apr  4 07:56:46 2013
@@ -36,6 +36,7 @@ import javax.ws.rs.ext.Provider;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.jaxrs.ext.multipart.InputStreamDataSource;
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 
 @Provider
 public class DataSourceProvider<T> implements MessageBodyReader<T>, MessageBodyWriter<T>
{
@@ -82,7 +83,7 @@ public class DataSourceProvider<T> imple
     private void setContentTypeIfNeeded(MediaType type, 
         MultivaluedMap<String, Object> headers, String ct) {
 
-        if (!StringUtils.isEmpty(ct) && !type.equals(MediaType.valueOf(ct))) { 
+        if (!StringUtils.isEmpty(ct) && !type.equals(JAXRSUtils.toMediaType(ct)))
{ 
             headers.putSingle("Content-Type", ct);
         }
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
Thu Apr  4 07:56:46 2013
@@ -385,7 +385,7 @@ public class MultipartProvider extends A
                                             Class<T> cls, Type genericType,
                                             Annotation[] anns,
                                             String mimeType, int id) {
-        MediaType mt = MediaType.valueOf(mimeType);
+        MediaType mt = JAXRSUtils.toMediaType(mimeType);
         mc.put(ACTIVE_JAXRS_PROVIDER_KEY, this);
         
         MessageBodyWriter<T> r = null;

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Thu Apr  4 07:56:46 2013
@@ -162,7 +162,7 @@ public abstract class ProviderFactory {
                     mt = accepts.get(0);
                 }
             } else {
-                mt = MediaType.valueOf(ctProperty.toString());
+                mt = JAXRSUtils.toMediaType(ctProperty.toString());
             }
         } else {
             mt = requestHeaders.getMediaType();

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Thu
Apr  4 07:56:46 2013
@@ -114,6 +114,7 @@ import org.apache.cxf.jaxrs.impl.Contain
 import org.apache.cxf.jaxrs.impl.ContainerResponseContextImpl;
 import org.apache.cxf.jaxrs.impl.HttpHeadersImpl;
 import org.apache.cxf.jaxrs.impl.HttpServletResponseFilter;
+import org.apache.cxf.jaxrs.impl.MediaTypeHeaderProvider;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.impl.PathSegmentImpl;
 import org.apache.cxf.jaxrs.impl.ProvidersImpl;
@@ -242,7 +243,7 @@ public final class JAXRSUtils {
     public static List<MediaType> getMediaTypes(String[] values) {
         List<MediaType> supportedMimeTypes = new ArrayList<MediaType>(values.length);
         for (int i = 0; i < values.length; i++) {
-            supportedMimeTypes.add(MediaType.valueOf(values[i]));    
+            supportedMimeTypes.add(toMediaType(values[i]));    
         }
         return supportedMimeTypes;
     }
@@ -394,7 +395,7 @@ public final class JAXRSUtils {
         MediaType requestType;
         try {
             requestType = requestContentType == null
-                                ? ALL_TYPES : MediaType.valueOf(requestContentType);
+                                ? ALL_TYPES : toMediaType(requestContentType);
         } catch (IllegalArgumentException ex) {
             throw new NotSupportedException(ex);
         }
@@ -750,7 +751,7 @@ public final class JAXRSUtils {
                                        parameterType,
                                        parameterAnns,
                                        is, 
-                                       MediaType.valueOf(contentType),
+                                       toMediaType(contentType),
                                        ori.getConsumeTypes(),
                                        message);
         } else if (parameter.getType() == ParameterType.CONTEXT) {
@@ -1333,7 +1334,7 @@ public final class JAXRSUtils {
                 } else {
                     types = "";
                 }
-                acceptValues.add(MediaType.valueOf(tp));
+                acceptValues.add(toMediaType(tp));
             }
         } else {
             acceptValues.add(ALL_TYPES);
@@ -1598,6 +1599,10 @@ public final class JAXRSUtils {
         }
     }
     
+    public static MediaType toMediaType(String value) {
+        return MediaTypeHeaderProvider.valueOf(value);
+    }
+    
     public static Response toResponse(int status) {
         return toResponseBuilder(status).build();
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
Thu Apr  4 07:56:46 2013
@@ -175,7 +175,7 @@ public final class AttachmentUtils {
     }
     
     private static void checkMediaTypes(MediaType mt1, String mt2) {
-        if (!mt1.isCompatible(MediaType.valueOf(mt2))) {                                
           
+        if (!mt1.isCompatible(JAXRSUtils.toMediaType(mt2))) {                           
                
             throw new NotSupportedException();
         }
     }

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java (original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java Thu
Apr  4 07:56:46 2013
@@ -395,7 +395,7 @@ public abstract class AbstractClient imp
         @SuppressWarnings("unchecked")
         Class<T> theClass = (Class<T>)cls;
         
-        MediaType contentType = MediaType.valueOf(headers.getFirst("Content-Type").toString());

+        MediaType contentType = JAXRSUtils.toMediaType(headers.getFirst("Content-Type").toString());

         
         List<WriterInterceptor> writers = ClientProviderFactory.getInstance(outMessage)
             .createMessageBodyWriterInterceptor(theClass, type, anns, contentType, outMessage);
@@ -721,7 +721,7 @@ public abstract class AbstractClient imp
     private static MediaType getResponseContentType(Response r) {
         MultivaluedMap<String, Object> map = r.getMetadata();
         if (map.containsKey(HttpHeaders.CONTENT_TYPE)) {
-            return MediaType.valueOf(map.getFirst(HttpHeaders.CONTENT_TYPE).toString());
+            return JAXRSUtils.toMediaType(map.getFirst(HttpHeaders.CONTENT_TYPE).toString());
         }
         return MediaType.WILDCARD_TYPE;
     }

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=1464337&r1=1464336&r2=1464337&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
(original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Thu Apr  4 07:56:46 2013
@@ -63,6 +63,7 @@ import org.apache.cxf.jaxrs.model.Parame
 import org.apache.cxf.jaxrs.utils.AnnotationUtils;
 import org.apache.cxf.jaxrs.utils.FormUtils;
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
+import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 
@@ -362,7 +363,7 @@ public class ClientProxyImpl extends Abs
         }
         List<MediaType> types = new ArrayList<MediaType>();
         for (String s : headers) {
-            types.add(MediaType.valueOf(s));
+            types.add(JAXRSUtils.toMediaType(s));
         }
         return types;
     }



Mime
View raw message