Examples of etag()


Examples of com.s3auth.hosts.Resource.etag()

        );
        if (request.headers().containsKey(HttpHeaders.IF_NONE_MATCH)) {
            final String etag = request.headers()
                .get(HttpHeaders.IF_NONE_MATCH)
                .iterator().next();
            if (etag.equals(resource.etag())) {
                throw new HttpException(HttpURLConnection.HTTP_NOT_MODIFIED);
            }
        }
        if (request.headers().containsKey(HttpHeaders.IF_MODIFIED_SINCE)) {
            final Date since = DateUtils.parseDate(
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

               name, segments, ImmutableMap.of("myfoo", "Bar"));

         assertNotNull(etagOfEtags);

         SwiftObject bigObject = api.objectApiInRegionForContainer(regionId, containerName).head(name);
         assertNotEquals(bigObject.etag(), etagOfEtags);
         assertEquals(bigObject.payload().getContentMetadata().getContentLength(), new Long(2 * 1024 * 1024));
         assertEquals(bigObject.metadata(), ImmutableMap.of("myfoo", "Bar"));

         // segments are visible
         assertEquals(api.containerApiInRegion(regionId).get(containerName).objectCount(), 3);
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

      super.tearDown();
   }

   protected void assertMegabyteAndETagMatches(String regionId, String name, String etag1s) {
      SwiftObject object1s = api.objectApiInRegionForContainer(regionId, containerName).head(name);
      assertEquals(object1s.etag(), etag1s);
      assertEquals(object1s.payload().getContentMetadata().getContentLength(), new Long(1024 * 1024));
   }
}
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

      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));
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         SwiftObject object = api.objectApiInRegionForContainer("DFW", "myContainer").get("myObject", tail(1));
         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));
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

      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));
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         SwiftObject object = api.objectApiInRegionForContainer("DFW", "myContainer").get("myObject", tail(1));
         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));
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

               name, segments, ImmutableMap.of("myfoo", "Bar"));

         assertNotNull(etagOfEtags);

         SwiftObject bigObject = api.objectApiInRegionForContainer(regionId, containerName).head(name);
         assertNotEquals(bigObject.etag(), etagOfEtags);
         assertEquals(bigObject.payload().getContentMetadata().getContentLength(), new Long(2 * 1024 * 1024));
         assertEquals(bigObject.metadata(), ImmutableMap.of("myfoo", "Bar"));

         // segments are visible
         assertEquals(api.containerApiInRegion(regionId).get(containerName).objectCount(), 3);
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.etag()

      super.tearDown();
   }

   protected void assertMegabyteAndETagMatches(String regionId, String name, String etag1s) {
      SwiftObject object1s = api.objectApiInRegionForContainer(regionId, containerName).head(name);
      assertEquals(object1s.etag(), etag1s);
      assertEquals(object1s.payload().getContentMetadata().getContentLength(), new Long(1024 * 1024));
   }
}
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.Builder.etag()

         return null;
      }
      BlobMetadata from = BlobMetadata.class.cast(in);
      Builder to = SwiftObject.builder();
      to.name(from.getName());
      to.etag(from.getETag());
      to.lastModified(from.getLastModified());
      long bytes = from.getContentMetadata().getContentLength();
      String contentType = from.getContentMetadata().getContentType();
      to.payload(payload(bytes, contentType));
      to.metadata(from.getUserMetadata());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.