.addHeader("X-Object-Meta-Apiname", "swift") //
.addHeader("X-Object-Meta-Apiversion", "v1.1"));
try {
SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
SwiftObject object = api.objectApiInRegionForContainer("DFW", "myContainer").head("myObject");
assertEquals(object.name(), "myObject");
assertEquals(object.etag(), "8a964ee2a5e88be344f36c22562a6486");
assertEquals(object.lastModified(), dates.rfc822DateParse("Fri, 12 Jun 2010 13:40:18 GMT"));
for (Entry<String, String> entry : object.metadata().entrySet()) {
assertEquals(object.metadata().get(entry.getKey().toLowerCase()), entry.getValue());
}
assertEquals(object.payload().getContentMetadata().getContentLength(), new Long(4));
assertEquals(object.payload().getContentMetadata().getContentType(), "text/plain; charset=UTF-8");
assertEquals(Strings2.toStringAndClose(object.payload().getInput()), "");
assertEquals(server.getRequestCount(), 2);
assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
assertEquals(server.takeRequest().getRequestLine(),
"HEAD /v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer/myObject HTTP/1.1");