mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 08:21:23 +00:00
Inject responce headers in GHObject and Exceptions.
GH has specific to GET/POST headers required for analysing in case of error. Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>
This commit is contained in:
@@ -3,14 +3,15 @@ package org.kohsuke.github;
|
||||
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
import org.apache.commons.lang.reflect.FieldUtils;
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Most (all?) domain objects in GitHub seems to have these 4 properties.
|
||||
@@ -18,6 +19,9 @@ import java.util.Date;
|
||||
@SuppressFBWarnings(value = {"UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD",
|
||||
"NP_UNWRITTEN_FIELD"}, justification = "JSON API")
|
||||
public abstract class GHObject {
|
||||
// not data but information related to data from responce
|
||||
protected Map<String, List<String>> responseHeaderFields;
|
||||
|
||||
protected String url;
|
||||
protected int id;
|
||||
protected String created_at;
|
||||
@@ -26,6 +30,11 @@ public abstract class GHObject {
|
||||
/*package*/ GHObject() {
|
||||
}
|
||||
|
||||
@CheckForNull
|
||||
public Map<String, List<String>> getResponseHeaderFields() {
|
||||
return responseHeaderFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* When was this resource created?
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user