Package com.rackspacecloud.client.cloudfiles

Examples of com.rackspacecloud.client.cloudfiles.FilesObjectMetaData


        }
        else {
          String container = name.substring(0, slashLocation);
          String object = name.substring(slashLocation + 1);
          try {
            FilesObjectMetaData metadata = client.getObjectMetaData(container, object);
            if (metadata == null) {
              System.out.println("Could not get metadata for " + name);
            }
            else {
              System.out.println("LGV: " + container + ":" + object + ":" + metadata);
              System.out.println("Information for " + name);
              System.out.println("  Total Size: " + metadata.getContentLength() + " bytes");
              System.out.println("  MIME type: " + metadata.getMimeType());
              Map<String, String> md = metadata.getMetaData();
              if (md.size() == 0) {
                System.out.println("  Contains no metadata");
              }
              else {
                System.out.println("  Metadata:");
View Full Code Here


      is.read(otherData);
      assertArrayEquals(randomData, otherData);
      assertEquals(-1, is.read()); // Could hang if there's a bug on the other end
     
      // 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));
      }
View Full Code Here

      is.read(otherData);
      assertArrayEquals(randomData, otherData);
      assertEquals(-1, is.read()); // Could hang if there's a bug on the other end
     
      // 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));
      }
View Full Code Here

      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()) {
        assertTrue(serverMetadata.containsKey(key));
        assertEquals(meta.get(key), serverMetadata.get(key));
      }
View Full Code Here

    public CloudStoreObjectMetadata sendRefreshMetadataRequest(
                CloudStoreObject obj )
    {
  try
  {
      FilesObjectMetaData metadata = _client
        .getObjectMetaData( getRootContainer( ).getName( ), obj
        .getPath( ).getAbsolutePath( ) );
      if ( metadata == null )
      {
    throw new CloudStoreException( "No object found at path '"
View Full Code Here

TOP

Related Classes of com.rackspacecloud.client.cloudfiles.FilesObjectMetaData

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.