Examples of payload()


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

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

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

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

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

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

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

         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");
         // note MWS doesn't process Range header at the moment
         assertEquals(Strings2.toStringAndClose(object.payload().getInput()), "ABCD");

         assertEquals(server.getRequestCount(), 2);
View Full Code Here

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

         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");
         // note MWS doesn't process Range header at the moment
         assertEquals(Strings2.toStringAndClose(object.payload().getInput()), "ABCD");

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
View Full Code Here

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

            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");
         // note MWS doesn't process Range header at the moment
         assertEquals(Strings2.toStringAndClose(object.payload().getInput()), "ABCD");

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest get = server.takeRequest();
         assertEquals(get.getRequestLine(),
View Full Code Here

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

         assertTrue(destApi.copy(destinationObject, sourceContainer, sourceObject));
         assertNotNull(destApi.head(destinationObject));
        
         // now get a real SwiftObject
         SwiftObject destSwiftObject = destApi.get(destinationObject, GetOptions.NONE);
         assertEquals(Strings2.toString(destSwiftObject.payload()), stringPayload);
        
         // test exception thrown on bad source name
         try {
            destApi.copy(destinationObject, badSource, sourceObject);
            fail("Expected CopyObjectException");
View Full Code Here

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

   public void metadata() throws Exception {
      for (String regionId : regions) {
         SwiftObject object = api.objectApiInRegionForContainer(regionId, containerName).head(name);
         assertEquals(object.name(), name);
         checkObject(object);
         assertEquals(toStringAndClose(object.payload().getInput()), "");
      }
   }

   public void get() throws Exception {
      for (String regionId : regions) {
View Full Code Here

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

   public void get() throws Exception {
      for (String regionId : regions) {
         SwiftObject object = api.objectApiInRegionForContainer(regionId, containerName).get(name, GetOptions.NONE);
         assertEquals(object.name(), name);
         checkObject(object);
         assertEquals(toStringAndClose(object.payload().getInput()), "swifty");
      }
   }

   public void privateByDefault() throws Exception {
      for (String regionId : regions) {
View Full Code Here

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

   public void getOptions() throws Exception {
      for (String regionId : regions) {
         SwiftObject object = api.objectApiInRegionForContainer(regionId, containerName).get(name, tail(1));
         assertEquals(object.name(), name);
         checkObject(object);
         assertEquals(toStringAndClose(object.payload().getInput()), "y");
      }
   }

   public void listOptions() throws Exception {
      String lexicographicallyBeforeName = name.substring(0, name.length() - 1);
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.