Package org.jclouds.blobstore
Interface LocalStorageStrategy
- All Known Implementing Classes:
FilesystemStorageStrategyImpl
,TransientStorageStrategy
public interface LocalStorageStrategy
Strategy for local operations related to container and blob
-
Method Summary
Modifier and TypeMethodDescriptionboolean
blobExists
(String container, String key) Return true if a blob named by key existsvoid
clearContainer
(String container) Empty the container of its content (files and subdirectories), but doesn't delete the container itselfvoid
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.boolean
containerExists
(String container) Checks if a container existsboolean
createContainerInLocation
(String container, Location location, CreateContainerOptions options) Creates a new containervoid
deleteContainer
(String container) Deletes a container and all its contentReturn an iterator that reports all the containers under base pathLoad the blob with the given key belonging to the container with the given name.getBlobAccess
(String container, String key) getBlobKeysInsideContainer
(String container, String prefix, String delimiter) Returns all the blobs key inside a containergetContainerAccess
(String container) getContainerMetadata
(String container) getLocation
(String containerName) Deprecated.putBlob
(String containerName, Blob blob, BlobAccess access) Write aBlob
into a filevoid
removeBlob
(String container, String key) Remove blob named by the given keyvoid
setBlobAccess
(String container, String key, BlobAccess access) void
setContainerAccess
(String container, ContainerAccess access)
-
Method Details
-
containerExists
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
-
setContainerAccess
-
deleteContainer
Deletes a container and all its content- Parameters:
container
-
-
clearContainer
Empty the container of its content (files and subdirectories), but doesn't delete the container itself- Parameters:
container
-
-
clearContainer
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
- Returns:
- StorageMetadata associated with a container name, e.g., creation date and location, or null if container does not exist
-
blobExists
Return true if a blob named by key exists- Parameters:
container
-key
-- Returns:
-
getBlobKeysInsideContainer
Iterable<String> getBlobKeysInsideContainer(String container, String prefix, String delimiter) throws IOException Returns all the blobs key inside a container- Parameters:
container
-- Returns:
- Throws:
IOException
-
getBlob
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.- Throws:
IOException
-
putBlob
Write aBlob
into a file- Parameters:
blob
-access
-container
-- Returns:
- etag of blob
- Throws:
IOException
-
removeBlob
Remove blob named by the given key- Parameters:
container
-key
-
-
getBlobAccess
-
setBlobAccess
-
getLocation
- Parameters:
containerName
- name of container- Returns:
- Location of container or null
-
getSeparator
String getSeparator()- Returns:
- path separator, either / or \
-