com.vaadin.flow.server.

Interface StaticFileHandler

  • All Superinterfaces:

    Serializable

    All Known Implementing Classes:

    StaticFileServer


    public interface StaticFileHandler
    extends Serializable

    Handler for static files. The handler should be responsible in identifying and serving the static files, based on the servlet request.

    Since:

    1.3

    Author:

    Vaadin Ltd.

    See Also:

    StaticFileServer

    • Method Summary

      All Methods
      Modifier and Type Method and Description
      boolean isStaticResourceRequest(HttpServletRequest request)

      Checks if a static resource can be found for the requested path.

      boolean serveStaticResource(HttpServletRequest request, HttpServletResponse response)

      Serves a static resource for the requested path if a resource can be found.

    • Method Detail

      • isStaticResourceRequest

        boolean isStaticResourceRequest(HttpServletRequest request)

        Checks if a static resource can be found for the requested path.

        Parameters:

        request - the request to check

        Returns:

        true if a static resource exists and can be sent as a response to this request, false otherwise

      • serveStaticResource

        boolean serveStaticResource(HttpServletRequest request,
                                    HttpServletResponse response)
                             throws IOException

        Serves a static resource for the requested path if a resource can be found.

        Parameters:

        request - the request object to read from

        response - the response object to write to

        Returns:

        true if a file was served and the request has been handled, false otherwise.

        Throws:

        IOException - if the underlying servlet container reports an exception