mirror of https://github.com/apache/jclouds.git
atmos: explicitly set Expect header on methods that need it
This commit is contained in:
parent
fad291a29f
commit
b186220ff7
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
package org.jclouds.atmos;
|
||||
|
||||
import static com.google.common.net.HttpHeaders.EXPECT;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import javax.inject.Named;
|
||||
|
@ -56,6 +58,7 @@ import org.jclouds.blobstore.BlobStoreFallbacks.ThrowKeyNotFoundOn404;
|
|||
import org.jclouds.http.options.GetOptions;
|
||||
import org.jclouds.rest.annotations.BinderParam;
|
||||
import org.jclouds.rest.annotations.Fallback;
|
||||
import org.jclouds.rest.annotations.Headers;
|
||||
import org.jclouds.rest.annotations.ParamParser;
|
||||
import org.jclouds.rest.annotations.QueryParams;
|
||||
import org.jclouds.rest.annotations.RequestFilters;
|
||||
|
@ -119,6 +122,7 @@ public interface AtmosAsyncClient {
|
|||
@Named("CreateObject")
|
||||
@POST
|
||||
@Path("/{parent}/{name}")
|
||||
@Headers(keys = EXPECT, values = "100-continue")
|
||||
@Consumes(MediaType.WILDCARD)
|
||||
ListenableFuture<URI> createFile(
|
||||
@PathParam("parent") String parent,
|
||||
|
@ -131,6 +135,7 @@ public interface AtmosAsyncClient {
|
|||
@Named("UpdateObject")
|
||||
@PUT
|
||||
@Path("/{parent}/{name}")
|
||||
@Headers(keys = EXPECT, values = "100-continue")
|
||||
@Fallback(ThrowKeyNotFoundOn404.class)
|
||||
@Consumes(MediaType.WILDCARD)
|
||||
ListenableFuture<Void> updateFile(
|
||||
|
|
|
@ -167,7 +167,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest<AtmosAsyncClient>
|
|||
.apply(BindBlobToMultipartFormTest.TEST_BLOB)));
|
||||
|
||||
assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\n");
|
||||
assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\n");
|
||||
assertPayloadEquals(request, "hello", "text/plain", false);
|
||||
|
||||
assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class);
|
||||
|
@ -185,7 +185,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest<AtmosAsyncClient>
|
|||
|
||||
assertRequestLineEquals(request, "POST https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT
|
||||
+ ": */*\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n");
|
||||
+ ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n");
|
||||
assertPayloadEquals(request, "hello", "text/plain", false);
|
||||
|
||||
assertResponseParserClassEquals(method, request, ParseURIFromListOrLocationHeaderIf20x.class);
|
||||
|
@ -202,7 +202,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest<AtmosAsyncClient>
|
|||
.apply(BindBlobToMultipartFormTest.TEST_BLOB)));
|
||||
|
||||
assertRequestLineEquals(request, "PUT https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\n");
|
||||
assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT + ": */*\nExpect: 100-continue\n");
|
||||
assertPayloadEquals(request, "hello", "text/plain", false);
|
||||
|
||||
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
|
||||
|
@ -220,7 +220,7 @@ public class AtmosAsyncClientTest extends BaseAsyncClientTest<AtmosAsyncClient>
|
|||
|
||||
assertRequestLineEquals(request, "PUT https://accesspoint.atmosonline.com/rest/namespace/dir/hello HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(request, HttpHeaders.ACCEPT
|
||||
+ ": */*\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n");
|
||||
+ ": */*\nExpect: 100-continue\nx-emc-groupacl: other=READ\nx-emc-useracl: root=FULL_CONTROL\n");
|
||||
assertPayloadEquals(request, "hello", "text/plain", false);
|
||||
|
||||
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
|
||||
|
|
|
@ -101,7 +101,7 @@ public class AtmosBlobRequestSignerTest extends BaseAsyncClientTest<AtmosAsyncCl
|
|||
"POST https://accesspoint.atmosonline.com/rest/namespace/container/name HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(
|
||||
request,
|
||||
"Accept: */*\nDate: Thu, 05 Jun 2008 16:38:19 GMT\nx-emc-signature: 7Cbdnu+YA5rG9J/C9RlHk07mU7w=\nx-emc-uid: identity\n");
|
||||
"Accept: */*\nDate: Thu, 05 Jun 2008 16:38:19 GMT\nExpect: 100-continue\nx-emc-signature: 7Cbdnu+YA5rG9J/C9RlHk07mU7w=\nx-emc-uid: identity\n");
|
||||
|
||||
assertContentHeadersEqual(request, "text/plain", null, null, null, (long) 2l, new byte[] { 0, 2, 4, 8 }, new Date(1000));
|
||||
|
||||
|
|
Loading…
Reference in New Issue