com.vaadin.flow.server.
Interface StaticFileHandler
-
All Superinterfaces:
All Known Implementing Classes:
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.
Author:
Vaadin Ltd.
See Also:
-
-
Method Summary
All Methods Modifier and Type Method and Description boolean
isStaticResourceRequest(javax.servlet.http.HttpServletRequest request)
Checks if a static resource can be found for the requested path.
boolean
serveStaticResource(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Serves a static resource for the requested path if a resource can be found.
-
-
-
Method Detail
-
isStaticResourceRequest
boolean isStaticResourceRequest(javax.servlet.http.HttpServletRequest request)
Checks if a static resource can be found for the requested path.
Parameters:
request
- the request to checkReturns:
true
if a static resource exists and can be sent as a response to this request,false
otherwise
-
serveStaticResource
boolean serveStaticResource(javax.servlet.http.HttpServletRequest request, javax.servlet.http.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 fromresponse
- the response object to write toReturns:
true
if a file was served and the request has been handled,false
otherwise.Throws:
IOException
- if the underlying servlet container reports an exception
-
-