Package io.jmix.ui.download
Class ByteArrayDataProvider
java.lang.Object
io.jmix.ui.download.ByteArrayDataProvider
- All Implemented Interfaces:
DownloadDataProvider
Provides data for
Downloader
from a byte array.-
Constructor Summary
ConstructorDescriptionByteArrayDataProvider
(byte[] data, int saveExportedByteArrayDataThresholdBytes, String tempDir) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprovide()
protected InputStream
readFromTempStorage
(File file) protected File
saveToTempStorage
(byte[] data, String tempDir)
-
Constructor Details
-
ByteArrayDataProvider
public ByteArrayDataProvider(byte[] data, int saveExportedByteArrayDataThresholdBytes, String tempDir) Constructor.- Parameters:
data
- byte arraysaveExportedByteArrayDataThresholdBytes
- threshold in bytes on which downloaded byte array will be saved to a temporary file to prevent HTTP session memory leaks. UseUiProperties.getSaveExportedByteArrayDataThresholdBytes()
.tempDir
- where to store the temporary file ifsaveExportedByteArrayDataThresholdBytes
is exceeded. UseCoreProperties.getTempDir()
.
-
-
Method Details
-
saveToTempStorage
-
readFromTempStorage
-
provide
- Specified by:
provide
in interfaceDownloadDataProvider
-