Spring Framework ByteArrayHttpMessageConverter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ByteArrayHttpMessageConverter class.

This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
 
    @Override 
    protected List<HttpMessageConverter<?>> getMessageConverters()
    { 
        List<HttpMessageConverter<?>> messageConverters = super.getMessageConverters();
        messageConverters.add(new ByteArrayHttpMessageConverter());
        messageConverters.add(new SourceHttpMessageConverter<Source>());
        messageConverters.add(new JaxbHttpMessageConverter("org.alfresco.repo.publishing.flickr.springsocial.api.impl.xml"));
        return messageConverters;
    } 
 
    // private helpers 
    private void initialize() 
    { 
        getRestTemplate().setErrorHandler(new FlickrErrorHandler()); 
        // Wrap the request factory with a BufferingClientHttpRequestFactory so 
        // that the error handler can do repeat reads on the response.getBody() 
        super.setRequestFactory(ClientHttpRequestFactorySelector.bufferRequests(getRestTemplate().getRequestFactory())); 
        initSubApis(); 
    } 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
	 * Subclasses may override to return another version. 
	 * @see OAuth2Version 
	 */ 
	protected OAuth2Version getOAuth2Version() { 
		return OAuth2Version.BEARER; 
	} 
 
	/** 
	 * Subclassing hook to enable customization of the RestTemplate used to consume provider API resources. 
	 * An example use case might be to configure a custom error handler. 
	 * Note that this method is called after the RestTemplate has been configured with the message converters returned from getMessageConverters(). 
	 * @param restTemplate the RestTemplate to configure. 
	 */ 
	protected void configureRestTemplate(RestTemplate restTemplate) {
	} 
 
	/** 
	 * Returns a list of {@link HttpMessageConverter}s to be used by the internal {@link RestTemplate}. 
	 * By default, this includes a {@link StringHttpMessageConverter}, a {@link MappingJackson2HttpMessageConverter}, a {@link ByteArrayHttpMessageConverter}, and a {@link FormHttpMessageConverter}. 
	 * The {@link FormHttpMessageConverter} is set to use "UTF-8" character encoding. 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
	 * @param restTemplate the RestTemplate to configure. 
	 */ 
	protected void configureRestTemplate(RestTemplate restTemplate) {		
	} 
	 
	/** 
	 * Returns a list of {@link HttpMessageConverter}s to be used by the internal {@link RestTemplate}. 
	 * By default, this includes a {@link StringHttpMessageConverter}, a {@link MappingJackson2HttpMessageConverter}, a {@link ByteArrayHttpMessageConverter}, and a {@link FormHttpMessageConverter}. 
	 * The {@link FormHttpMessageConverter} is set to use "UTF-8" character encoding. 
	 * Override this method to add additional message converters or to replace the default list of message converters. 
	 */ 
	protected List<HttpMessageConverter<?>> getMessageConverters() {
		List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
		messageConverters.add(new StringHttpMessageConverter());
		messageConverters.add(getFormMessageConverter());
		messageConverters.add(getJsonMessageConverter());
		messageConverters.add(getByteArrayMessageConverter());
		return messageConverters;
	} 
	 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
		} 
	} 
 
	private List<HttpMessageConverter<?>> getHttpMessageConverters() {
		List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
		messageConverters.add(new ByteArrayHttpMessageConverter());
		messageConverters.add(new StringHttpMessageConverter());
		messageConverters.add(new ResourceHttpMessageConverter());
		messageConverters.add(new UploadApplicationPayloadHttpMessageConverter());
		messageConverters.add(getFormHttpMessageConverter());
		messageConverters.add(new MappingJacksonHttpMessageConverter());
		messageConverters.add(new LoggregatorHttpMessageConverter());
		return messageConverters;
	} 
 
	private FormHttpMessageConverter getFormHttpMessageConverter() {
		FormHttpMessageConverter formPartsMessageConverter = new CloudFoundryFormHttpMessageConverter();
		formPartsMessageConverter.setPartConverters(getFormPartsMessageConverters());
		return formPartsMessageConverter;
	} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        List<HttpMessageConverter<?>> converters = new ArrayList<>(); 
 
        StringHttpMessageConverter stringConverter = new StringHttpMessageConverter(Charset.forName("UTF-8")); 
        stringConverter.setWriteAcceptCharset(false); // See SPR-7316 
 
        converters.add(new ByteArrayHttpMessageConverter()); 
        converters.add(stringConverter); 
        converters.add(new ResourceHttpMessageConverter()); 
 
        if (isJaxb2Present()) { 
            converters.add(new Jaxb2RootElementHttpMessageConverter()); 
        } 
        if (isJackson2Present()) { 
            converters.add(new MappingJackson2HttpMessageConverter()); 
 
        } else if (isJacksonPresent()) { 
            converters.add(new MappingJacksonHttpMessageConverter()); 
        } 
        return converters; 
    } 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java