Class PublishedFileHandler

  • All Implemented Interfaces:
    RequestHandler, java.io.Serializable

    public class PublishedFileHandler
    extends java.lang.Object
    implements RequestHandler
    Serves a connector resource from the classpath if the resource has previously been registered by calling LegacyCommunicationManager.registerDependency(String, Class). Sending arbitrary files from the classpath is prevented by only accepting resource names that have explicitly been registered. Resources can currently only be registered by including a JavaScript or StyleSheet annotation on a Connector class.
    Since:
    7.1
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Constructor Detail

      • PublishedFileHandler

        public PublishedFileHandler()
    • Method Detail

      • handleRequest

        public boolean handleRequest​(VaadinSession session,
                                     VaadinRequest request,
                                     VaadinResponse response)
                              throws java.io.IOException
        Writes the connector resource identified by the request URI to the response. If a published resource corresponding to the URI path is not found, writes a HTTP Not Found error to the response.
        Specified by:
        handleRequest in interface RequestHandler
        Parameters:
        session - The session for the request
        request - The request to handle
        response - The response object to which a response can be written.
        Returns:
        true if a response has been written and no further request handlers should be called, otherwise false
        Throws:
        java.io.IOException - If an IO error occurred