Package org.jclouds.blobstore.domain.internal

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


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

   public StorageMetadata apply(ContainerMetadata from) {
      MutableStorageMetadata to = new MutableStorageMetadataImpl();
      to.setName(from.getName());
      to.setLocation(defaultLocation.get());
      to.setType(StorageType.CONTAINER);
      return to;
   }
View Full Code Here


      this.region = region;
   }

   @Override
   public StorageMetadata apply(Container from) {
      MutableStorageMetadata to = new MutableStorageMetadataImpl();
      to.setName(from.getName());
      to.setLocation(region);
      to.setType(StorageType.CONTAINER);
      to.setUserMetadata(from.getMetadata());
      return to;
   }
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

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

   public StorageMetadata apply(ContainerMetadata from) {
      MutableStorageMetadata to = new MutableStorageMetadataImpl();
      to.setName(from.getName());
      to.setLocation(defaultLocation.get());
      to.setType(StorageType.CONTAINER);
      return to;
   }
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 Futures.<PageSet<? extends StorageMetadata>> immediateFuture(new PageSetImpl<StorageMetadata>(contents,
View Full Code Here

               }
            }), null));
   }

   protected 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

*/
@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

   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

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

   public StorageMetadata apply(String from) {
      checkNotNull(from, "prefix");
      MutableStorageMetadata returnVal = new MutableStorageMetadataImpl();
      returnVal.setType(StorageType.RELATIVE_PATH);
      returnVal.setName(from);
      return returnVal;
   }
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.