@Override public boolean isStreaming() { return !isRepeatable(); }
public void consumeContent() throws IOException, UnsupportedOperationException{ if (isStreaming()) { throw new UnsupportedOperationException( "Streaming entity does not implement #consumeContent()"); } }
public void writeTo(final OutputStream outstream) throws IOException { getEntity().writeTo(outstream); }
form = new HttpStrictMultipart(charsetCopy, boundaryCopy, bodyPartsCopy); return new MultipartFormEntity(form, contentTypeCopy, form.getTotalLength());
public Header getContentEncoding() { return getEntity().getContentEncoding(); }
public long getContentLength() { return getEntity().getContentLength(); }
public Header getContentType() { return getEntity().getContentType(); }
public boolean isChunked() { return getEntity().isChunked(); }
@Override public InputStream getContent() throws IOException { if (this.contentLength < 0) { throw new ContentTooLongException("Content length is unknown"); } else if (this.contentLength > 25 * 1024) { throw new ContentTooLongException("Content length is too long: " + this.contentLength); } final ByteArrayOutputStream outstream = new ByteArrayOutputStream(); writeTo(outstream); outstream.flush(); return new ByteArrayInputStream(outstream.toByteArray()); }
form = new HttpStrictMultipart(charsetCopy, boundaryCopy, bodyPartsCopy); return new MultipartFormEntity(form, contentTypeCopy, form.getTotalLength());
@Override public boolean isChunked() { return !isRepeatable(); }
@Override public InputStream getContent() throws IOException { if (this.contentLength < 0) { throw new ContentTooLongException("Content length is unknown"); } else if (this.contentLength > 25 * 1024) { throw new ContentTooLongException("Content length is too long: " + this.contentLength); } final ByteArrayOutputStream outstream = new ByteArrayOutputStream(); writeTo(outstream); outstream.flush(); return new ByteArrayInputStream(outstream.toByteArray()); }
MultipartFormEntity buildEntity() { final String st = subType != null ? subType : DEFAULT_SUBTYPE; final Charset cs = charset; final String b = boundary != null ? boundary : generateBoundary(); final List<FormBodyPart> bps = bodyParts != null ? new ArrayList<FormBodyPart>(bodyParts) : Collections.<FormBodyPart>emptyList(); final HttpMultipartMode m = mode != null ? mode : HttpMultipartMode.STRICT; final AbstractMultipartForm form; switch (m) { case BROWSER_COMPATIBLE: form = new HttpBrowserCompatibleMultipart(st, cs, b, bps); break; case RFC6532: form = new HttpRFC6532Multipart(st, cs, b, bps); break; default: form = new HttpStrictMultipart(st, cs, b, bps); } return new MultipartFormEntity(form, generateContentType(b, cs), form.getTotalLength()); }
public boolean isStreaming() { return getEntity().isStreaming(); }
@Override public boolean isChunked() { return !isRepeatable(); }
@Override public boolean isStreaming() { return !isRepeatable(); }
public boolean isStreaming() { return !isRepeatable(); }
public boolean isChunked() { return !isRepeatable(); }
public boolean isRepeatable() { return getEntity().isRepeatable(); }