/** * {@inheritDoc} */ @Override public boolean isRepeatable() { return delegate.isRepeatable(); }
/** * {@inheritDoc} */ @Override public boolean isRepeatable() { return delegate.isRepeatable(); }
/** * {@inheritDoc} */ @Override public boolean isRepeatable() { return delegate.isRepeatable(); }
/** * {@inheritDoc} */ @Override public boolean isRepeatable() { return delegate.isRepeatable(); }
/** * {@inheritDoc} */ @Override public boolean isRepeatable() { return delegate.isRepeatable(); }
/** * {@inheritDoc} */ @Override public boolean isRepeatable() { return delegate.isRepeatable(); }
@Override public boolean isRepeatable() { return this.payload.isRepeatable(); }
@Override public boolean isRepeatable() { return this.payload.isRepeatable(); }
@Override public boolean isRepeatable() { return this.payload.isRepeatable(); }
/** * Commands need to be replayed, if redirected or on a retryable error. Typically, this implies * the payload carried is not a streaming type. */ public boolean isReplayable() { return (request.getPayload() == null) ? true : request.getPayload().isRepeatable(); }
/** * Commands need to be replayed, if redirected or on a retryable error. Typically, this implies * the payload carried is not a streaming type. */ public boolean isReplayable() { return (request.getPayload() == null) ? true : request.getPayload().isRepeatable(); }
/** * Commands need to be replayed, if redirected or on a retryable error. Typically, this implies * the payload carried is not a streaming type. */ public boolean isReplayable() { return (request.getPayload() == null) ? true : request.getPayload().isRepeatable(); }
/** * Commands need to be replayed, if redirected or on a retryable error. Typically, this implies * the payload carried is not a streaming type. */ public boolean isReplayable() { return (request.getPayload() == null) ? true : request.getPayload().isRepeatable(); }
/** * Commands need to be replayed, if redirected or on a retryable error. Typically, this implies * the payload carried is not a streaming type. */ public boolean isReplayable() { return (request.getPayload() == null) ? true : request.getPayload().isRepeatable(); }
/** * Commands need to be replayed, if redirected or on a retryable error. Typically, this implies * the payload carried is not a streaming type. */ public boolean isReplayable() { return (request.getPayload() == null) ? true : request.getPayload().isRepeatable(); }
@VisibleForTesting String hashBody(Payload payload) { if (payload == null) return emptyStringHash; payload = useTheFilePartIfForm(payload); checkArgument(payload != null, "payload was null"); checkArgument(payload.isRepeatable(), "payload must be repeatable: " + payload); try { return base64().encode(ByteStreams2.hashAndClose(payload.getInput(), sha1()).asBytes()); } catch (Exception e) { Throwables.propagateIfPossible(e); throw new HttpException("error creating sigature for payload: " + payload, e); } }
@VisibleForTesting String hashBody(Payload payload) { if (payload == null) return emptyStringHash; payload = useTheFilePartIfForm(payload); checkArgument(payload != null, "payload was null"); checkArgument(payload.isRepeatable(), "payload must be repeatable: " + payload); try { return base64().encode(ByteStreams2.hashAndClose(payload.getInput(), sha1()).asBytes()); } catch (Exception e) { Throwables.propagateIfPossible(e); throw new HttpException("error creating sigature for payload: " + payload, e); } }
@VisibleForTesting String hashBody(Payload payload) { if (payload == null) return emptyStringHash; payload = useTheFilePartIfForm(payload); checkArgument(payload != null, "payload was null"); checkArgument(payload.isRepeatable(), "payload must be repeatable: " + payload); try { return base64().encode(ByteSources.asByteSource(payload.getInput()).hash(sha1()).asBytes()); } catch (Exception e) { Throwables.propagateIfPossible(e); throw new HttpException("error creating sigature for payload: " + payload, e); } }
/** * Content stream may need to be read. However, we should always close the http stream. * * @throws IOException */ public static byte[] closeClientButKeepContentStream(PayloadEnclosing response) { byte[] returnVal = toByteArrayOrNull(response); if (returnVal != null && !response.getPayload().isRepeatable()) { Payload newPayload = Payloads.newByteArrayPayload(returnVal); MutableContentMetadata fromMd = response.getPayload().getContentMetadata(); MutableContentMetadata toMd = newPayload.getContentMetadata(); copy(fromMd, toMd); response.setPayload(newPayload); } return returnVal; }
/** * Content stream may need to be read. However, we should always close the http stream. * * @throws IOException */ public static byte[] closeClientButKeepContentStream(PayloadEnclosing response) { byte[] returnVal = toByteArrayOrNull(response); if (returnVal != null && !response.getPayload().isRepeatable()) { Payload newPayload = Payloads.newByteSourcePayload(ByteSource.wrap(returnVal)); MutableContentMetadata fromMd = response.getPayload().getContentMetadata(); MutableContentMetadata toMd = newPayload.getContentMetadata(); copy(fromMd, toMd); response.setPayload(newPayload); } return returnVal; }