Package org.jclouds.blobstore.domain.internal

Examples of org.jclouds.blobstore.domain.internal.MutableStorageMetadataImpl


   public void test() {
      BucketsToStorageMetadata fn = new BucketsToStorageMetadata(
               sameThreadExecutor(),
               new BucketToResourceMetadata(Functions.forMap(ImmutableMap.<String, Location> of("mycontainer", region))));

      MutableStorageMetadata expected = new MutableStorageMetadataImpl();
      expected.setName("mycontainer");
      expected.setType(StorageType.CONTAINER);
      expected.setLocation(region);
     
      assertEquals(
               fn.apply(ImmutableSet.of(new BucketMetadata("mycontainer", null, null))).toString(),
               new PageSetImpl<StorageMetadata>(ImmutableSet.<StorageMetadata> of(expected), null).toString());
View Full Code Here


@Singleton
public class CommonPrefixesToResourceMetadata implements Function<String, StorageMetadata> {

   public StorageMetadata apply(String from) {
      MutableStorageMetadata returnVal = new MutableStorageMetadataImpl();
      returnVal.setType(StorageType.RELATIVE_PATH);
      returnVal.setName(from);
      return returnVal;
   }
View Full Code Here

   public void test() {
      BucketsToStorageMetadata fn = new BucketsToStorageMetadata(
               sameThreadExecutor(),
               new BucketToResourceMetadata(Functions.forMap(ImmutableMap.<String, Location> of("mycontainer", region))));

      MutableStorageMetadata expected = new MutableStorageMetadataImpl();
      expected.setName("mycontainer");
      expected.setType(StorageType.CONTAINER);
      expected.setLocation(region);
     
      assertEquals(
               fn.apply(ImmutableSet.of(new BucketMetadata("mycontainer", null, null))).toString(),
               new PageSetImpl<StorageMetadata>(ImmutableSet.<StorageMetadata> of(expected), null).toString());
View Full Code Here

   BucketToResourceMetadata(Function<String, Location> locationOfBucket) {
      this.locationOfBucket = locationOfBucket;
   }

   public StorageMetadata apply(BucketMetadata from) {
      MutableStorageMetadata to = new MutableStorageMetadataImpl();
      to.setName(from.getName());
      to.setType(StorageType.CONTAINER);
      to.setLocation(locationOfBucket.apply(from.getName()));
      to.setCreationDate(from.getCreationDate());
      return to;
   }
View Full Code Here

public class BaseServiceIntegrationTest extends BaseBlobStoreIntegrationTest {

   @Test(groups = { "integration", "live" })
   void containerDoesntExist() {
      Set<? extends StorageMetadata> list = view.getBlobStore().list();
      assert !list.contains(new MutableStorageMetadataImpl());
   }
View Full Code Here

            commonPrefixes.remove(CommonPrefixes.NO_PREFIX);

            contents = newTreeSet(filter(contents, new DelimiterFilter(prefix, delimiter)));

            for (String o : commonPrefixes) {
               MutableStorageMetadata md = new MutableStorageMetadataImpl();
               md.setType(StorageType.RELATIVE_PATH);
               md.setName(o);
               contents.add(md);
            }
         }

         // trim metadata, if the response isn't supposed to be detailed.
         if (!options.isDetailed()) {
            for (StorageMetadata md : contents) {
               md.getUserMetadata().clear();
            }
         }
      }

      return new PageSetImpl<StorageMetadata>(contents, marker);
View Full Code Here

               }
            }), null);
   }

   private MutableStorageMetadata create() {
      return new MutableStorageMetadataImpl();
   }
View Full Code Here

public class PrefixToResourceMetadataTest {
   PrefixToResourceMetadata fn = new PrefixToResourceMetadata();

   @Test
   public void testCorrect() throws SecurityException, NoSuchMethodException {
      MutableStorageMetadata expected = new MutableStorageMetadataImpl();
      expected.setType(StorageType.RELATIVE_PATH);
      expected.setName("foo");
      assertEquals(fn.apply("foo"), expected);
   }
View Full Code Here

   ContainerToResourceMetadata(Supplier<Location> defaultLocation) {
      this.defaultLocation = defaultLocation;
   }

   public StorageMetadata apply(ContainerProperties from) {
      MutableStorageMetadata to = new MutableStorageMetadataImpl();
      to.setName(from.getName());
      to.setLocation(defaultLocation.get());
      to.setETag(from.getETag());
      to.setLastModified(from.getLastModified());
      to.setUri(from.getUrl());
      to.setType(StorageType.CONTAINER);
      to.setUserMetadata(from.getMetadata());
      return to;
   }
View Full Code Here

TOP

Related Classes of org.jclouds.blobstore.domain.internal.MutableStorageMetadataImpl

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.