Class ExampleDownloadHandler

All Implemented Interfaces:
Handler, RouterNanoHTTPD.UriResponder

public class ExampleDownloadHandler extends BaseHandler
Default file download handler for 'web/html/files/view.html' templates.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • ExampleDownloadHandler

      public ExampleDownloadHandler(String entity)
    • ExampleDownloadHandler

      public ExampleDownloadHandler(String entity, String msg)
  • Method Details

    • readData

      public HandlerResponse readData(BeetRootHTTPSession session, int id) throws Exception
      Description copied from class: BaseHandler
      Read data from DB that must be filled when the template is parsed. Used by index and view handlers.
      Overrides:
      readData in class BaseHandler
      Parameters:
      session - HTTP session
      id - db record id > 0 if a single record should be read otherwise < 0;
      Returns:
      response or null, null means success, response's status must be checked!
      Throws:
      Exception - exception
    • getResource

      public String getResource()
      Description copied from class: BaseHandler
      Get web resource file as it lies on the file system relatively to the started server process.
      Specified by:
      getResource in interface Handler
      Specified by:
      getResource in class BaseHandler
      Returns:
      web resource