public interface FileStorage extends Application.Module
Application.Component.LifecycleState| Modifier and Type | Method and Description |
|---|---|
void |
createFile(String id,
String filename,
InputStream bytes)
Store the bytes from this stream as a file with the specified ID and
filename.
|
boolean |
deleteFile(String id)
If a file exists with this ID, it will be deleted, regardless of the file
name.
|
String |
getFilename(String id)
If a file exists with this ID, get its name.
|
InputStream |
getInputStream(String id,
String filename)
Get a stream that will provide the contents of the file that was stored
with this ID and this filename.
|
shutdown, startupvoid createFile(String id, String filename, InputStream bytes) throws FileAlreadyExistsException, IOException
FileAlreadyExistsException - if a file already exists with this ID but with a different
filename.IOExceptionString getFilename(String id) throws IOException
null if it does not.IOExceptionInputStream getInputStream(String id, String filename) throws FileNotFoundException, IOException
FileNotFoundException - if there is no file that matches this ID and filename.IOExceptionboolean deleteFile(String id) throws IOException
true if a file existed, false otherwise.IOExceptionCopyright © 2016. All rights reserved.