public interface TemporaryStorage
Modifier and Type | Interface and Description |
---|---|
static class |
TemporaryStorage.FileInfo |
static interface |
TemporaryStorage.UploadProgressListener
Listener to be notified about the progress of uploading file into the temporary storage.
|
Modifier and Type | Method and Description |
---|---|
TemporaryStorage.FileInfo |
createFile()
Create a new empty temporary file and cache its ID for subsequent operations.
|
void |
deleteFile(java.util.UUID fileId)
Remove a file from the temporary storage.
|
void |
deleteFileLink(java.lang.String fileName)
Remove an entry from the list of currently cached temporary file IDs, if such exists.
|
java.io.File |
getFile(java.util.UUID fileId)
Return a previously registered temporary file by its ID.
|
io.jmix.core.FileRef |
putFileIntoStorage(java.util.UUID fileId,
java.lang.String fileName)
Uploads a file from the temporary storage to the default FileStorage,
which is determined by calling
FileStorageLocator.getDefault() . |
io.jmix.core.FileRef |
putFileIntoStorage(java.util.UUID fileId,
java.lang.String fileName,
io.jmix.core.FileStorage fileStorage)
Uploads a file from the temporary storage to the FileStorage.
|
java.util.UUID |
saveFile(byte[] data)
Store the byte array in a new temporary file.
|
java.util.UUID |
saveFile(java.io.InputStream stream,
TemporaryStorage.UploadProgressListener listener)
Store the content of stream in a new temporary file.
|
java.util.UUID saveFile(byte[] data)
data
- file contentsjava.util.UUID saveFile(java.io.InputStream stream, @Nullable TemporaryStorage.UploadProgressListener listener)
stream
- stream which content is to be storedlistener
- optional listener to be notified about storing progressTemporaryStorage.FileInfo createFile()
io.jmix.core.FileStorageException
- in case of IO problems@Nullable java.io.File getFile(java.util.UUID fileId)
fileId
- temporary file IDvoid deleteFile(java.util.UUID fileId)
fileId
- temporary file IDio.jmix.core.FileStorageException
- in case of IO problemsvoid deleteFileLink(java.lang.String fileName)
fileName
- absolute path to the temporary fileio.jmix.core.FileRef putFileIntoStorage(java.util.UUID fileId, java.lang.String fileName, io.jmix.core.FileStorage fileStorage)
fileId
- temporary file IDfileName
- file namefileStorage
- file storageio.jmix.core.FileRef putFileIntoStorage(java.util.UUID fileId, java.lang.String fileName)
FileStorageLocator.getDefault()
.fileId
- temporary file IDfileName
- file name