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 void
clearContainer(org.jclouds.blobstore.BlobStore blobStore, String container)
Clear aBlobStore
specific containerstatic boolean
containerExists(org.jclouds.blobstore.BlobStore blobStore, String container)
Check if aBlobStore
specific container exists or notstatic long
countBlob(org.jclouds.blobstore.BlobStore blobStore, String container)
Return the count of all the blobs in the containerstatic void
deleteContainer(org.jclouds.blobstore.BlobStore blobStore, String container)
Delete aBlobStore
specific containerstatic 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 theLocation
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 aBlobStore
.static void
removeBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName)
Remove a specific blob from aBlobStore
static void
removeBlobs(org.jclouds.blobstore.BlobStore blobStore, String container, List blobNames)
Delete a list ofBlobStore
blobstatic void
writeBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName, org.jclouds.io.Payload payload)
WritesPayload
to 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
- TheBlobStore
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 theLocation
that matches the locationId.
-
writeBlob
public static void writeBlob(org.jclouds.blobstore.BlobStore blobStore, String container, String blobName, org.jclouds.io.Payload payload)
WritesPayload
to 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 IOException
Remove a specific blob from aBlobStore
- Throws:
IOException
-
clearContainer
public static void clearContainer(org.jclouds.blobstore.BlobStore blobStore, String container) throws IOException
Clear aBlobStore
specific container- Throws:
IOException
-
deleteContainer
public static void deleteContainer(org.jclouds.blobstore.BlobStore blobStore, String container) throws IOException
Delete aBlobStore
specific container- Throws:
IOException
-
containerExists
public static boolean containerExists(org.jclouds.blobstore.BlobStore blobStore, String container) throws IOException
Check if aBlobStore
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 ofBlobStore
blob- Throws:
IOException
-
-