28
28
import org .springframework .web .servlet .resource .ResourceHttpRequestHandler ;
29
29
30
30
/**
31
- * Encapsulates information required to create a resource handlers .
31
+ * Encapsulates information required to create a resource handler .
32
32
*
33
33
* @author Rossen Stoyanchev
34
34
* @author Keith Donald
35
35
* @author Brian Clozel
36
- *
37
36
* @since 3.1
38
37
*/
39
38
public class ResourceHandlerRegistration {
@@ -70,7 +69,7 @@ public ResourceHandlerRegistration(ResourceLoader resourceLoader, String... path
70
69
* <p>For example, {{@code "/"}, {@code "classpath:/META-INF/public-web-resources/"}} allows resources to
71
70
* be served both from the web application root and from any JAR on the classpath that contains a
72
71
* {@code /META-INF/public-web-resources/} directory, with resources in the web application root taking precedence.
73
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
72
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
74
73
*/
75
74
public ResourceHandlerRegistration addResourceLocations (String ... resourceLocations ) {
76
75
for (String location : resourceLocations ) {
@@ -84,7 +83,7 @@ public ResourceHandlerRegistration addResourceLocations(String... resourceLocati
84
83
* send any cache headers but to rely on last-modified timestamps only. Set to 0 in order to send cache headers
85
84
* that prevent caching, or to a positive number of seconds to send cache headers with the given max-age value.
86
85
* @param cachePeriod the time to cache resources in seconds
87
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
86
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
88
87
*/
89
88
public ResourceHandlerRegistration setCachePeriod (Integer cachePeriod ) {
90
89
this .cachePeriod = cachePeriod ;
@@ -93,13 +92,12 @@ public ResourceHandlerRegistration setCachePeriod(Integer cachePeriod) {
93
92
94
93
/**
95
94
* Specify the {@link org.springframework.http.CacheControl} which should be used
96
- * by the the resource handler.
95
+ * by the resource handler.
97
96
*
98
97
* <p>Setting a custom value here will override the configuration set with {@link #setCachePeriod}.
99
98
*
100
99
* @param cacheControl the CacheControl configuration to use
101
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
102
- *
100
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
103
101
* @since 4.2
104
102
*/
105
103
public ResourceHandlerRegistration setCacheControl (CacheControl cacheControl ) {
@@ -109,16 +107,16 @@ public ResourceHandlerRegistration setCacheControl(CacheControl cacheControl) {
109
107
110
108
/**
111
109
* Configure a chain of resource resolvers and transformers to use. This
112
- * can be useful for example to apply a version strategy to resource URLs.
110
+ * can be useful, for example, to apply a version strategy to resource URLs.
113
111
*
114
112
* <p>If this method is not invoked, by default only a simple
115
113
* {@link PathResourceResolver} is used in order to match URL paths to
116
114
* resources under the configured locations.
117
115
*
118
116
* @param cacheResources whether to cache the result of resource resolution;
119
- * setting this to "true" is recommended for production (and "false" for
120
- * development, especially when applying a version strategy).
121
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
117
+ * setting this to "true" is recommended for production (and "false" for
118
+ * development, especially when applying a version strategy)
119
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
122
120
* @since 4.1
123
121
*/
124
122
public ResourceChainRegistration resourceChain (boolean cacheResources ) {
@@ -128,20 +126,21 @@ public ResourceChainRegistration resourceChain(boolean cacheResources) {
128
126
129
127
/**
130
128
* Configure a chain of resource resolvers and transformers to use. This
131
- * can be useful for example to apply a version strategy to resource URLs.
129
+ * can be useful, for example, to apply a version strategy to resource URLs.
132
130
*
133
131
* <p>If this method is not invoked, by default only a simple
134
132
* {@link PathResourceResolver} is used in order to match URL paths to
135
133
* resources under the configured locations.
136
134
*
137
135
* @param cacheResources whether to cache the result of resource resolution;
138
- * setting this to "true" is recommended for production (and "false" for
139
- * development, especially when applying a version strategy.
136
+ * setting this to "true" is recommended for production (and "false" for
137
+ * development, especially when applying a version strategy
140
138
* @param cache the cache to use for storing resolved and transformed resources;
141
- * by default a {@link org.springframework.cache.concurrent.ConcurrentMapCache}
142
- * is used. As Resources aren't serializable and can be dependent of the application host,
143
- * one should not use a distributed cache but rather an in-memory cache.
144
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
139
+ * by default a {@link org.springframework.cache.concurrent.ConcurrentMapCache}
140
+ * is used. Since Resources aren't serializable and can be dependent on the
141
+ * application host, one should not use a distributed cache but rather an
142
+ * in-memory cache.
143
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
145
144
* @since 4.1
146
145
*/
147
146
public ResourceChainRegistration resourceChain (boolean cacheResources , Cache cache ) {
0 commit comments