Code example for SourceHttpMessageConverter

0
    @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(); 
    } 
 
Experience pair programming with AI  Get Codota for Java