Interface Storage
-
- All Known Implementing Classes:
CloudStorage,FileSystemStorage
public interface StorageStorage abstraction used when validating objects
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanfileExists(String filePath)Indicates if the file existsList<Listing>listDirectory(String directoryPath, boolean recursive)Return a list of all of the files an directories contained in the specified directory.InputStreamreadFile(String filePath)Streams the content of the specified file
-
-
-
Method Detail
-
listDirectory
List<Listing> listDirectory(String directoryPath, boolean recursive)
Return a list of all of the files an directories contained in the specified directory. An empty list is returned if the directory does not exist or has no children. If recursion is specified, then only leaf nodes are returned.- Parameters:
directoryPath- the path to the directory to listrecursive- if children should be recursively listed- Returns:
- list of children
-
fileExists
boolean fileExists(String filePath)
Indicates if the file exists- Parameters:
filePath- path to the file- Returns:
- true if it exists
-
readFile
InputStream readFile(String filePath)
Streams the content of the specified file- Parameters:
filePath- path to the file- Returns:
- input stream of file content
- Throws:
NotFoundException- when the file does not exist
-
-