Class ContentDispositionSender

java.lang.Object
ee.datel.dogis.utils.ContentDispositionSender

@Service public class ContentDispositionSender extends Object
Send response as Content Disposition service.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Excel MIME type.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.core.io.Resource
    sendAsAttachment(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension, String extension, String mimeType)
    Sends a file as attachment.
    org.springframework.core.io.Resource
    sendAsInline(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension, String extension, String mimeType)
    Sends a file as inline.
    org.springframework.core.io.Resource
    sendPdf(jakarta.servlet.http.HttpServletResponse response, Path file, String nameWoExtension)
    Sends PDF file as inline.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 response
      file - PDF file
      nameWoExtension - 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 response
      file - file path
      nameWoExtension - send file name w.o. extension
      extension - file extension
      mimeType - 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 response
      file - file path
      nameWoExtension - send file name w.o. extension
      extension - file extension
      mimeType - mime type
      Returns:
      resource