
org.rundeck.storage.api.Tree Maven / Gradle / Ivy
package org.rundeck.storage.api;
import java.util.Set;
/**
* Stores content in a hierarchy
*/
public interface Tree {
/**
* Return true if the path exists
*
* @param path path
*
* @return true if it exists
*/
boolean hasPath(Path path);
boolean hasPath(String path);
/**
* Return true if a resource at the path exists
*
* @param path path
*
* @return true if a resource exists
*/
boolean hasResource(Path path);
boolean hasResource(String path);
/**
* Return true if a directory at the path exists
*
* @param path path
*
* @return true if the path is a directory
*/
boolean hasDirectory(Path path);
boolean hasDirectory(String path);
/**
* Return the resource or directory at the path
*
* @param path path
*
* @return Resource or directory
*/
Resource getPath(Path path);
Resource getPath(String path);
/**
* Return the resource at the path
*
* @param path path
*
* @return Resource
* @throws IllegalArgumentException if the path is a directory or does not exist
*/
Resource getResource(Path path);
Resource getResource(String path);
/**
* Return the set of non-directory resources at the directory path
*
* @param path path
*
* @return set of resources
*/
Set> listDirectoryResources(Path path);
Set> listDirectoryResources(String path);
/**
* Return the set of resources at the directory path
*
* @param path path
*
* @return set of resources
*/
Set> listDirectory(Path path);
Set> listDirectory(String path);
/**
* Return the set of sub directory resources within the directory path
*
* @param path directory path
*
* @return set of subdirectories
*/
Set> listDirectorySubdirs(Path path);
Set> listDirectorySubdirs(String path);
/**
* Delete a resource at a path
*
* @param path path
*
* @return true if the resource was deleted
* @throws IllegalArgumentException if the path is a directory or does not exist
*/
boolean deleteResource(Path path);
boolean deleteResource(String path);
/**
* Create a resource
*
* @param path path
*
* @return the resource
* @throws IllegalArgumentException if the path is a directory
*/
Resource createResource(Path path, T content);
Resource createResource(String path, T content);
/**
* Update an existing resource
*
* @param path path
*
* @return the resource
* @throws IllegalArgumentException if the path is a directory or does not exist
*/
Resource updateResource(Path path, T content);
Resource updateResource(String path, T content);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy