org.frameworkset.spi.remote.http.BaseResponseHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bboss-http Show documentation
Show all versions of bboss-http Show documentation
bboss is a j2ee framework include aop/ioc,mvc,persistent,taglib,rpc,event ,bean-xml serializable and so on.http://www.bbossgroups.com
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