FilesObject obj = objects.get(0);
assertEquals(filename, obj.getName());
assertEquals("application/octet-stream", obj.getMimeType());
// Make sure the metadata is correct
FilesObjectMetaData metadata = client.getObjectMetaData(containerName, filename);
assertNotNull(metadata);
Map<String,String> serverMetadata = metadata.getMetaData();
assertEquals(meta.size(), serverMetadata.size());
for(String key : meta.keySet()) {
assertTrue(serverMetadata.containsKey(key));
assertEquals(meta.get(key), serverMetadata.get(key));
}
// Make sure we can update
meta.put("Foo", "one");
meta.put("Uni", "\u0169\u00f1\u00eftwo");
meta.put("Width", "three");
meta.put("Height", "four");
assertTrue(client.updateObjectMetadata(containerName, filename, meta));
// Re-fect and make sure things are the same
objects = client.listObjects(containerName);
assertEquals(1, objects.size());
obj = objects.get(0);
assertEquals(filename, obj.getName());
assertEquals("application/octet-stream", obj.getMimeType());
metadata = client.getObjectMetaData(containerName, filename);
assertNotNull(metadata);
serverMetadata = metadata.getMetaData();
assertEquals(meta.size(), serverMetadata.size());
for(String key : meta.keySet()) {
assertTrue(serverMetadata.containsKey(key));
assertEquals(meta.get(key), serverMetadata.get(key));
}