Package org.jclouds.blobstore
Interface LocalStorageStrategy
-
- All Known Implementing Classes:
FilesystemStorageStrategyImpl,TransientStorageStrategy
public interface LocalStorageStrategyStrategy for local operations related to container and blob
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanblobExists(String container, String key)Return true if a blob named by key existsvoidclearContainer(String container)Empty the container of its content (files and subdirectories), but doesn't delete the container itselfvoidclearContainer(String container, ListContainerOptions options)LikeclearContainer(String)except you can use options to do things like recursive deletes, or clear at a different path than root.booleancontainerExists(String container)Checks if a container existsbooleancreateContainerInLocation(String container, Location location, CreateContainerOptions options)Creates a new containervoiddeleteContainer(String container)Deletes a container and all its contentCollection<String>getAllContainerNames()Return an iterator that reports all the containers under base pathBlobgetBlob(String containerName, String blobName)Load the blob with the given key belonging to the container with the given name.BlobAccessgetBlobAccess(String container, String key)Iterable<String>getBlobKeysInsideContainer(String container, String prefix)Returns all the blobs key inside a containerContainerAccessgetContainerAccess(String container)StorageMetadatagetContainerMetadata(String container)LocationgetLocation(String containerName)StringgetSeparator()StringputBlob(String containerName, Blob blob)Deprecated.StringputBlob(String containerName, Blob blob, BlobAccess access)Write aBlobinto a filevoidremoveBlob(String container, String key)Remove blob named by the given keyvoidsetBlobAccess(String container, String key, BlobAccess access)voidsetContainerAccess(String container, ContainerAccess access)
-
-
-
Method Detail
-
containerExists
boolean containerExists(String container)
Checks if a container exists- Parameters:
container-- Returns:
-
getAllContainerNames
Collection<String> getAllContainerNames()
Return an iterator that reports all the containers under base path- Returns:
-
createContainerInLocation
boolean createContainerInLocation(String container, Location location, CreateContainerOptions options)
Creates a new container- Parameters:
container-- Returns:
-
getContainerAccess
ContainerAccess getContainerAccess(String container)
-
setContainerAccess
void setContainerAccess(String container, ContainerAccess access)
-
deleteContainer
void deleteContainer(String container)
Deletes a container and all its content- Parameters:
container-
-
clearContainer
void clearContainer(String container)
Empty the container of its content (files and subdirectories), but doesn't delete the container itself- Parameters:
container-
-
clearContainer
void clearContainer(String container, ListContainerOptions options)
LikeclearContainer(String)except you can use options to do things like recursive deletes, or clear at a different path than root.- Parameters:
container- what to clearoptions- recursion and path to clear
-
getContainerMetadata
StorageMetadata getContainerMetadata(String container)
- Returns:
- StorageMetadata associated with a container name, e.g., creation date and location, or null if container does not exist
-
blobExists
boolean blobExists(String container, String key)
Return true if a blob named by key exists- Parameters:
container-key-- Returns:
-
getBlobKeysInsideContainer
Iterable<String> getBlobKeysInsideContainer(String container, String prefix) throws IOException
Returns all the blobs key inside a container- Parameters:
container-- Returns:
- Throws:
IOException
-
getBlob
Blob getBlob(String containerName, String blobName)
Load the blob with the given key belonging to the container with the given name. There must exist a resource on the file system whose complete name is given concatenating the container name and the key- Parameters:
container- it's the name of the container the blob belongs tokey- it's the key of the blob- Returns:
- the blob belonging to the given container with the given key
-
putBlob
@Deprecated String putBlob(String containerName, Blob blob) throws IOException
Deprecated.- Throws:
IOException
-
putBlob
String putBlob(String containerName, Blob blob, BlobAccess access) throws IOException
Write aBlobinto a file- Parameters:
container-blob-access-- Returns:
- etag of blob
- Throws:
IOException
-
removeBlob
void removeBlob(String container, String key)
Remove blob named by the given key- Parameters:
container-key-
-
getBlobAccess
BlobAccess getBlobAccess(String container, String key)
-
setBlobAccess
void setBlobAccess(String container, String key, BlobAccess access)
-
getLocation
Location getLocation(String containerName)
- Parameters:
containerName- name of container- Returns:
- Location of container or null
-
getSeparator
String getSeparator()
- Returns:
- path separator, either / or \
-
-