org.jclouds.filesystem.strategy
Interface FilesystemStorageStrategy

All Known Implementing Classes:
FilesystemStorageStrategyImpl

public interface FilesystemStorageStrategy

Strategy for filesystem operations related to container and blob

Author:
Alfredo "Rainbowbreeze" Morresi

Method Summary
 boolean blobExists(String container, String key)
           
 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
 long countBlobs(String container, ListContainerOptions options)
          Counts number of blobs inside a container
 boolean createContainer(String container)
          Creates a new container
 void createDirectory(String container, String directory)
          Creates a folder or a directory marker depending on the service
 void deleteContainer(String container)
          Deletes a container and all its content
 void deleteDirectory(String container, String directory)
          Deletes a folder or a directory marker depending on the service
 boolean directoryExists(String container, String directory)
          Determines if a directory exists
 Iterable<String> getAllContainerNames()
          Return an iterator that reports all the containers under base path
 Iterable<String> getBlobKeysInsideContainer(String container)
          Returns all the blobs key inside a container
 File getFileForBlobKey(String container, String key)
          Returns a File object that links to the blob
 Blob newBlob(String name)
          Creates a new blob
 void removeBlob(String container, String key)
           
 void writePayloadOnFile(String container, String blobKey, Payload payload)
          Write a Blob Payload into a file
 

Method Detail

createContainer

boolean createContainer(String container)
Creates a new container

Parameters:
container -
Returns:

deleteContainer

void deleteContainer(String container)
Deletes a container and all its content

Parameters:
container -

containerExists

boolean containerExists(String container)
Checks if a container exists

Parameters:
container -
Returns:

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

getAllContainerNames

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

Returns:

directoryExists

boolean directoryExists(String container,
                        String directory)
Determines if a directory exists

Parameters:
container - container where the directory resides
directory - full path to the directory

createDirectory

void createDirectory(String container,
                     String directory)
Creates a folder or a directory marker depending on the service

Parameters:
container - container to create the directory in
directory - full path to the directory

deleteDirectory

void deleteDirectory(String container,
                     String directory)
Deletes a folder or a directory marker depending on the service

Parameters:
container - container to delete the directory from
directory - full path to the directory to delete

newBlob

Blob newBlob(String name)
Creates a new blob

Parameters:
name -
Returns:

blobExists

boolean blobExists(String container,
                   String key)
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

countBlobs

long countBlobs(String container,
                ListContainerOptions options)
Counts number of blobs inside a container

Parameters:
container -
options -
Returns:

getFileForBlobKey

File getFileForBlobKey(String container,
                       String key)
Returns a File object that links to the blob

Parameters:
container -
key -
Returns:

removeBlob

void removeBlob(String container,
                String key)
Parameters:
container -
key -

writePayloadOnFile

void writePayloadOnFile(String container,
                        String blobKey,
                        Payload payload)
                        throws IOException
Write a Blob Payload into a file

Parameters:
fileName -
payload -
Throws:
IOException


Copyright © 2009-2011 jclouds. All Rights Reserved.