Examples of FilesObject


Examples of com.rackspacecloud.client.cloudfiles.FilesObject

     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(10, objects.size());
      for (int i=0; i < 10; i++) {
        FilesObject obj = objects.get(i);
        assertEquals("testfile" + i + ".bogus", obj.getName());
        assertEquals("application/octet-stream", obj.getMimeType());
      }

      // Now do a limit
      objects = client.listObjects(containerName, 3);
      assertEquals(3, objects.size());
      for (int i=0; i < 3; i++) {
        FilesObject obj = objects.get(i);
        assertEquals("testfile" + i + ".bogus", obj.getName());
        assertEquals("application/octet-stream", obj.getMimeType());
      }
     
      // Now check out a marker
      objects = client.listObjects(containerName, 4, "testfile3.bogus");
      assertEquals(4, objects.size());
      for (int i=0; i < 4; i++) {
        FilesObject obj = objects.get(i);
        assertEquals("testfile" + (i + 4) + ".bogus", obj.getName());
        assertEquals("application/octet-stream", obj.getMimeType());
      }
     
      // Clean up
      for (int i=0; i < 10; i++) {
        client.deleteObject(containerName, "testfile" + i + ".bogus");
View Full Code Here

Examples of com.rackspacecloud.client.cloudfiles.FilesObject

      assertEquals(randomData.length/8192 + 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.storeStreamedObject(containerName, new ByteArrayInputStream(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, 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());
     
      assertNotNull(obj.getMetaData());
     
      // 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

     
      List<FilesObject> allObjects = client.listObjects(containerName);
     
      assertEquals(1, allObjects.size());
     
      FilesObject obj = allObjects.get(0);
      assertEquals(0, obj.getSize());
      assertEquals("application/directory", obj.getMimeType());
     
      // If we don't throw an exception, we should be OK
      client.getObject(containerName, "test");
     
      // Delete it
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

      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

      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, new File(fullPath), "application/octet-stream", otherFileName));
     
      // Make sure it's there
      List<FilesObject> objects = client.listObjects(containerName);
      assertEquals(1, objects.size());
      FilesObject obj = objects.get(0);
      assertEquals("Bob", obj.getName());
      assertEquals("application/octet-stream", obj.getMimeType());
     
      // Make sure the data is correct
      assertArrayEquals(randomData, client.getObject(containerName, otherFileName));
     
      // 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.