提交 4246046d 编写于 作者: A Allen Wang

added missing class

上级 4a93c592
package com.netflix.client.http;
import java.io.IOException;
import com.netflix.serialization.ContentTypeBasedSerializerKey;
import com.netflix.serialization.Deserializer;
import com.netflix.serialization.SerializationFactory;
import com.netflix.serialization.TypeDef;
public class HttpUtils {
public static <T> T getEntity(HttpResponse response, TypeDef<T> type, Deserializer deserializer) throws IOException {
return deserializer.deserialize(response.getInputStream(), type);
}
public static <T> T getEntity(HttpResponse response, TypeDef<T> type,
SerializationFactory<ContentTypeBasedSerializerKey> serializationFactory) throws IOException {
String contentType = response.getHttpHeaders().getFirst("Content-Type");
Deserializer deserializer = serializationFactory.getDeserializer(new ContentTypeBasedSerializerKey(contentType, type));
return deserializer.deserialize(response.getInputStream(), type);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册