private static String message(Throwable cause, String msg, Object...args) { if (msg == null && cause != null) return firstNonEmpty(cause.getLocalizedMessage(), cause.getClass().getName()); return format(msg, args); }
private static String message(Throwable cause, String msg, Object...args) { if (msg == null && cause != null) return firstNonEmpty(cause.getLocalizedMessage(), cause.getClass().getName()); return format(msg, args); }
private static String message(Throwable cause, String msg, Object...args) { if (msg == null && cause != null) return firstNonEmpty(cause.getLocalizedMessage(), cause.getClass().getName()); return format(msg, args); }
private ObjectMap merge(ObjectMap om, ResponseHeader[] a) throws ParseException { if (a.length == 0) return om; om = newMap(om); for (ResponseHeader aa : a) { String name = StringUtils.firstNonEmpty(aa.name(), aa.value()); if (isEmpty(name)) throw new RuntimeException("@ResponseHeader used without name or value."); om.getObjectMap(name, true).putAll(merge(null, aa)); } return om; }
private ObjectMap merge(ObjectMap om, ResponseHeader[] a) throws ParseException { if (a.length == 0) return om; om = newMap(om); for (ResponseHeader aa : a) { String name = StringUtils.firstNonEmpty(aa.name(), aa.value()); if (isEmpty(name)) throw new RuntimeException("@ResponseHeader used without name or value."); om.getObjectMap(name, true).putAll(merge(null, aa)); } return om; }
private ObjectMap merge(ObjectMap om, ResponseHeader[] a) throws ParseException { if (a.length == 0) return om; om = newMap(om); for (ResponseHeader aa : a) { String name = StringUtils.firstNonEmpty(aa.name(), aa.value()); if (isEmpty(name)) throw new RuntimeException("@ResponseHeader used without name or value."); om.getObjectMap(name, true).putAll(merge(null, aa)); } return om; }
Header h = response.getFirstHeader("Content-Type"); int sc = response.getStatusLine().getStatusCode(); String ct = firstNonEmpty(h == null ? null : h.getValue(), "text/plain");
Header h = response.getFirstHeader("Content-Type"); int sc = response.getStatusLine().getStatusCode(); String ct = firstNonEmpty(h == null ? null : h.getValue(), "text/plain");
Header h = response.getFirstHeader("Content-Type"); int sc = response.getStatusLine().getStatusCode(); String ct = firstNonEmpty(h == null ? null : h.getValue(), "text/plain");
p = HttpUtils.detectHttpPath(method, true); httpMethod = emptyIfNull(firstNonEmpty(m.name(), m.method())).toUpperCase(Locale.ENGLISH); if (httpMethod.isEmpty()) httpMethod = HttpUtils.detectHttpMethod(method, true, "GET"); Header h = (Header)a; if (h._default().length > 0) defaultRequestHeaders.put(firstNonEmpty(h.name(), h.value()), parseAnything(joinnl(h._default()))); } else if (a instanceof Query) { Query q = (Query)a; if (q._default().length > 0) defaultQuery.put(firstNonEmpty(q.name(), q.value()), parseAnything(joinnl(q._default()))); } else if (a instanceof FormData) { FormData f = (FormData)a; if (f._default().length > 0) defaultFormData.put(firstNonEmpty(f.name(), f.value()), parseAnything(joinnl(f._default())));
p = HttpUtils.detectHttpPath(method, true); httpMethod = emptyIfNull(firstNonEmpty(m.name(), m.method())).toUpperCase(Locale.ENGLISH); if (httpMethod.isEmpty()) httpMethod = HttpUtils.detectHttpMethod(method, true, "GET"); Header h = (Header)a; if (h._default().length > 0) defaultRequestHeaders.put(firstNonEmpty(h.name(), h.value()), parseAnything(joinnl(h._default()))); } else if (a instanceof Query) { Query q = (Query)a; if (q._default().length > 0) defaultQuery.put(firstNonEmpty(q.name(), q.value()), parseAnything(joinnl(q._default()))); } else if (a instanceof FormData) { FormData f = (FormData)a; if (f._default().length > 0) defaultFormData.put(firstNonEmpty(f.name(), f.value()), parseAnything(joinnl(f._default())));
p = HttpUtils.detectHttpPath(method, true); httpMethod = emptyIfNull(firstNonEmpty(m.name(), m.method())).toUpperCase(Locale.ENGLISH); if (httpMethod.isEmpty()) httpMethod = HttpUtils.detectHttpMethod(method, true, "GET"); Header h = (Header)a; if (h._default().length > 0) defaultRequestHeaders.put(firstNonEmpty(h.name(), h.value()), parseAnything(joinnl(h._default()))); } else if (a instanceof Query) { Query q = (Query)a; if (q._default().length > 0) defaultQuery.put(firstNonEmpty(q.name(), q.value()), parseAnything(joinnl(q._default()))); } else if (a instanceof FormData) { FormData f = (FormData)a; if (f._default().length > 0) defaultFormData.put(firstNonEmpty(f.name(), f.value()), parseAnything(joinnl(f._default())));