Class DefaultPromptFileStorage
- java.lang.Object
-
- de.xima.fc.prompt.service.defaults.DefaultPromptFileStorage
-
public final class DefaultPromptFileStorage extends Object
Default implementations ofIPromptFileStorage.- Since:
- 8.5.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IPromptFileStorageofFileCreator(ISerializableThrowingSupplier<Path> fileCreator)Creates a newIPromptFileStoragethat uses the given file creator to create (temporary) files on the file system that will be used to store the binary data.static IPromptFileStorageofInMemory()Creates a newIPromptFileStoragethat stores all binary data in memory.
-
-
-
Method Detail
-
ofFileCreator
public static IPromptFileStorage ofFileCreator(ISerializableThrowingSupplier<Path> fileCreator)
Creates a newIPromptFileStoragethat uses the given file creator to create (temporary) files on the file system that will be used to store the binary data. The caller is responsible for cleaning up the created files.- Parameters:
fileCreator- The temporary file creator to use.- Returns:
- A new
IPromptFileStorageinstance.
-
ofInMemory
public static IPromptFileStorage ofInMemory()
Creates a newIPromptFileStoragethat stores all binary data in memory. Use with caution, as this may lead to high memory consumption if large files are stored.- Returns:
- A new
IPromptFileStorageinstance.
-
-