Example usage for org.springframework.web.servlet.resource ResourceUrlProvider getForLookupPath

List of usage examples for org.springframework.web.servlet.resource ResourceUrlProvider getForLookupPath

Introduction

In this page you can find the example usage for org.springframework.web.servlet.resource ResourceUrlProvider getForLookupPath.

Prototype

@Nullable
public final String getForLookupPath(String lookupPath) 

Source Link

Document

Compare the given path against configured resource handler mappings and if a match is found use the ResourceResolver chain of the matched ResourceHttpRequestHandler to resolve the URL path to expose for public use.

Usage

From source file:io.spring.initializr.web.project.AbstractInitializrController.java

protected AbstractInitializrController(InitializrMetadataProvider metadataProvider,
        ResourceUrlProvider resourceUrlProvider) {
    this.metadataProvider = metadataProvider;
    this.linkTo = (link) -> {
        String result = resourceUrlProvider.getForLookupPath(link);
        return result == null ? link : result;
    };//from   ww w.  j  a v a  2  s  . co  m
}