Revert "Add Atmos-specific MD5 checksum header"

This reverts commit 98230e60a4.

This succeeded in my tests but integration tests fail.
This commit is contained in:
Andrew Gaul 2013-07-17 10:29:42 -07:00
parent 865b910637
commit e14e23be52
3 changed files with 1 additions and 19 deletions

View File

@ -22,10 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
import com.google.common.io.BaseEncoding;
import org.jclouds.atmos.domain.AtmosObject; import org.jclouds.atmos.domain.AtmosObject;
import org.jclouds.atmos.reference.AtmosHeaders;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.rest.Binder; import org.jclouds.rest.Binder;
@ -50,15 +47,6 @@ public class BindMetadataToHeaders implements Binder {
checkNotNull(object.getPayload(), "object payload"); checkNotNull(object.getPayload(), "object payload");
checkArgument(object.getPayload().getContentMetadata().getContentLength() != null, checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
"contentLength must be set, streaming not supported"); "contentLength must be set, streaming not supported");
byte[] contentMD5 = object.getContentMetadata().getContentMD5();
if (contentMD5 != null) {
// Swizzle Content-MD5 to Atmos-specific header
object.getContentMetadata().setContentMD5(null);
request = (R) request.toBuilder()
.addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
BaseEncoding.base64().encode(contentMD5))
.build();
}
return metaBinder.bindToRequest(request, object.getUserMetadata()); return metaBinder.bindToRequest(request, object.getUserMetadata());
} }
} }

View File

@ -35,6 +35,5 @@ public interface AtmosHeaders {
public static final String GROUP_ACL = "x-emc-groupacl"; public static final String GROUP_ACL = "x-emc-groupacl";
public static final String UID = "x-emc-uid"; public static final String UID = "x-emc-uid";
public static final String TOKEN = "x-emc-token"; public static final String TOKEN = "x-emc-token";
public static final String CHECKSUM = "x-emc-wschecksum";
} }

View File

@ -99,12 +99,7 @@ public class AtmosBlobRequestSignerTest extends BaseAsyncClientTest<AtmosAsyncCl
"POST https://accesspoint.atmosonline.com/rest/namespace/container/name HTTP/1.1"); "POST https://accesspoint.atmosonline.com/rest/namespace/container/name HTTP/1.1");
assertNonPayloadHeadersEqual( assertNonPayloadHeadersEqual(
request, request,
"Accept: */*\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");
"Date: Thu, 05 Jun 2008 16:38:19 GMT\n" +
"Expect: 100-continue\n" +
"x-emc-signature: PY3MQyILhoLDVoKfnB6ECTRaCWQ=\n" +
"x-emc-uid: identity\n" +
"x-emc-wschecksum: MD5/0/AAIECA==\n");
assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, new Date(1000)); assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, new Date(1000));