Package io.jmix.flowui.upload
Interface TemporaryStorage
- All Known Implementing Classes:
- TemporaryStorageImpl
public interface TemporaryStorage
API for uploading files to the temporary storage.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classstatic interfaceListener to be notified about the progress of uploading file into the temporary storage.
- 
Method SummaryModifier and TypeMethodDescriptionCreate a new empty temporary file and cache its ID for subsequent operations.voiddeleteFile(UUID fileId) Remove a file from the temporary storage.voiddeleteFileLink(String fileName) Remove an entry from the list of currently cached temporary file IDs, if such exists.Return a previously registered temporary file by its ID.putFileIntoStorage(UUID fileId, String fileName) Uploads a file from the temporary storage to the default FileStorage, which is determined by callingFileStorageLocator.getDefault().putFileIntoStorage(UUID fileId, String fileName, FileStorage fileStorage) Uploads a file from the temporary storage to the FileStorage.saveFile(byte[] data) Store the byte array in a new temporary file.saveFile(InputStream stream, TemporaryStorage.UploadProgressListener listener) Store the content of stream in a new temporary file.
- 
Method Details- 
saveFileStore the byte array in a new temporary file.- Parameters:
- data- file contents
- Returns:
- temporary file ID. This ID is cached in memory and can be used for subsequent operations.
 
- 
saveFileStore the content of stream in a new temporary file.- Parameters:
- stream- stream which content is to be stored
- listener- optional listener to be notified about storing progress
- Returns:
- temporary file ID. This ID is cached in memory and can be used for subsequent operations.
 
- 
createFileTemporaryStorage.FileInfo createFile()Create a new empty temporary file and cache its ID for subsequent operations.- Returns:
- the new temporary file ID
- Throws:
- FileStorageException- in case of IO problems
 
- 
getFileReturn a previously registered temporary file by its ID.- Parameters:
- fileId- temporary file ID
- Returns:
- temporary file object or null if no file registered under this ID
 
- 
deleteFileRemove a file from the temporary storage.
 This method is automatically called from putFileIntoStorage() when the file is successfully stored on the middleware.- Parameters:
- fileId- temporary file ID
- Throws:
- FileStorageException- in case of IO problems
 
- 
deleteFileLinkRemove an entry from the list of currently cached temporary file IDs, if such exists. This method is used by the framework when cleaning up the temp folder.- Parameters:
- fileName- absolute path to the temporary file
 
- 
putFileIntoStorageUploads a file from the temporary storage to the FileStorage.- Parameters:
- fileId- temporary file ID
- fileName- file name
- fileStorage- file storage
 
- 
putFileIntoStorageUploads a file from the temporary storage to the default FileStorage, which is determined by callingFileStorageLocator.getDefault().- Parameters:
- fileId- temporary file ID
- fileName- file name
 
 
-