public static Exception getCause(BuiltResponse resp) { if (resp == null || resp.getStatus() != Status.EXPECTATION_FAILED.getStatusCode()) return null; String exceptionClass = resp.getHeaderString(EXCEPTION_HEADER); if (!StringUtils.isBlank(exceptionClass)) { String body = resp.readEntity(String.class); resp.close(); try { ByteArrayInputStream bais = new ByteArrayInputStream( Base64.decode(body.getBytes(MotanConstants.DEFAULT_CHARACTER))); ObjectInputStream ois = new ObjectInputStream(bais); return (Exception) ois.readObject(); } catch (Exception e) { LoggerUtil.error("deserialize " + exceptionClass + " error", e); } } return null; }
@Override public int getStatus() { return jaxrsResponse.getStatus(); }
@Override public int getStatus() { return jaxrsResponse.getStatus(); }
@Override public int getStatus() { return jaxrsResponse.getStatus(); }
public ServerResponse(final BuiltResponse response) { this.setEntity(response.getEntity()); this.setAnnotations(response.getAnnotations()); this.setStatus(response.getStatus()); this.setMetadata(response.getMetadata()); this.setEntityClass(response.getEntityClass()); this.setGenericType(response.getGenericType()); this.setReasonPhrase(response.getReasonPhrase()); } }
public ServerResponse(BuiltResponse response) { this.setEntity(response.getEntity()); this.setAnnotations(response.getAnnotations()); this.setStatus(response.getStatus()); this.setMetadata(response.getMetadata()); this.setEntityClass(response.getEntityClass()); this.setGenericType(response.getGenericType()); this.setReasonPhrase(response.getReasonPhrase()); } }
public ServerResponse(final BuiltResponse response) { this.setEntity(response.getEntity()); this.setAnnotations(response.getAnnotations()); this.setStatus(response.getStatus()); this.setMetadata(response.getMetadata()); this.setEntityClass(response.getEntityClass()); this.setGenericType(response.getGenericType()); this.setReasonPhrase(response.getReasonPhrase()); } }