public interface FileStorage
Modifier and Type | Method and Description |
---|---|
boolean |
fileExists(FileRef reference)
Tests whether the file denoted by this file reference exists.
|
java.lang.String |
getStorageName()
Returns the name of this storage, which will be saved in
FileRef s. |
java.io.InputStream |
openStream(FileRef reference)
Return an input stream to load a file contents.
|
void |
removeFile(FileRef reference)
Removes a file from the file storage.
|
FileRef |
saveStream(java.lang.String fileName,
java.io.InputStream inputStream)
Saves an InputStream contents into file storage.
|
java.lang.String getStorageName()
FileRef
s.
Each file storage in the application should have a unique name.
FileRef saveStream(java.lang.String fileName, java.io.InputStream inputStream)
fileName
- file nameinputStream
- input stream, must be closed in the calling codejava.lang.IllegalArgumentException
- if arguments are incorrectFileStorageException
- if something goes wrongjava.io.InputStream openStream(FileRef reference)
reference
- file referencejava.lang.IllegalArgumentException
- if arguments are incorrectFileStorageException
- if something goes wrongvoid removeFile(FileRef reference)
reference
- file referencejava.lang.IllegalArgumentException
- if file reference is invalidboolean fileExists(FileRef reference)
reference
- file referencejava.lang.IllegalArgumentException
- if file reference is invalid