Class JcloudsBlobStoreHelper
- java.lang.Object
-
- org.apache.camel.component.jclouds.JcloudsBlobStoreHelper
-
public final class JcloudsBlobStoreHelper extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearContainer(org.jclouds.blobstore.BlobStore blobStore, String container)Clear aBlobStorespecific containerstatic booleancontainerExists(org.jclouds.blobstore.BlobStore blobStore, String container)Check if aBlobStorespecific container exists or notstatic longcountBlob(org.jclouds.blobstore.BlobStore blobStore, String container)Return the count of all the blobs in the containerstatic voiddeleteContainer(org.jclouds.blobstore.BlobStore blobStore, String container)Delete aBlobStorespecific containerstatic voidensureContainerExists(org.jclouds.blobstore.BlobStore blobStore, String container, String locationId)Checks if container exists and creates one if not.static org.jclouds.domain.LocationgetLocationById(org.jclouds.blobstore.BlobStore blobStore, String locationId)Returns theLocationthat matches the locationId.static voidmkDirs(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName)Creates all directories that are part of the blobName.static InputStreamreadBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName)Reads from aBlobStore.static voidremoveBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName)Remove a specific blob from aBlobStorestatic voidremoveBlobs(org.jclouds.blobstore.BlobStore blobStore, String container, List blobNames)Delete a list ofBlobStoreblobstatic voidwriteBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName, org.jclouds.io.Payload payload)WritesPayloadto theBlobStore.
-
-
-
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- TheBlobStoreto 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 theLocationthat matches the locationId.
-
writeBlob
public static void writeBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName, org.jclouds.io.Payload payload)WritesPayloadto theBlobStore.
-
readBlob
public static InputStream readBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName) throws IOException
Reads from aBlobStore. It returns an Object.- Throws:
IOException
-
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 IOExceptionRemove a specific blob from aBlobStore- Throws:
IOException
-
clearContainer
public static void clearContainer(org.jclouds.blobstore.BlobStore blobStore, String container) throws IOExceptionClear aBlobStorespecific container- Throws:
IOException
-
deleteContainer
public static void deleteContainer(org.jclouds.blobstore.BlobStore blobStore, String container) throws IOExceptionDelete aBlobStorespecific container- Throws:
IOException
-
containerExists
public static boolean containerExists(org.jclouds.blobstore.BlobStore blobStore, String container) throws IOExceptionCheck if aBlobStorespecific container exists or not- Throws:
IOException
-
removeBlobs
public static void removeBlobs(org.jclouds.blobstore.BlobStore blobStore, String container, List blobNames) throws IOExceptionDelete a list ofBlobStoreblob- Throws:
IOException
-
-