com.vaadin.server.communication
Class PublishedFileHandler

java.lang.Object
  extended by com.vaadin.server.communication.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 Summary
PublishedFileHandler()
           
 
Method Summary
 boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response)
          Writes the connector resource identified by the request URI to the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.