Package com.vaadin.server.communication
Class PublishedFileHandler
- java.lang.Object
-
- com.vaadin.server.communication.PublishedFileHandler
-
- All Implemented Interfaces:
RequestHandler
,Serializable
public class PublishedFileHandler extends Object implements RequestHandler
Serves a connector resource from the classpath if the resource has previously been registered by callingLegacyCommunicationManager.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 aJavaScript
orStyleSheet
annotation on a Connector class.- Since:
- 7.1
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PublishedFileHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response)
Writes the connector resource identified by the request URI to the response.
-
-
-
Method Detail
-
handleRequest
public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws 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 interfaceRequestHandler
- Parameters:
session
- The session for the requestrequest
- The request to handleresponse
- 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:
IOException
- If an IO error occurred
-
-