private URL resolveResource ( Path path ) throws MalformedURLException { final Path dir = path . getParent ( ) ; final String basename = path . getFileName ( ) . toString ( ) ; for ( String prefix : new String [ ] { "_" , "" } ) { for ( String suffix : new String [ ] { ".scss" , ".css" , "" } ) { final Path target = dir . resolve ( prefix + basename + suffix ) ; final URL resource = getServletContext ( ) . getResource ( target . toString ( ) ) ; if ( null != resource ) { return resource ; } } } return null ; }
Try to find a resource for this path .