@Override public boolean hasEntity() { abortIfClosed(); return getInputStream() != null && (entity != null || getMediaType() != null); }
protected InputStream getEntityStream() { if (bufferedEntity != null) return new ByteArrayInputStream(bufferedEntity); if (isClosed()) throw new ProcessingException(Messages.MESSAGES.streamIsClosed()); InputStream is = getInputStream(); return is != null ? new InputStreamWrapper(is, this) : 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 InputStream getEntityStream() { return response.getInputStream(); }
@Override public boolean hasEntity() { abortIfClosed(); return getInputStream() != null && (entity != null || getMediaType() != null); }
@Override public boolean hasEntity() { abortIfClosed(); return getInputStream() != null && (entity != null || getMediaType() != null); }
protected InputStream getEntityStream() { if (bufferedEntity != null) return new ByteArrayInputStream(bufferedEntity); if (isClosed()) throw new ProcessingException(Messages.MESSAGES.streamIsClosed()); InputStream is = getInputStream(); return is != null ? new InputStreamWrapper(is, this) : null; }
protected InputStream getEntityStream() { if (bufferedEntity != null) return new ByteArrayInputStream(bufferedEntity); if (isClosed()) throw new ProcessingException(Messages.MESSAGES.streamIsClosed()); InputStream is = getInputStream(); return is != null ? new InputStreamWrapper(is, this) : 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; }