Examples of FilesObject


Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertEquals(1, callback.nCalls);
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertNotNull(client.storeObjectAs(containerName, new File(fullPath), "application/octet-stream", filename, meta));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertNotNull(client.storeObjectAs(containerName, new File(fullPath), "application/octet-stream", filename, meta));

      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      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()) {
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertNotNull(client.storeObjectAs(containerName, new File(fullPath), "application/octet-stream", filename));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

        throws IOException, HttpException {

        // Make sure it's there
        List<FilesObject> objects = client.listObjects(container);
        assertEquals(1, objects.size());
        FilesObject obj = objects.get(0);
        assertEquals(objName, obj.getName());
        assertEquals(mime, obj.getMimeType());

        // Make sure the data is correct
        assertArrayEquals(data, client.getObject(container, objName));

        // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertNotNull(client.storeObjectAs(containerName, new File(fullPath), "application/octet-stream", filename));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
      assertEquals(NUMBER_RANDOM_BYTES, obj.getSize());
      assertEquals(md5Sum(randomData), obj.getMd5sum());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertTrue(client.storeObject(containerName, randomData, "application/octet-stream", filename, new HashMap<String,String>()));
       
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
      assertEquals(NUMBER_RANDOM_BYTES, obj.getSize());
      assertEquals(md5Sum(randomData), obj.getMd5sum());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertTrue(client.storeObject(containerName, randomData, "application/octet-stream", filename, new HashMap<String,String>()));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertTrue(client.storeObject(containerName, randomData, "application/octet-stream", filename, new HashMap<String,String>()));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertNotNull(client.storeObjectAs(containerName, filename, entity, new HashMap<String,String>(), FilesClient.md5Sum(randomData)));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals(filename, obj.getName());
      assertEquals("test/content_type", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, filename));
     
      // Make sure the data is correct as a stream
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.