Fixed S3 stub bug that prevented object's content type being PUT correctly.

git-svn-id: http://jclouds.googlecode.com/svn/trunk@848 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
jamurty 2009-05-25 04:58:06 +00:00
parent 350469d618
commit a64a85412b
2 changed files with 2 additions and 3 deletions

View File

@ -427,7 +427,7 @@ public class StubS3Connection implements S3Connection {
byte[] data = toByteArray(object.getData());
final byte[] md5 = S3Utils.md5(data);
newMd.setMd5(md5);
newMd.setContentType("binary/octet-stream");
newMd.setContentType(object.getMetadata().getContentType());
if (options.getAcl() != null)
keyToAcl.put(bucketName + object, options.getAcl());
bucketToContents.get(bucketName).put(object.getKey(), new S3Object(newMd, data));

View File

@ -97,8 +97,7 @@ public class PutObjectIntegrationTest extends S3IntegrationTest {
addObjectToBucket(bucketName, object);
S3Object newObject = validateContent(bucketName, key);
// TODO.. why does this come back as binary/octetstring
assertEquals(newObject.getMetadata().getContentType(), "binary/octet-stream");
assertEquals(newObject.getMetadata().getContentType(), "text/plain");
assertEquals(newObject.getMetadata().getContentEncoding(), "x-compress");
assertEquals(newObject.getMetadata().getContentDisposition(),
"attachment; filename=hello.txt");