List of usage examples for org.springframework.util MimeType getParameter
@Nullable
public String getParameter(String name)
From source file:org.springframework.integration.x.bus.MessageBusSupport.java
private Object deserializePayload(byte[] bytes, MimeType contentType) { Class<?> targetType = null; try {// w w w.j av a 2s .co m if (contentType.equals(TEXT_PLAIN)) { return new String(bytes, "UTF-8"); } targetType = Class.forName(contentType.getParameter("type")); return codec.deserialize(bytes, targetType); } catch (ClassNotFoundException e) { throw new SerializationException("unable to deserialize [" + targetType + "]. Class not found.", e); } catch (IOException e) { throw new SerializationException("unable to deserialize [" + targetType + "]", e); } }