Package ee.datel.dogis.utils
Class ContentDispositionSender
java.lang.Object
ee.datel.dogis.utils.ContentDispositionSender
Send response as Content Disposition service.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.io.ResourcesendAsAttachment(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension, String extension, String mimeType) Sends a file as attachment.org.springframework.core.io.ResourcesendAsInline(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension, String extension, String mimeType) Sends a file as inline.org.springframework.core.io.ResourceSends PDF file as inline.
-
Field Details
-
XLSX_MIME_TYPE
Excel MIME type.- See Also:
-
-
Constructor Details
-
ContentDispositionSender
public ContentDispositionSender()
-
-
Method Details
-
sendPdf
public org.springframework.core.io.Resource sendPdf(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension) Sends PDF file as inline.- Parameters:
response- servlet responsefile- PDF filenameWoExtension- send as file name w.o. extension- Returns:
- resource
-
sendAsInline
public org.springframework.core.io.Resource sendAsInline(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension, String extension, String mimeType) Sends a file as inline.- Parameters:
response- servlet responsefile- file pathnameWoExtension- send file name w.o. extensionextension- file extensionmimeType- mime type- Returns:
- resource
-
sendAsAttachment
public org.springframework.core.io.Resource sendAsAttachment(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension, String extension, String mimeType) Sends a file as attachment.- Parameters:
response- servlet responsefile- file pathnameWoExtension- send file name w.o. extensionextension- file extensionmimeType- mime type- Returns:
- resource
-