Package com.storedobject.common
Interface BinaryContentGenerator
- All Superinterfaces:
ContentGenerator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Anything that generates some sort of binary "content".
- Author:
- Syam
-
Field Summary
Fields inherited from interface com.storedobject.common.ContentGenerator
ext -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateContent(OutputStream output) Generate the content and write to an output stream.default StringMime type of the content.default StringFile extension normally used for this type of content.
-
Method Details
-
generateContent
Generate the content and write to an output stream.- Parameters:
output- Output stream to collect the generated content.- Throws:
Exception- if content can not be generated.
-
getContentType
Mime type of the content.- Specified by:
getContentTypein interfaceContentGenerator- Returns:
- Default implementation returns "application/octet-stream".
-
getFileExtension
File extension normally used for this type of content.- Specified by:
getFileExtensionin interfaceContentGenerator- Returns:
- Default implementation returns "bin".
-