Package org.jclouds.blobstore.domain.internal

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


               new Function<DirectoryEntry, StorageMetadata>() {

                  public StorageMetadata apply(DirectoryEntry from) {
                     StorageType type = from.getType() == FileType.DIRECTORY ? StorageType.FOLDER : StorageType.BLOB;
                     if (type == StorageType.FOLDER)
                        return new StorageMetadataImpl(type, from.getObjectID(), from.getObjectName(), defaultLocation
                                 .get(), null, null, null, null, ImmutableMap.<String,String>of());
                     else
                        return new BlobMetadataImpl(from.getObjectID(), from.getObjectName(), defaultLocation.get(),
                                 null, null, null, null, ImmutableMap.<String,String>of(), null,
                                 null, new BaseMutableContentMetadata());
View Full Code Here


      SortedSet<StorageMetadata> contents = newTreeSet(transform(blobBelongingToContainer,
            new Function<String, StorageMetadata>() {
               public StorageMetadata apply(String key) {
                  if (!storageStrategy.blobExists(container, key)) {
                     // handle directory
                     return new StorageMetadataImpl(StorageType.FOLDER, /*id=*/ null, key,
                           /*location=*/ null, /*uri=*/ null, /*eTag=*/ null, /*creationDate=*/ null,
                           /*lastModified=*/ null, ImmutableMap.<String, String>of());
                  }
                  Blob oldBlob = loadBlob(container, key);
                  checkState(oldBlob != null, "blob " + key + " is not present although it was in the list of "
View Full Code Here

      String name = checkNotNull(md.getName(), "metadata.name");
      for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) {
         if (name.endsWith(suffix))
            name = name.substring(0, name.length() - suffix.length());
      }
      return new StorageMetadataImpl(StorageType.RELATIVE_PATH, md.getProviderId(), name, md.getLocation(),
            md.getUri(), md.getETag(), md.getCreationDate(), md.getLastModified(), md.getUserMetadata());
   }
View Full Code Here

      SortedSet<StorageMetadata> contents = newTreeSet(transform(blobBelongingToContainer,
            new Function<String, StorageMetadata>() {
               public StorageMetadata apply(String key) {
                  if (!storageStrategy.blobExists(container, key)) {
                     // handle directory
                     return new StorageMetadataImpl(StorageType.FOLDER, /*id=*/ null, key,
                           /*location=*/ null, /*uri=*/ null, /*eTag=*/ null, /*creationDate=*/ null,
                           /*lastModified=*/ null, ImmutableMap.<String, String>of());
                  }
                  Blob oldBlob = loadBlob(container, key);
                  checkState(oldBlob != null, "blob " + key + " is not present although it was in the list of "
View Full Code Here

import com.google.common.collect.ImmutableMap;

public class VaultMetadataToStorageMetadata implements Function<VaultMetadata, StorageMetadata> {
   @Override
   public StorageMetadata apply(VaultMetadata vault) {
      return new StorageMetadataImpl(StorageType.CONTAINER, vault.getVaultARN(), vault.getVaultName(), null, null, null,
            vault.getCreationDate(), vault.getLastInventoryDate(), ImmutableMap.<String, String>of());
   }
View Full Code Here

   public PageSet<? extends StorageMetadata> apply(PageSet<ObjectInfo> from) {
      return new PageSetImpl<StorageMetadata>(Iterables.transform(Iterables.transform(from, object2blobMd),
               new Function<BlobMetadata, StorageMetadata>() {
                  public StorageMetadata apply(BlobMetadata input) {
                     if (input.getContentMetadata().getContentType().equals("application/directory")) {
                        return new StorageMetadataImpl(StorageType.RELATIVE_PATH, input.getProviderId(), input
                                 .getName(), input.getLocation(), input.getUri(), input.getETag(),
                                 input.getCreationDate(), input.getLastModified(), input.getUserMetadata());
                     }
                     return input;
                  }
View Full Code Here

      String name = checkNotNull(md.getName(), "metadata.name");
      for (String suffix : BlobStoreConstants.DIRECTORY_SUFFIXES) {
         if (name.endsWith(suffix))
            name = name.substring(0, name.length() - suffix.length());
      }
      return new StorageMetadataImpl(StorageType.RELATIVE_PATH, md.getProviderId(), name, md.getLocation(),
            md.getUri(), md.getETag(), md.getCreationDate(), md.getLastModified(), md.getUserMetadata());
   }
View Full Code Here

      SortedSet<StorageMetadata> contents = newTreeSet(transform(blobBelongingToContainer,
            new Function<String, StorageMetadata>() {
               public StorageMetadata apply(String key) {
                  if (!storageStrategy.blobExists(container, key)) {
                     // handle directory
                     return new StorageMetadataImpl(StorageType.FOLDER, /*id=*/ null, key,
                           /*location=*/ null, /*uri=*/ null, /*eTag=*/ null, /*creationDate=*/ null,
                           /*lastModified=*/ null, ImmutableMap.<String, String>of());
                  }
                  Blob oldBlob = loadBlob(container, key);
                  checkState(oldBlob != null, "blob " + key + " is not present although it was in the list of "
View Full Code Here

   public PageSet<? extends StorageMetadata> apply(PageSet<ObjectInfo> from) {
      return new PageSetImpl<StorageMetadata>(Iterables.transform(Iterables.transform(from, object2blobMd),
               new Function<BlobMetadata, StorageMetadata>() {
                  public StorageMetadata apply(BlobMetadata input) {
                     if (input.getContentMetadata().getContentType().equals("application/directory")) {
                        return new StorageMetadataImpl(StorageType.RELATIVE_PATH, input.getProviderId(), input
                                 .getName(), input.getLocation(), input.getUri(), input.getETag(),
                                 input.getCreationDate(), input.getLastModified(), input.getUserMetadata());
                     }
                     return input;
                  }
View Full Code Here

               new Function<DirectoryEntry, StorageMetadata>() {

                  public StorageMetadata apply(DirectoryEntry from) {
                     StorageType type = from.getType() == FileType.DIRECTORY ? StorageType.FOLDER : StorageType.BLOB;
                     if (type == StorageType.FOLDER)
                        return new StorageMetadataImpl(type, from.getObjectID(), from.getObjectName(), defaultLocation
                                 .get(), null, null, null, null, ImmutableMap.<String,String>of());
                     else
                        return new BlobMetadataImpl(from.getObjectID(), from.getObjectName(), defaultLocation.get(),
                                 null, null, null, null, ImmutableMap.<String,String>of(), null,
                                 null, new BaseMutableContentMetadata());
View Full Code Here

TOP

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

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.