org.jclouds.blobstore
Interface LocalStorageStrategy

All Known Implementing Classes:
TransientStorageStrategy

public interface LocalStorageStrategy

Strategy for local operations related to container and blob

Author:
Alfredo "Rainbowbreeze" Morresi

Method Summary
 boolean blobExists(String container, String key)
          Return true if a blob named by key exists
 void clearContainer(String container)
          Empty the container of its content (files and subdirectories), but doesn't delete the container itself
 void clearContainer(String container, ListContainerOptions options)
          Like clearContainer(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 exists
 boolean createContainerInLocation(String container, org.jclouds.domain.Location location)
          Creates a new container
 void deleteContainer(String container)
          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 container)
          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 container, String key)
          Remove blob named by the given key
 

Method Detail

containerExists

boolean containerExists(String container)
Checks if a container exists

Parameters:
container -
Returns:

getAllContainerNames

Iterable<String> getAllContainerNames()
Return an iterator that reports all the containers under base path

Returns:

createContainerInLocation

boolean createContainerInLocation(String container,
                                  org.jclouds.domain.Location location)
Creates a new container

Parameters:
container -
Returns:

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)
Like clearContainer(String) except you can use options to do things like recursive deletes, or clear at a different path than root.

Parameters:
container - what to clear
options - recursion and path to clear

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)
                                            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 to
key - it's the key of the blob
Returns:
the blob belonging to the given container with the given key

putBlob

String putBlob(String containerName,
               Blob blob)
               throws IOException
Write a Blob into a file

Parameters:
container -
blob -
Returns:
etag of blob
Throws:
IOException

removeBlob

void removeBlob(String container,
                String key)
Remove blob named by the given key

Parameters:
container -
key -

getLocation

org.jclouds.domain.Location getLocation(String containerName)
Parameters:
containerName - name of container
Returns:
Location of container or null

getSeparator

String getSeparator()
Returns:
path separator, either / or \


Copyright © 2009-2012 jclouds. All Rights Reserved.