Class AttachmentController

java.lang.Object
de.bytestore.hostinger.api.AttachmentController

@RestController @Configuration @RequestMapping("/internal/attachment") public class AttachmentController extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    AttachmentController(io.jmix.core.DataManager dataManager, io.jmix.core.FileStorage fileStorage)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    attatchmentGet(String id, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletRequest servletRequest)
    Retrieves the file associated with the provided ID and streams it to the response.

    Methods inherited from class java.lang.Object

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

    • AttachmentController

      public AttachmentController(io.jmix.core.DataManager dataManager, io.jmix.core.FileStorage fileStorage)
  • Method Details

    • attatchmentGet

      @GetMapping("/{id}") public void attatchmentGet(@PathVariable String id, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletRequest servletRequest) throws RuntimeException
      Retrieves the file associated with the provided ID and streams it to the response.
      Parameters:
      id - the ID of the attachment file to retrieve
      response - the HTTP response object
      servletRequest - the servlet request object
      Throws:
      RuntimeException - if an error occurs while retrieving or streaming the file