Example usage for com.vaadin.server VaadinServletService getCancelingRelativePath

List of usage examples for com.vaadin.server VaadinServletService getCancelingRelativePath

Introduction

In this page you can find the example usage for com.vaadin.server VaadinServletService getCancelingRelativePath.

Prototype

public static String getCancelingRelativePath(String pathToCancel) 

Source Link

Document

Gets a relative path that cancels the provided path.

Usage

From source file:com.github.mcollovati.vertx.vaadin.VertxVaadinService.java

License:Open Source License

@Override
public String getStaticFileLocation(VaadinRequest request) {
    String staticFileLocation;/*from  w w  w .j a v  a 2s .  c o  m*/
    // if property is defined in configurations, use that
    staticFileLocation = getDeploymentConfiguration().getResourcesPath();
    if (staticFileLocation != null) {
        return staticFileLocation;
    }

    VertxVaadinRequest vertxRequest = (VertxVaadinRequest) request;
    String requestedPath = vertxRequest.getRequest().path().substring(
            Optional.ofNullable(vertxRequest.getRoutingContext().mountPoint()).map(String::length).orElse(0));
    return VaadinServletService.getCancelingRelativePath(requestedPath);
}