All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.frameworkset.spi.remote.http.BaseResponseHandler Maven / Gradle / Ivy

Go to download

bboss is a j2ee framework include aop/ioc,mvc,persistent,taglib,rpc,event ,bean-xml serializable and so on.http://www.bbossgroups.com

There is a newer version: 6.3.5
Show newest version
package org.frameworkset.spi.remote.http;

import com.frameworkset.util.SimpleStringUtil;
import org.apache.http.HttpEntity;

import java.io.IOException;
import java.io.InputStream;

import static org.frameworkset.spi.remote.http.HttpRequestProxy.entityEmpty;

public abstract class BaseResponseHandler extends StatusResponseHandler {
	protected  T converJson(HttpEntity entity,Class clazz) throws IOException {
		InputStream inputStream = null;
		try {

			inputStream = entity.getContent();

			if(entityEmpty(entity,inputStream)){
				return null;
			}
			return SimpleStringUtil.json2Object(inputStream, clazz);
		}
		finally {
			inputStream.close();
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy