Class JcloudsBlobStoreHelper


  • public final class JcloudsBlobStoreHelper
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearContainer​(org.jclouds.blobstore.BlobStore blobStore, String container)
      Clear a BlobStore specific container
      static boolean containerExists​(org.jclouds.blobstore.BlobStore blobStore, String container)
      Check if a BlobStore specific container exists or not
      static long countBlob​(org.jclouds.blobstore.BlobStore blobStore, String container)
      Return the count of all the blobs in the container
      static void deleteContainer​(org.jclouds.blobstore.BlobStore blobStore, String container)
      Delete a BlobStore specific container
      static void ensureContainerExists​(org.jclouds.blobstore.BlobStore blobStore, String container, String locationId)
      Checks if container exists and creates one if not.
      static org.jclouds.domain.Location getLocationById​(org.jclouds.blobstore.BlobStore blobStore, String locationId)
      Returns the Location that matches the locationId.
      static void mkDirs​(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName)
      Creates all directories that are part of the blobName.
      static InputStream readBlob​(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName)
      Reads from a BlobStore.
      static void removeBlob​(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName)
      Remove a specific blob from a BlobStore
      static void removeBlobs​(org.jclouds.blobstore.BlobStore blobStore, String container, List blobNames)
      Delete a list of BlobStore blob
      static void writeBlob​(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName, org.jclouds.io.Payload payload)
      Writes Payload to the BlobStore.
    • Method Detail

      • mkDirs

        public static void mkDirs​(org.jclouds.blobstore.BlobStore blobStore,
                                  String container,
                                  String blobName)
        Creates all directories that are part of the blobName.
      • ensureContainerExists

        public static void ensureContainerExists​(org.jclouds.blobstore.BlobStore blobStore,
                                                 String container,
                                                 String locationId)
        Checks if container exists and creates one if not.
        Parameters:
        blobStore - The BlobStore to use.
        container - The container name to check against.
        locationId - The locationId to create the container if not found.
      • getLocationById

        public static org.jclouds.domain.Location getLocationById​(org.jclouds.blobstore.BlobStore blobStore,
                                                                  String locationId)
        Returns the Location that matches the locationId.
      • writeBlob

        public static void writeBlob​(org.jclouds.blobstore.BlobStore blobStore,
                                     String container,
                                     String blobName,
                                     org.jclouds.io.Payload payload)
        Writes Payload to the BlobStore.
      • countBlob

        public static long countBlob​(org.jclouds.blobstore.BlobStore blobStore,
                                     String container)
        Return the count of all the blobs in the container
      • removeBlob

        public static void removeBlob​(org.jclouds.blobstore.BlobStore blobStore,
                                      String container,
                                      String blobName)
                               throws IOException
        Remove a specific blob from a BlobStore
        Throws:
        IOException
      • clearContainer

        public static void clearContainer​(org.jclouds.blobstore.BlobStore blobStore,
                                          String container)
                                   throws IOException
        Clear a BlobStore specific container
        Throws:
        IOException
      • deleteContainer

        public static void deleteContainer​(org.jclouds.blobstore.BlobStore blobStore,
                                           String container)
                                    throws IOException
        Delete a BlobStore specific container
        Throws:
        IOException
      • containerExists

        public static boolean containerExists​(org.jclouds.blobstore.BlobStore blobStore,
                                              String container)
                                       throws IOException
        Check if a BlobStore specific container exists or not
        Throws:
        IOException
      • removeBlobs

        public static void removeBlobs​(org.jclouds.blobstore.BlobStore blobStore,
                                       String container,
                                       List blobNames)
                                throws IOException
        Delete a list of BlobStore blob
        Throws:
        IOException