Package org.jclouds.blobstore
Class TransientStorageStrategy
- java.lang.Object
-
- org.jclouds.blobstore.TransientStorageStrategy
-
- All Implemented Interfaces:
LocalStorageStrategy
public class TransientStorageStrategy extends Object implements LocalStorageStrategy
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
blobExists(String containerName, String blobName)
Return true if a blob named by key existsvoid
clearContainer(String containerName)
Empty the container of its content (files and subdirectories), but doesn't delete the container itselfvoid
clearContainer(String containerName, ListContainerOptions options)
LikeLocalStorageStrategy.clearContainer(String)
except you can use options to do things like recursive deletes, or clear at a different path than root.boolean
containerExists(String containerName)
Checks if a container existsboolean
createContainerInLocation(String containerName, Location location, CreateContainerOptions options)
Creates a new containervoid
deleteContainer(String containerName)
Deletes a container and all its contentCollection<String>
getAllContainerNames()
Return an iterator that reports all the containers under base pathBlob
getBlob(String containerName, String blobName)
Load the blob with the given key belonging to the container with the given name.BlobAccess
getBlobAccess(String containerName, String blobName)
Iterable<String>
getBlobKeysInsideContainer(String containerName, String prefix)
Returns all the blobs key inside a containerContainerAccess
getContainerAccess(String container)
StorageMetadata
getContainerMetadata(String container)
Location
getLocation(String containerName)
String
getSeparator()
String
putBlob(String containerName, Blob blob)
String
putBlob(String containerName, Blob blob, BlobAccess access)
Write aBlob
into a filevoid
removeBlob(String containerName, String blobName)
Remove blob named by the given keyvoid
setBlobAccess(String containerName, String blobName, BlobAccess access)
void
setContainerAccess(String container, ContainerAccess access)
-
-
-
Method Detail
-
containerExists
public boolean containerExists(String containerName)
Description copied from interface:LocalStorageStrategy
Checks if a container exists- Specified by:
containerExists
in interfaceLocalStorageStrategy
- Returns:
-
getAllContainerNames
public Collection<String> getAllContainerNames()
Description copied from interface:LocalStorageStrategy
Return an iterator that reports all the containers under base path- Specified by:
getAllContainerNames
in interfaceLocalStorageStrategy
- Returns:
-
createContainerInLocation
public boolean createContainerInLocation(String containerName, Location location, CreateContainerOptions options)
Description copied from interface:LocalStorageStrategy
Creates a new container- Specified by:
createContainerInLocation
in interfaceLocalStorageStrategy
- Returns:
-
getContainerAccess
public ContainerAccess getContainerAccess(String container)
- Specified by:
getContainerAccess
in interfaceLocalStorageStrategy
-
setContainerAccess
public void setContainerAccess(String container, ContainerAccess access)
- Specified by:
setContainerAccess
in interfaceLocalStorageStrategy
-
deleteContainer
public void deleteContainer(String containerName)
Description copied from interface:LocalStorageStrategy
Deletes a container and all its content- Specified by:
deleteContainer
in interfaceLocalStorageStrategy
-
clearContainer
public void clearContainer(String containerName)
Description copied from interface:LocalStorageStrategy
Empty the container of its content (files and subdirectories), but doesn't delete the container itself- Specified by:
clearContainer
in interfaceLocalStorageStrategy
-
clearContainer
public void clearContainer(String containerName, ListContainerOptions options)
Description copied from interface:LocalStorageStrategy
LikeLocalStorageStrategy.clearContainer(String)
except you can use options to do things like recursive deletes, or clear at a different path than root.- Specified by:
clearContainer
in interfaceLocalStorageStrategy
- Parameters:
containerName
- what to clearoptions
- recursion and path to clear
-
getContainerMetadata
public StorageMetadata getContainerMetadata(String container)
- Specified by:
getContainerMetadata
in interfaceLocalStorageStrategy
- Returns:
- StorageMetadata associated with a container name, e.g., creation date and location, or null if container does not exist
-
blobExists
public boolean blobExists(String containerName, String blobName)
Description copied from interface:LocalStorageStrategy
Return true if a blob named by key exists- Specified by:
blobExists
in interfaceLocalStorageStrategy
- Returns:
-
getBlobKeysInsideContainer
public Iterable<String> getBlobKeysInsideContainer(String containerName, String prefix)
Description copied from interface:LocalStorageStrategy
Returns all the blobs key inside a container- Specified by:
getBlobKeysInsideContainer
in interfaceLocalStorageStrategy
- Returns:
-
getBlob
public Blob getBlob(String containerName, String blobName)
Description copied from interface:LocalStorageStrategy
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- Specified by:
getBlob
in interfaceLocalStorageStrategy
- Returns:
- the blob belonging to the given container with the given key
-
putBlob
public String putBlob(String containerName, Blob blob) throws IOException
- Specified by:
putBlob
in interfaceLocalStorageStrategy
- Throws:
IOException
-
putBlob
public String putBlob(String containerName, Blob blob, BlobAccess access) throws IOException
Description copied from interface:LocalStorageStrategy
Write aBlob
into a file- Specified by:
putBlob
in interfaceLocalStorageStrategy
- Returns:
- etag of blob
- Throws:
IOException
-
removeBlob
public void removeBlob(String containerName, String blobName)
Description copied from interface:LocalStorageStrategy
Remove blob named by the given key- Specified by:
removeBlob
in interfaceLocalStorageStrategy
-
getBlobAccess
public BlobAccess getBlobAccess(String containerName, String blobName)
- Specified by:
getBlobAccess
in interfaceLocalStorageStrategy
-
setBlobAccess
public void setBlobAccess(String containerName, String blobName, BlobAccess access)
- Specified by:
setBlobAccess
in interfaceLocalStorageStrategy
-
getLocation
public Location getLocation(String containerName)
- Specified by:
getLocation
in interfaceLocalStorageStrategy
- Parameters:
containerName
- name of container- Returns:
- Location of container or null
-
getSeparator
public String getSeparator()
- Specified by:
getSeparator
in interfaceLocalStorageStrategy
- Returns:
- path separator, either / or \
-
-