Examples of ByteArrayHttpMessageConverter


Examples of org.springframework.http.converter.ByteArrayHttpMessageConverter

   * By default, the message converter supports "image/jpeg", "image/gif", and "image/png" media types.
   * Override to customize the message converter (for example, to set supported media types).
   * To remove/replace this or any of the other message converters that are registered by default, override the getMessageConverters() method instead.  
   */
  protected ByteArrayHttpMessageConverter getByteArrayMessageConverter() {
    ByteArrayHttpMessageConverter converter = new ByteArrayHttpMessageConverter();
    converter.setSupportedMediaTypes(Arrays.asList(MediaType.IMAGE_JPEG, MediaType.IMAGE_GIF, MediaType.IMAGE_PNG));
    return converter;
  }
View Full Code Here

Examples of org.springframework.http.converter.ByteArrayHttpMessageConverter

   */
  protected FormHttpMessageConverter getFormMessageConverter() {
    FormHttpMessageConverter converter = new FormHttpMessageConverter();
    converter.setCharset(Charset.forName("UTF-8"));
    List<HttpMessageConverter<?>> partConverters = new ArrayList<HttpMessageConverter<?>>();
    partConverters.add(new ByteArrayHttpMessageConverter());
    StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
    stringHttpMessageConverter.setWriteAcceptCharset(false);
    partConverters.add(stringHttpMessageConverter);
    partConverters.add(new ResourceHttpMessageConverter());   
    converter.setPartConverters(partConverters);
View Full Code Here

Examples of org.springframework.http.converter.ByteArrayHttpMessageConverter

   * By default, the message converter supports "image/jpeg", "image/gif", and "image/png" media types.
   * Override to customize the message converter (for example, to set supported media types).
   * To remove/replace this or any of the other message converters that are registered by default, override the getMessageConverters() method instead.  
   */
  protected ByteArrayHttpMessageConverter getByteArrayMessageConverter() {
    ByteArrayHttpMessageConverter converter = new ByteArrayHttpMessageConverter();
    converter.setSupportedMediaTypes(Arrays.asList(MediaType.IMAGE_JPEG, MediaType.IMAGE_GIF, MediaType.IMAGE_PNG));
    return converter;
  }
View Full Code Here

Examples of org.springframework.http.converter.ByteArrayHttpMessageConverter

  protected final void addDefaultHttpMessageConverters( List<HttpMessageConverter<?>> messageConverters ) {
    // Todo: write a custom AcrossWebConfigurer configurer
    StringHttpMessageConverter stringConverter = new StringHttpMessageConverter();
    stringConverter.setWriteAcceptCharset( false );

    addIfNoInstanceYetPresent( messageConverters, new ByteArrayHttpMessageConverter() );
    addIfNoInstanceYetPresent( messageConverters, stringConverter );
    addIfNoInstanceYetPresent( messageConverters, new ResourceHttpMessageConverter() );
    addIfNoInstanceYetPresent( messageConverters, new SourceHttpMessageConverter<Source>() );
    addIfNoInstanceYetPresent( messageConverters, new AllEncompassingFormHttpMessageConverter() );
    if ( romePresent ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.