1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 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.
27
27
import org .springframework .web .servlet .resource .ResourceHttpRequestHandler ;
28
28
29
29
/**
30
- * Encapsulates information required to create a resource handlers .
30
+ * Encapsulates information required to create a resource handler .
31
31
*
32
32
* @author Rossen Stoyanchev
33
33
* @author Keith Donald
34
34
* @author Brian Clozel
35
- *
36
35
* @since 3.1
37
36
*/
38
37
public class ResourceHandlerRegistration {
@@ -67,7 +66,7 @@ public ResourceHandlerRegistration(ResourceLoader resourceLoader, String... path
67
66
* <p>For example, {{@code "/"}, {@code "classpath:/META-INF/public-web-resources/"}} allows resources to
68
67
* be served both from the web application root and from any JAR on the classpath that contains a
69
68
* {@code /META-INF/public-web-resources/} directory, with resources in the web application root taking precedence.
70
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
69
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
71
70
*/
72
71
public ResourceHandlerRegistration addResourceLocations (String ...resourceLocations ) {
73
72
for (String location : resourceLocations ) {
@@ -81,7 +80,7 @@ public ResourceHandlerRegistration addResourceLocations(String...resourceLocatio
81
80
* send any cache headers but to rely on last-modified timestamps only. Set to 0 in order to send cache headers
82
81
* that prevent caching, or to a positive number of seconds to send cache headers with the given max-age value.
83
82
* @param cachePeriod the time to cache resources in seconds
84
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
83
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
85
84
*/
86
85
public ResourceHandlerRegistration setCachePeriod (Integer cachePeriod ) {
87
86
this .cachePeriod = cachePeriod ;
@@ -90,16 +89,16 @@ public ResourceHandlerRegistration setCachePeriod(Integer cachePeriod) {
90
89
91
90
/**
92
91
* Configure a chain of resource resolvers and transformers to use. This
93
- * can be useful for example to apply a version strategy to resource URLs.
92
+ * can be useful, for example, to apply a version strategy to resource URLs.
94
93
*
95
94
* <p>If this method is not invoked, by default only a simple
96
95
* {@link PathResourceResolver} is used in order to match URL paths to
97
96
* resources under the configured locations.
98
97
*
99
98
* @param cacheResources whether to cache the result of resource resolution;
100
- * setting this to "true" is recommended for production (and "false" for
101
- * development, especially when applying a version strategy).
102
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
99
+ * setting this to "true" is recommended for production (and "false" for
100
+ * development, especially when applying a version strategy)
101
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
103
102
* @since 4.1
104
103
*/
105
104
public ResourceChainRegistration resourceChain (boolean cacheResources ) {
@@ -109,20 +108,21 @@ public ResourceChainRegistration resourceChain(boolean cacheResources) {
109
108
110
109
/**
111
110
* 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.
111
+ * can be useful, for example, to apply a version strategy to resource URLs.
113
112
*
114
113
* <p>If this method is not invoked, by default only a simple
115
114
* {@link PathResourceResolver} is used in order to match URL paths to
116
115
* resources under the configured locations.
117
116
*
118
117
* @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.
118
+ * setting this to "true" is recommended for production (and "false" for
119
+ * development, especially when applying a version strategy
121
120
* @param cache the cache to use for storing resolved and transformed resources;
122
- * by default a {@link org.springframework.cache.concurrent.ConcurrentMapCache}
123
- * is used. As Resources aren't serializable and can be dependent of the application host,
124
- * one should not use a distributed cache but rather an in-memory cache.
125
- * @return the same {@link ResourceHandlerRegistration} instance for chained method invocation
121
+ * by default a {@link org.springframework.cache.concurrent.ConcurrentMapCache}
122
+ * is used. Since Resources aren't serializable and can be dependent on the
123
+ * application host, one should not use a distributed cache but rather an
124
+ * in-memory cache.
125
+ * @return the same {@link ResourceHandlerRegistration} instance, for chained method invocation
126
126
* @since 4.1
127
127
*/
128
128
public ResourceChainRegistration resourceChain (boolean cacheResources , Cache cache ) {
0 commit comments