Package com.persequor.extension.frontend
Interface IFileDownload
public interface IFileDownload
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Character encoding of the file content e.g.void
File namevoid
size
(long size) Size of the file in bytesvoid
File type as seen in official media types.void
write
(byte[] content) Write the string as the content, this will set the type to "application/octet-stream", and the size to the length of the byte arrayvoid
write
(io.ran.ThrowingConsumer<OutputStream, IOException> outputConsumer) Writes the binary contents of the file to an output streamvoid
Write the string as the content, this will set the type to "text/plain", and the size to the length of the string
-
Method Details
-
name
File name- Parameters:
nameWithExtension
- - name of the file, extension included
-
type
File type as seen in official media types.- Parameters:
type
- - media type of the file e.g. "application/pdf"
-
size
void size(long size) Size of the file in bytes- Parameters:
size
- - amount of bytes
-
charset
Character encoding of the file content e.g. StandardCharsets.UTF-8- Parameters:
charset
- - encoding
-
write
Writes the binary contents of the file to an output stream- Parameters:
outputConsumer
- - consumer to write the binary content into an output stream.
-
write
Write the string as the content, this will set the type to "text/plain", and the size to the length of the string- Parameters:
content
- - the string content
-
write
void write(byte[] content) Write the string as the content, this will set the type to "application/octet-stream", and the size to the length of the byte array- Parameters:
content
- - the binary content
-