/** * Sets the buffer from which to take the request body * * @param buffer */ public void setBuffer(TemporaryBuffer buffer) { this.entity = new TemporaryBufferEntity(buffer); }
public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new TemporaryBuffer.LocalFile(null)); entity.setChunked(true); }
/** {@inheritDoc} */ @Override public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); return entity.getBuffer(); }
public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setContentLength(contentLength); }
private void execute() throws IOException, ClientProtocolException { if (resp == null) if (entity != null) { if (req instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req; eReq.setEntity(entity); } resp = getClient().execute(req); entity.getBuffer().close(); entity = null; } else resp = getClient().execute(req); }
private void execute() throws IOException, ClientProtocolException { if (resp != null) { return; } if (entity == null) { resp = getClient().execute(req); return; } try { if (req instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req; eReq.setEntity(entity); } resp = getClient().execute(req); } finally { entity.close(); entity = null; } }
public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile()); entity.setChunked(true); }
public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile()); return entity.getBuffer(); }
public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new LocalFile()); entity.setContentLength(contentLength); }
private void execute() throws IOException, ClientProtocolException { if (resp == null) if (entity != null) { if (req instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req; eReq.setEntity(entity); } resp = getClient().execute(req); entity.getBuffer().close(); entity = null; } else resp = getClient().execute(req); }
private void execute() throws IOException, ClientProtocolException { if (resp != null) { return; } if (entity == null) { resp = getClient().execute(req); return; } try { if (req instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req; eReq.setEntity(entity); } resp = getClient().execute(req); } finally { entity.close(); entity = null; } }
/** {@inheritDoc} */ @Override public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setChunked(true); }
public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new TemporaryBuffer.LocalFile(null)); return entity.getBuffer(); }
public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new TemporaryBuffer.LocalFile(null)); entity.setContentLength(contentLength); }
/** * Sets the buffer from which to take the request body * * @param buffer */ public void setBuffer(TemporaryBuffer buffer) { this.entity = new TemporaryBufferEntity(buffer); }
public void setChunkedStreamingMode(int chunklen) { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setChunked(true); }
public OutputStream getOutputStream() throws IOException { if (entity == null) entity = new TemporaryBufferEntity(new LocalFile(null)); return entity.getBuffer(); }
/** {@inheritDoc} */ @Override public void setFixedLengthStreamingMode(int contentLength) { if (entity != null) throw new IllegalArgumentException(); entity = new TemporaryBufferEntity(new LocalFile(null)); entity.setContentLength(contentLength); }
/** * Sets the buffer from which to take the request body * * @param buffer */ public void setBuffer(TemporaryBuffer buffer) { this.entity = new TemporaryBufferEntity(buffer); }
public void setBuffer(TemporaryBuffer buffer) { this.entity = new TemporaryBufferEntity(buffer); }