public class Payloads extends Object
Modifier and Type | Method and Description |
---|---|
static Payload |
calculateMD5(Payload payload)
Uses default md5 generator.
|
static Payload |
calculateMD5(Payload payload,
MessageDigest md5)
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 <T extends PayloadEnclosing> |
calculateMD5(T payloadEnclosing,
MessageDigest md5)
Calculates the md5 on a payload, replacing as necessary.
|
static ByteArrayPayload |
newByteArrayPayload(byte[] data) |
static FilePayload |
newFilePayload(File data) |
static InputStreamPayload |
newInputStreamPayload(InputStream data) |
static Payload |
newPayload(Object data) |
static StringPayload |
newStringPayload(String data) |
static UrlEncodedFormPayload |
newUrlEncodedFormPayload(com.google.common.collect.Multimap<String,String> formParams,
char... skips) |
static UrlEncodedFormPayload |
newUrlEncodedFormPayload(com.google.common.collect.Multimap<String,String> formParams,
Comparator<Map.Entry<String,String>> sorter,
char... skips) |
public static InputStreamPayload newInputStreamPayload(InputStream data)
public static ByteArrayPayload newByteArrayPayload(byte[] data)
public static StringPayload newStringPayload(String data)
public static FilePayload newFilePayload(File data)
public static UrlEncodedFormPayload newUrlEncodedFormPayload(com.google.common.collect.Multimap<String,String> formParams, char... skips)
public static UrlEncodedFormPayload newUrlEncodedFormPayload(com.google.common.collect.Multimap<String,String> formParams, @Nullable Comparator<Map.Entry<String,String>> sorter, char... skips)
public static Payload calculateMD5(Payload payload, MessageDigest md5) throws IOException
Payload#setContentMD5
on the payload.
note that this will rebuffer in memory if the payload is not repeatable.payload
- payload to calculatemd5
- digester to calculate payloads with.IOException
public static Payload calculateMD5(Payload payload) throws IOException
IOException
calculateMD5(Payload, MessageDigest)
public static <T extends PayloadEnclosing> T calculateMD5(T payloadEnclosing, MessageDigest md5) throws IOException
IOException
calculateMD5(Payload, MessageDigest)
public static <T extends PayloadEnclosing> T calculateMD5(T payloadEnclosing) throws IOException
IOException
calculateMD5(Payload, MessageDigest)
Copyright © 2009-2012 jclouds. All Rights Reserved.