com.appland.appmap.reflect.apache.HttpResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appmap-agent Show documentation
Show all versions of appmap-agent Show documentation
Inspect and record the execution of Java for use with App Land
The newest version!
package com.appland.appmap.reflect.apache;
import com.appland.appmap.reflect.ReflectiveType;
public class HttpResponse extends ReflectiveType {
private static String GET_STATUS_LINE = "getStatusLine";
private static String GET_ENTITY = "getEntity";
public HttpResponse(Object self) {
super(self);
addMethods(GET_STATUS_LINE, GET_ENTITY);
}
public int getStatusCode() {
StatusLine sl = new StatusLine(invokeObjectMethod(GET_STATUS_LINE));
return sl.getStatusCode();
}
public String getContentType() {
Object obj = invokeObjectMethod(GET_ENTITY);
if (obj == null) {
return "";
}
HttpEntity he = new HttpEntity(obj);
return he.getContentType();
}
}