Interface FileStorage
-
- All Implemented Interfaces:
public interface FileStorageA storage for files, like a local directory or a remote server.
-
-
Method Summary
Modifier and Type Method Description abstract Booleanexists(String path)Return whether the given path exists or not. abstract InputStreamread(String path)Read the file at path. abstract Unitwrite(String path, InputStream inputStream)Write the data from inputStream to the file at path. abstract Booleandelete(String path)Delete the file at the given path and return whether the operation was successful. -
-
Method Detail
-
read
abstract InputStream read(String path)
Read the file at path. It is the caller's responsibility to close the returned InputStream after consuming it.
-
write
abstract Unit write(String path, InputStream inputStream)
Write the data from inputStream to the file at path. If the file already exists it is overwritten. The provided inputStream is closed after writing it to the file.
-
-
-
-