|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2022 the original author or authors. |
| 2 | + * Copyright 2002-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -47,21 +47,21 @@ public class LiteWebJarsResourceResolver extends AbstractResourceResolver {
|
47 | 47 |
|
48 | 48 | private static final int WEBJARS_LOCATION_LENGTH = WebJarVersionLocator.WEBJARS_PATH_PREFIX.length() + 1;
|
49 | 49 |
|
50 |
| - private final WebJarVersionLocator webJarAssetLocator; |
| 50 | + private final WebJarVersionLocator webJarVersionLocator; |
51 | 51 |
|
52 | 52 | /**
|
53 | 53 | * Create a {@code LiteWebJarsResourceResolver} with a default {@code WebJarVersionLocator} instance.
|
54 | 54 | */
|
55 | 55 | public LiteWebJarsResourceResolver() {
|
56 |
| - this.webJarAssetLocator = new WebJarVersionLocator(); |
| 56 | + this.webJarVersionLocator = new WebJarVersionLocator(); |
57 | 57 | }
|
58 | 58 |
|
59 | 59 | /**
|
60 | 60 | * Create a {@code LiteWebJarsResourceResolver} with a custom {@code WebJarVersionLocator} instance,
|
61 | 61 | * e.g. with a custom cache implementation.
|
62 | 62 | */
|
63 |
| - public LiteWebJarsResourceResolver(WebJarVersionLocator webJarAssetLocator) { |
64 |
| - this.webJarAssetLocator = webJarAssetLocator; |
| 63 | + public LiteWebJarsResourceResolver(WebJarVersionLocator webJarVersionLocator) { |
| 64 | + this.webJarVersionLocator = webJarVersionLocator; |
65 | 65 | }
|
66 | 66 |
|
67 | 67 | @Override
|
@@ -98,12 +98,12 @@ protected Mono<String> resolveUrlPathInternal(String resourceUrlPath,
|
98 | 98 |
|
99 | 99 | @Nullable
|
100 | 100 | protected String findWebJarResourcePath(String path) {
|
101 |
| - int startOffset = (path.startsWith("/") ? 1 : 0); |
102 | 101 | int endOffset = path.indexOf('/', 1);
|
103 | 102 | if (endOffset != -1) {
|
| 103 | + int startOffset = (path.startsWith("/") ? 1 : 0); |
104 | 104 | String webjar = path.substring(startOffset, endOffset);
|
105 | 105 | String partialPath = path.substring(endOffset + 1);
|
106 |
| - String webJarPath = this.webJarAssetLocator.fullPath(webjar, partialPath); |
| 106 | + String webJarPath = this.webJarVersionLocator.fullPath(webjar, partialPath); |
107 | 107 | if (webJarPath != null) {
|
108 | 108 | return webJarPath.substring(WEBJARS_LOCATION_LENGTH);
|
109 | 109 | }
|
|
0 commit comments