Class FileBackedBinaryFactory
java.lang.Object
ch.tocco.nice2.persist.core.impl.bin.FileBackedBinaryFactory
- All Implemented Interfaces:
BinaryFactory
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFileBackedBinaryFactory
(org.slf4j.Logger log, DataSource dataSource, BinaryAccessProvider binaryAccessProvider, BinaryHashingService binaryHashingService) -
Method Summary
Modifier and TypeMethodDescriptionloadBinary
(com.google.common.hash.HashCode hash) newBinary
(InputStream source, String fileName) create a binary from an InputStreamnewBinary
(Function<OutputStream, Void> func, String fileName) write data to a OutputStreamvoid
-
Field Details
-
TMP_FILE_PREFIX
- See Also:
-
TMP_FILE_SUFFIX
- See Also:
-
-
Constructor Details
-
FileBackedBinaryFactory
public FileBackedBinaryFactory(org.slf4j.Logger log, DataSource dataSource, BinaryAccessProvider binaryAccessProvider, BinaryHashingService binaryHashingService)
-
-
Method Details
-
getTmpDir
-
setTmpDir
-
newBinary
Description copied from interface:BinaryFactory
write data to a OutputStream- Specified by:
newBinary
in interfaceBinaryFactory
- Parameters:
func
- function which fills data into the OutputStreamfileName
- file name is required for optimal mime-type detection- Throws:
IOException
-
newBinary
Description copied from interface:BinaryFactory
create a binary from an InputStream- Specified by:
newBinary
in interfaceBinaryFactory
- Parameters:
fileName
- file name is required for optimal mime-type detection- Throws:
IOException
-
newBinary
- Specified by:
newBinary
in interfaceBinaryFactory
- Parameters:
fileName
- file name is required for optimal mime-type detection- Throws:
IOException
-
newBinary
- Specified by:
newBinary
in interfaceBinaryFactory
- Parameters:
fileName
- file name is required for optimal mime-type detection- Throws:
IOException
-
loadBinary
- Specified by:
loadBinary
in interfaceBinaryFactory
-