org.jclouds.blobstore
Class TransientStorageStrategy

java.lang.Object
  extended by org.jclouds.blobstore.TransientStorageStrategy
All Implemented Interfaces:
LocalStorageStrategy

public class TransientStorageStrategy
extends Object
implements LocalStorageStrategy


Method Summary
 boolean blobExists(String containerName, String blobName)
          Return true if a blob named by key exists
 void clearContainer(String containerName)
          Empty the container of its content (files and subdirectories), but doesn't delete the container itself
 void clearContainer(String containerName, ListContainerOptions options)
          Like LocalStorageStrategy.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 exists
 boolean createContainerInLocation(String containerName, org.jclouds.domain.Location location)
          Creates a new container
 void deleteContainer(String containerName)
          Deletes a container and all its content
 Iterable<String> getAllContainerNames()
          Return an iterator that reports all the containers under base path
 Blob getBlob(String containerName, String blobName)
          Load the blob with the given key belonging to the container with the given name.
 Iterable<String> getBlobKeysInsideContainer(String containerName)
          Returns all the blobs key inside a container
 org.jclouds.domain.Location getLocation(String containerName)
           
 String getSeparator()
           
 String putBlob(String containerName, Blob blob)
          Write a Blob into a file
 void removeBlob(String containerName, String blobName)
          Remove blob named by the given key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

containerExists

public boolean containerExists(String containerName)
Description copied from interface: LocalStorageStrategy
Checks if a container exists

Specified by:
containerExists in interface LocalStorageStrategy
Returns:

getAllContainerNames

public Iterable<String> getAllContainerNames()
Description copied from interface: LocalStorageStrategy
Return an iterator that reports all the containers under base path

Specified by:
getAllContainerNames in interface LocalStorageStrategy
Returns:

createContainerInLocation

public boolean createContainerInLocation(String containerName,
                                         org.jclouds.domain.Location location)
Description copied from interface: LocalStorageStrategy
Creates a new container

Specified by:
createContainerInLocation in interface LocalStorageStrategy
Returns:

deleteContainer

public void deleteContainer(String containerName)
Description copied from interface: LocalStorageStrategy
Deletes a container and all its content

Specified by:
deleteContainer in interface LocalStorageStrategy

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 interface LocalStorageStrategy

clearContainer

public void clearContainer(String containerName,
                           ListContainerOptions options)
Description copied from interface: LocalStorageStrategy
Like LocalStorageStrategy.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 interface LocalStorageStrategy
Parameters:
containerName - what to clear
options - recursion and path to clear

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 interface LocalStorageStrategy
Returns:

getBlobKeysInsideContainer

public Iterable<String> getBlobKeysInsideContainer(String containerName)
Description copied from interface: LocalStorageStrategy
Returns all the blobs key inside a container

Specified by:
getBlobKeysInsideContainer in interface LocalStorageStrategy
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 interface LocalStorageStrategy
Returns:
the blob belonging to the given container with the given key

putBlob

public String putBlob(String containerName,
                      Blob blob)
               throws IOException
Description copied from interface: LocalStorageStrategy
Write a Blob into a file

Specified by:
putBlob in interface LocalStorageStrategy
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 interface LocalStorageStrategy

getLocation

public org.jclouds.domain.Location getLocation(String containerName)
Specified by:
getLocation in interface LocalStorageStrategy
Parameters:
containerName - name of container
Returns:
Location of container or null

getSeparator

public String getSeparator()
Specified by:
getSeparator in interface LocalStorageStrategy
Returns:
path separator, either / or \


Copyright © 2009-2012 jclouds. All Rights Reserved.