/**
 *  This file is part of MythTV for Android
 * 
 *  MythTV for Android is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  MythTV for Android is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with MythTV for Android.  If not, see <http://www.gnu.org/licenses/>.
 *   
 * This software can be found at <https://github.com/MythTV-Android/MythTV-Service-API/>
 *
 */
package org.mythtv.services.api;

import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestOperations;
import org.springframework.web.client.RestTemplate;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.joda.JodaModule;

/**
 * @author Daniel Frey
 * 
 */
public class MythServicesTemplate extends BaseMythServicesTemplate {

	public MythServicesTemplate( String apiUrlBase ) {
		super(apiUrlBase);
	}
	
	@Override
	protected RestOperations createRestOperations() {
		RestTemplate rest = new RestTemplate( true );
		
		ObjectMapper objectMapper = new ObjectMapper();
		objectMapper.registerModule( new JodaModule() );
		MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
		mappingJackson2HttpMessageConverter.setObjectMapper( objectMapper );
		rest.getMessageConverters().add( mappingJackson2HttpMessageConverter );
		
		rest.setErrorHandler( new MythServicesErrorHandler() );
		return rest;
	}
}

@@ -855,16 +855,80 @@
 s.api;%0A%0A
+import org.springframework.http.converter.HttpMessageConverter;%0A
 import o
@@ -1621,45 +1621,124 @@
 ;%0A%09%09
-MappingJackson2HttpMessageConverter m
+%0A%09%09for( HttpMessageConverter messageConverter : rest.getMessageConverters() ) %7B%0A%09%09%09if( messageConverter instanceof M
 appi
@@ -1768,22 +1768,24 @@
 nverter 
-= new 
+) %7B%0A%09%09%09%09
 MappingJ
@@ -1811,22 +1811,17 @@
 onverter
-();%0A%09%09
+ 
 mappingJ
@@ -1851,53 +1851,50 @@
 rter
-.setObjectMapper( objectMapper );%0A%09%09rest.getM
+ = (MappingJackson2HttpMessageConverter) m
 essa
@@ -1908,17 +1908,14 @@
 rter
-s().add( 
+;%0A%09%09%09%09
 mapp
@@ -1945,19 +1945,61 @@
 onverter
- );
+.setObjectMapper( objectMapper );%0A%09%09%09%7D%0A%09%09%0A%09%09%7D
 %0A%09%09%0A%09%09re

Upgrade Spring Android to version 1.0.1