Package org.jclouds.openstack.swift.domain

Examples of org.jclouds.openstack.swift.domain.MutableObjectInfoWithMetadata


                                          .addHeader("Last-Modified", "Fri, 12 Jun 2007 13:40:18 GMT")
                                          .addHeader("Content-Length", "0")
                                          .addHeader("Etag", etag).build();

      response.getPayload().getContentMetadata().setContentType("text/plain");
      MutableObjectInfoWithMetadata md = parser.apply(response);
      assertNotNull(md.getHash());
      assertEquals(md.getHash(), expectedHash);
   }
View Full Code Here


         // Test HEAD of missing object
         assert getApi().getObjectInfo(containerName, "non-existent-object") == null;

         // Test HEAD of object
         MutableObjectInfoWithMetadata metadata = getApi().getObjectInfo(containerName, object.getInfo().getName());
         assertEquals(metadata.getName(), object.getInfo().getName());

         assertEquals(metadata.getBytes(), Long.valueOf(data.length()));
         assert metadata.getContentType().startsWith("text/plain") : metadata.getContentType();

         assertEquals(base16().lowerCase().encode(md5), base16().lowerCase().encode(metadata.getHash()));
         assertEquals(metadata.getHash(), base16().lowerCase().decode(newEtag));
         assertEquals(metadata.getMetadata().entrySet().size(), 1);
         assertEquals(metadata.getMetadata().get("metadata"), "metadata-value");

         // // Test POST to update object's metadata
         Map<String, String> userMetadata = Maps.newHashMap();
         userMetadata.put("New-Metadata-1", "value-1");
         userMetadata.put("New-Metadata-2", "value-2");
View Full Code Here

         removeObjectsWithPrefix(objectManifest);
      }
   }

   private String getObjectManifestOrNull(String container, String key) {
      MutableObjectInfoWithMetadata objectInfo = sync.getObjectInfo(container, key);
      return objectInfo == null ? null : objectInfo.getObjectManifest();
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.swift.domain.MutableObjectInfoWithMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.