|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jclouds.filesystem.strategy.internal.FilesystemStorageStrategyImpl
public class FilesystemStorageStrategyImpl
Field Summary | |
---|---|
protected String |
baseDirectory
|
protected javax.inject.Provider<BlobBuilder> |
blobBuilders
|
protected FilesystemBlobKeyValidator |
filesystemBlobKeyValidator
|
protected FilesystemContainerNameValidator |
filesystemContainerNameValidator
|
protected Logger |
logger
|
Constructor Summary | |
---|---|
protected |
FilesystemStorageStrategyImpl(javax.inject.Provider<BlobBuilder> blobBuilders,
String baseDir,
FilesystemContainerNameValidator filesystemContainerNameValidator,
FilesystemBlobKeyValidator filesystemBlobKeyValidator)
|
Method Summary | |
---|---|
boolean |
blobExists(String container,
String key)
|
protected String |
buildPathStartingFromBaseDir(String... pathTokens)
Facility method used to concatenate path tokens normalizing separators |
void |
clearContainer(String container)
Empty the directory of its content (files and subdirectories) |
void |
clearContainer(String container,
ListContainerOptions options)
Like FilesystemStorageStrategy.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 |
protected boolean |
createDirectoryWithResult(String container,
String directory)
Creates a directory and returns the result |
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 blobKey)
Returns a File object that links to the blob |
Blob |
newBlob(String name)
Creates a new blob |
void |
removeBlob(String container,
String blobKey)
|
void |
writePayloadOnFile(String container,
String blobKey,
Payload payload)
Write a Blob Payload into a file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Logger logger
protected final javax.inject.Provider<BlobBuilder> blobBuilders
protected final String baseDirectory
protected final FilesystemContainerNameValidator filesystemContainerNameValidator
protected final FilesystemBlobKeyValidator filesystemBlobKeyValidator
Constructor Detail |
---|
@Inject protected FilesystemStorageStrategyImpl(javax.inject.Provider<BlobBuilder> blobBuilders, @Named(value="jclouds.filesystem.basedir") String baseDir, FilesystemContainerNameValidator filesystemContainerNameValidator, FilesystemBlobKeyValidator filesystemBlobKeyValidator)
Method Detail |
---|
public boolean containerExists(String container)
FilesystemStorageStrategy
containerExists
in interface FilesystemStorageStrategy
public boolean blobExists(String container, String key)
blobExists
in interface FilesystemStorageStrategy
public boolean createContainer(String container)
FilesystemStorageStrategy
createContainer
in interface FilesystemStorageStrategy
public void deleteContainer(String container)
FilesystemStorageStrategy
deleteContainer
in interface FilesystemStorageStrategy
public void clearContainer(String container)
clearContainer
in interface FilesystemStorageStrategy
container
- public void clearContainer(String container, ListContainerOptions options)
FilesystemStorageStrategy
FilesystemStorageStrategy.clearContainer(String)
except you can use options to do things like recursive
deletes, or clear at a different path than root.
clearContainer
in interface FilesystemStorageStrategy
container
- what to clearoptions
- recursion and path to clearpublic Blob newBlob(String name)
FilesystemStorageStrategy
newBlob
in interface FilesystemStorageStrategy
public void removeBlob(String container, String blobKey)
removeBlob
in interface FilesystemStorageStrategy
public Iterable<String> getAllContainerNames()
getAllContainerNames
in interface FilesystemStorageStrategy
public File getFileForBlobKey(String container, String blobKey)
File
object that links to the blob
getFileForBlobKey
in interface FilesystemStorageStrategy
container
- blobKey
-
public void writePayloadOnFile(String container, String blobKey, Payload payload) throws IOException
Blob
Payload
into a file
writePayloadOnFile
in interface FilesystemStorageStrategy
container
- blobKey
- payload
-
IOException
public Iterable<String> getBlobKeysInsideContainer(String container) throws IOException
getBlobKeysInsideContainer
in interface FilesystemStorageStrategy
container
-
IOException
public boolean directoryExists(String container, String directory)
FilesystemStorageStrategy
directoryExists
in interface FilesystemStorageStrategy
container
- container where the directory residesdirectory
- full path to the directorypublic void createDirectory(String container, String directory)
FilesystemStorageStrategy
createDirectory
in interface FilesystemStorageStrategy
container
- container to create the directory indirectory
- full path to the directorypublic void deleteDirectory(String container, String directory)
FilesystemStorageStrategy
deleteDirectory
in interface FilesystemStorageStrategy
container
- container to delete the directory fromdirectory
- full path to the directory to deletepublic long countBlobs(String container, ListContainerOptions options)
FilesystemStorageStrategy
countBlobs
in interface FilesystemStorageStrategy
protected String buildPathStartingFromBaseDir(String... pathTokens)
pathTokens
- all the string in the proper order that must be concatenated in order to obtain the
filename
protected boolean createDirectoryWithResult(String container, String directory)
container
- directory
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |