예제 #1
0
 public ListenableFuture<? extends Set<ContainerMetadata>> listContainers(
     org.jclouds.openstack.swift.options.ListContainerOptions... options) {
   return immediateFuture(
       Sets.newHashSet(
           Iterables.transform(
               blobStore.getContainerToBlobs().keySet(),
               new Function<String, ContainerMetadata>() {
                 public ContainerMetadata apply(String name) {
                   return new ContainerMetadata(name, -1, -1);
                 }
               })));
 }
예제 #2
0
  public ListenableFuture<MutableObjectInfoWithMetadata> getObjectInfo(
      String container, String key) {
    return Futures.compose(
        blobStore.blobMetadata(container, key),
        new Function<BlobMetadata, MutableObjectInfoWithMetadata>() {

          @Override
          public MutableObjectInfoWithMetadata apply(BlobMetadata from) {

            return blob2ObjectInfo.apply(from);
          }
        },
        service);
  }
예제 #3
0
 public ListenableFuture<Boolean> containerExists(final String container) {
   return immediateFuture(blobStore.getContainerToBlobs().containsKey(container));
 }
예제 #4
0
 public ListenableFuture<Void> removeObject(String container, String key) {
   return blobStore.removeBlob(container, key);
 }
예제 #5
0
 public ListenableFuture<String> putObject(String container, SwiftObject object) {
   return blobStore.putBlob(container, object2Blob.apply(object));
 }
예제 #6
0
 public ListenableFuture<PageSet<ObjectInfo>> listObjects(
     String container, org.jclouds.openstack.swift.options.ListContainerOptions... optionsList) {
   ListContainerOptions options = container2ContainerListOptions.apply(optionsList);
   return Futures.compose(blobStore.list(container, options), resource2ObjectList, service);
 }
예제 #7
0
 public ListenableFuture<SwiftObject> getObject(
     String container, String key, GetOptions... options) {
   org.jclouds.blobstore.options.GetOptions getOptions = httpGetOptionsConverter.apply(options);
   return Futures.compose(blobStore.getBlob(container, key, getOptions), blob2Object, service);
 }
예제 #8
0
 public ListenableFuture<Boolean> deleteContainerIfEmpty(String container) {
   return blobStore.deleteContainerImpl(container);
 }
예제 #9
0
 public ListenableFuture<Boolean> createContainer(String container) {
   return blobStore.createContainerInLocation(null, container);
 }