mirror of https://github.com/apache/jclouds.git
updated ning to 1.6.1
This commit is contained in:
parent
5075032edd
commit
cc37ac1847
|
@ -61,7 +61,7 @@
|
|||
<dependency>
|
||||
<groupId>com.ning</groupId>
|
||||
<artifactId>async-http-client</artifactId>
|
||||
<version>1.4.1</version>
|
||||
<version>1.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
|
|
|
@ -59,6 +59,7 @@ import com.ning.http.client.AsyncHttpClient;
|
|||
import com.ning.http.client.Request;
|
||||
import com.ning.http.client.RequestBuilder;
|
||||
import com.ning.http.client.Response;
|
||||
import com.ning.http.client.generators.InputStreamBodyGenerator;
|
||||
|
||||
/**
|
||||
* Todo Write me
|
||||
|
@ -130,7 +131,7 @@ public class NingHttpCommandExecutorService implements HttpCommandExecutorServic
|
|||
public Request apply(HttpRequest request) {
|
||||
|
||||
for (HttpRequestFilter filter : request.getFilters()) {
|
||||
filter.filter(request);
|
||||
request = filter.filter(request);
|
||||
}
|
||||
|
||||
RequestBuilder builder = new RequestBuilder(request.getMethod());
|
||||
|
@ -140,8 +141,8 @@ public class NingHttpCommandExecutorService implements HttpCommandExecutorServic
|
|||
boolean chunked = "chunked".equals(request.getFirstHeaderOrNull("Transfer-Encoding"));
|
||||
|
||||
if (request.getPayload().getContentMetadata().getContentMD5() != null)
|
||||
builder.addHeader("Content-MD5",
|
||||
CryptoStreams.base64(request.getPayload().getContentMetadata().getContentMD5()));
|
||||
builder.addHeader("Content-MD5", CryptoStreams.base64(request.getPayload().getContentMetadata()
|
||||
.getContentMD5()));
|
||||
if (request.getPayload().getContentMetadata().getContentType() != null)
|
||||
builder.addHeader(HttpHeaders.CONTENT_TYPE, request.getPayload().getContentMetadata().getContentType());
|
||||
if (request.getPayload().getContentMetadata().getContentLanguage() != null)
|
||||
|
@ -177,7 +178,7 @@ public class NingHttpCommandExecutorService implements HttpCommandExecutorServic
|
|||
if (payload instanceof FilePayload) {
|
||||
requestBuilder.setBody(((FilePayload) payload).getRawContent());
|
||||
} else {
|
||||
requestBuilder.setBody(payload.getInput());
|
||||
requestBuilder.setBody(new InputStreamBodyGenerator(payload.getInput()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue