public String asset ( String path ) { Asset asset = assets . assetAt ( path ) ; if ( asset == null ) { // If the path starts with "/", try without if ( path . startsWith ( "/" ) ) { return asset ( path . substring ( 1 ) ) ; } // Not found. throw new TemplateProcessingException ( "Cannot find the URL of the asset " + path ) ; } return asset . getPath ( ) ; }
Gets the url of the given asset . Throws an exception if the asset cannot be found .