public class TreeStorageManager extends java.lang.Object implements StorageManager
Constructor and Description |
---|
TreeStorageManager() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(StorageManagerListener listener)
Receive notification of changes
|
org.rundeck.storage.api.Resource<ResourceMeta> |
createFileResource(java.lang.String path,
java.io.InputStream input,
java.util.Map<java.lang.String,java.lang.String> meta)
Create new resource, fails if it exists
|
static TreeStorageManager |
createFromStorageTree(StorageTree storageTree) |
boolean |
deleteAllFileResources(java.lang.String root)
Recursively delete all files from the root path
|
boolean |
deleteFileResource(java.lang.String path)
delete a resource
|
boolean |
existsDirResource(java.lang.String path) |
boolean |
existsFileResource(java.lang.String path) |
org.rundeck.storage.api.Resource<ResourceMeta> |
getFileResource(java.lang.String path)
Return config file contents
|
java.util.List<java.lang.String> |
listDirPaths(java.lang.String path)
List the full paths of file resources in the directory at the given path
|
java.util.List<java.lang.String> |
listDirPaths(java.lang.String path,
java.lang.String pattern)
List the full paths of file and dir resources in the directory at the given path,
dir resources will end with "/"
|
long |
loadFileResource(java.lang.String path,
java.io.OutputStream output)
Read the contents of a file at the path into the outputstream
|
void |
removeListener(StorageManagerListener listener)
Remove a listener
|
org.rundeck.storage.api.Resource<ResourceMeta> |
updateFileResource(java.lang.String path,
java.io.InputStream input,
java.util.Map<java.lang.String,java.lang.String> meta)
Update existing resource, fails if it does not exist
|
org.rundeck.storage.api.Resource<ResourceMeta> |
writeFileResource(java.lang.String path,
java.io.InputStream input,
java.util.Map<java.lang.String,java.lang.String> meta)
Write to a resource, create if it does not exist
|
public void addListener(StorageManagerListener listener)
StorageManager
addListener
in interface StorageManager
public void removeListener(StorageManagerListener listener)
StorageManager
removeListener
in interface StorageManager
public boolean existsFileResource(java.lang.String path)
existsFileResource
in interface StorageManager
public boolean existsDirResource(java.lang.String path)
existsDirResource
in interface StorageManager
public java.util.List<java.lang.String> listDirPaths(java.lang.String path)
listDirPaths
in interface StorageManager
path
- path directory pathpublic java.util.List<java.lang.String> listDirPaths(java.lang.String path, java.lang.String pattern)
listDirPaths
in interface StorageManager
path
- path directory pathpattern
- pattern matchpublic org.rundeck.storage.api.Resource<ResourceMeta> getFileResource(java.lang.String path)
getFileResource
in interface StorageManager
path
- public long loadFileResource(java.lang.String path, java.io.OutputStream output) throws java.io.IOException
StorageManager
loadFileResource
in interface StorageManager
java.io.IOException
public org.rundeck.storage.api.Resource<ResourceMeta> updateFileResource(java.lang.String path, java.io.InputStream input, java.util.Map<java.lang.String,java.lang.String> meta)
updateFileResource
in interface StorageManager
path
- pathinput
- streammeta
- metadatapublic org.rundeck.storage.api.Resource<ResourceMeta> createFileResource(java.lang.String path, java.io.InputStream input, java.util.Map<java.lang.String,java.lang.String> meta)
createFileResource
in interface StorageManager
path
- pathinput
- streammeta
- metadatapublic org.rundeck.storage.api.Resource<ResourceMeta> writeFileResource(java.lang.String path, java.io.InputStream input, java.util.Map<java.lang.String,java.lang.String> meta)
writeFileResource
in interface StorageManager
path
- pathinput
- streammeta
- metadatapublic boolean deleteFileResource(java.lang.String path)
deleteFileResource
in interface StorageManager
path
- pathpublic boolean deleteAllFileResources(java.lang.String root)
deleteAllFileResources
in interface StorageManager
root
- root pathpublic static TreeStorageManager createFromStorageTree(StorageTree storageTree)