@Override protected void init(String body, String contentType, int responseCode, Map<String, List<String>> headers) throws OAuthProblemException { super.init(body, contentType, responseCode, headers); } }
@Override protected void init(String body, String contentType, int responseCode) throws OAuthProblemException { super.init(body, contentType, responseCode); }
@Override protected void init(String body, String contentType, int responseCode) throws OAuthProblemException { super.init(body, contentType, responseCode); }
@Override protected void init(String body, String contentType, int responseCode, Map<String, List<String>> headers) throws OAuthProblemException { super.init(body, contentType, responseCode, headers); } }
@Override protected void init(String body, String contentType, int responseCode, Map<String, List<String>> headers) throws OAuthProblemException { super.init(body, contentType, responseCode, headers); }
@Override protected void init(String body, String contentType, int responseCode) throws OAuthProblemException { super.init(body, contentType, responseCode); }
protected void init(String body, String contentType, int responseCode) throws OAuthProblemException { init(body, contentType, responseCode, new HashMap<String, List<String>>()); }
protected void init(String body, String contentType, int responseCode) throws OAuthProblemException { init(body, contentType, responseCode, new HashMap<String, List<String>>()); }
public static <T extends OAuthClientResponse> T createCustomResponse(InputStream body, String contentType, int responseCode, Map<String, List<String>> headers, Class<T> clazz) throws OAuthSystemException, OAuthProblemException { T resp = OAuthUtils.instantiateClassWithParameters(clazz, null, null); if (body == null) { body = new ByteArrayInputStream(new byte[0]); } resp.init(body, contentType, responseCode, headers); return resp; } }
public static <T extends OAuthClientResponse> T createCustomResponse(String body, String contentType, int responseCode, Map<String, List<String>> headers, Class<T> clazz) throws OAuthSystemException, OAuthProblemException { OAuthClientResponse resp = OAuthUtils .instantiateClassWithParameters(clazz, null, null); resp.init(body, contentType, responseCode, headers); return (T) resp; }
public static <T extends OAuthClientResponse> T createCustomResponse(String body, String contentType, int responseCode, Map<String, List<String>> headers, Class<T> clazz) throws OAuthSystemException, OAuthProblemException { OAuthClientResponse resp = OAuthUtils .instantiateClassWithParameters(clazz, null, null); resp.init(body, contentType, responseCode, headers); return (T) resp; }
public static <T extends OAuthClientResponse> T createCustomResponse(InputStream body, String contentType, int responseCode, Map<String, List<String>> headers, Class<T> clazz) throws OAuthSystemException, OAuthProblemException { T resp = OAuthUtils.instantiateClassWithParameters(clazz, null, null); if (body == null) { body = new ByteArrayInputStream(new byte[0]); } resp.init(body, contentType, responseCode, headers); return resp; } }
/** * Default implementation that converts the body InputStream to a String and delegates * to {@link #init(String, String, int)}. * <br/> * This implementation ensures backwards compatibility, as many subclasses expect String * type bodies. At the same time it can be overridden to also deal with binary InputStreams. * * @param body an InputStream representing the response body * @param contentType the content type of the response. * @param responseCode the HTTP response code of the response. * @param headers The HTTP response headers * @throws OAuthProblemException */ protected void init(InputStream body, String contentType, int responseCode, Map<String, List<String>> headers) throws OAuthProblemException { try { init(OAuthUtils.saveStreamAsString(body), contentType, responseCode); } catch (final IOException e) { throw OAuthProblemException.error(e.getMessage()); } }
/** * Default implementation that converts the body InputStream to a String and delegates * to {@link #init(String, String, int)}. * <br/> * This implementation ensures backwards compatibility, as many subclasses expect String * type bodies. At the same time it can be overridden to also deal with binary InputStreams. * * @param body an InputStream representing the response body * @param contentType the content type of the response. * @param responseCode the HTTP response code of the response. * @param headers The HTTP response headers * @throws OAuthProblemException */ protected void init(InputStream body, String contentType, int responseCode, Map<String, List<String>> headers) throws OAuthProblemException { try { init(OAuthUtils.saveStreamAsString(body), contentType, responseCode); } catch (final IOException e) { throw OAuthProblemException.error(e.getMessage()); } }