public class Payloads extends Object
Modifier and Type | Method and Description |
---|---|
static Payload |
calculateMD5(Payload payload)
Calculates and sets
Payload#setContentMD5 on the payload. |
static <T extends PayloadEnclosing> |
calculateMD5(T payloadEnclosing)
Calculates the md5 on a payload, replacing as necessary.
|
static ByteArrayPayload |
newByteArrayPayload(byte[] data)
Deprecated.
see newPayload(ByteSource)
|
static ByteSourcePayload |
newByteSourcePayload(com.google.common.io.ByteSource data) |
static FilePayload |
newFilePayload(File data)
Deprecated.
see newPayload(ByteSource)
|
static InputStreamPayload |
newInputStreamPayload(InputStream data) |
static Payload |
newPayload(Object data)
Deprecated.
see newPayload(ByteSource) or newPayload(InputStream)
|
static StringPayload |
newStringPayload(String data)
Deprecated.
see newPayload(ByteSource)
|
static UrlEncodedFormPayload |
newUrlEncodedFormPayload(com.google.common.collect.Multimap<String,String> formParams) |
@Deprecated public static Payload newPayload(Object data)
public static InputStreamPayload newInputStreamPayload(InputStream data)
@Deprecated public static ByteArrayPayload newByteArrayPayload(byte[] data)
public static ByteSourcePayload newByteSourcePayload(com.google.common.io.ByteSource data)
@Deprecated public static StringPayload newStringPayload(String data)
@Deprecated public static FilePayload newFilePayload(File data)
public static UrlEncodedFormPayload newUrlEncodedFormPayload(com.google.common.collect.Multimap<String,String> formParams)
public static Payload calculateMD5(Payload payload) throws IOException
Payload#setContentMD5
on the payload.
note that this will rebuffer in memory if the payload is not repeatable.payload
- payload to calculateIOException
public static <T extends PayloadEnclosing> T calculateMD5(T payloadEnclosing) throws IOException
IOException
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.