@Override public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } //Check if the entity was previously fully consumed if (streamFullyRead && bufferedEntity == null) { throw new IllegalStateException(); } return getEntityStream(); }
@Override public boolean hasEntity() { abortIfClosed(); return getInputStream() != null && (entity != null || getMediaType() != null); }
@SuppressWarnings("unchecked") public synchronized <T> T readEntity(Class<T> type, Type genericType, Annotation[] anns) abortIfClosed(); if (entity != null)
@Override public boolean bufferEntity() { abortIfClosed(); if (bufferedEntity != null) return true; if (entity != null) return false; if (metadata.getFirst(HttpHeaderNames.CONTENT_TYPE) == null) return false; InputStream is = getInputStream(); if (is == null) return false; try { bufferedEntity = ReadFromStream.readFromStream(1024, is); } catch (IOException e) { throw new ProcessingException(e); } finally { try { releaseConnection(); } catch (IOException e) { throw new ProcessingException(e); } } return true; }
@Override public boolean hasEntity() { abortIfClosed(); return getInputStream() != null && (entity != null || getMediaType() != null); }
@Override public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } //Check if the entity was previously fully consumed if (streamFullyRead && bufferedEntity == null) { throw new IllegalStateException(); } return getEntityStream(); }
@Override public boolean hasEntity() { abortIfClosed(); return getInputStream() != null && (entity != null || getMediaType() != null); }
@Override public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } //Check if the entity was previously fully consumed if (streamFullyRead && bufferedEntity == null) { throw new IllegalStateException(); } return getEntityStream(); }
@SuppressWarnings("unchecked") public synchronized <T> T readEntity(Class<T> type, Type genericType, Annotation[] anns) abortIfClosed(); if (entity != null)
@SuppressWarnings("unchecked") public synchronized <T> T readEntity(Class<T> type, Type genericType, Annotation[] anns) abortIfClosed(); if (entity != null)
@Override public boolean bufferEntity() { abortIfClosed(); if (bufferedEntity != null) return true; if (entity != null) return false; if (metadata.getFirst(HttpHeaderNames.CONTENT_TYPE) == null) return false; InputStream is = getInputStream(); if (is == null) return false; try { bufferedEntity = ReadFromStream.readFromStream(1024, is); } catch (IOException e) { throw new ProcessingException(e); } finally { try { releaseConnection(); } catch (IOException e) { throw new ProcessingException(e); } } return true; }
@Override public boolean bufferEntity() { abortIfClosed(); if (bufferedEntity != null) return true; if (entity != null) return false; if (metadata.getFirst(HttpHeaderNames.CONTENT_TYPE) == null) return false; InputStream is = getInputStream(); if (is == null) return false; try { bufferedEntity = ReadFromStream.readFromStream(1024, is); } catch (IOException e) { throw new ProcessingException(e); } finally { try { releaseConnection(); } catch (IOException e) { throw new ProcessingException(e); } } return true; }