Package org.geotools.ows.wmts
Class WMTSHelper
Object
WMTSHelper
Some useful functions that was used within gt-wmts.
Might have their substitution elsewhere
- Author:
- Roar Brænden
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
appendQueryString
(String baseUrl, Map<String, String> params) Append the parameters to the baseUrl.static String
encodeParameter
(String name) Encodes a parameter using UTF-8 encoding (suitable for URLs).static String
replaceToken
(String baseUrl, String dimName, String dimValue) Performs a case-insensitive replacement of the first occurrence of {dimName} with dimValue within the baseUrl.
-
Constructor Details
-
WMTSHelper
public WMTSHelper()
-
-
Method Details
-
replaceToken
Performs a case-insensitive replacement of the first occurrence of {dimName} with dimValue within the baseUrl. The curly braces are added by this function so dimName should not contain them. dimValue should be encoded usingencodeParameter(String)
before passing into this function- Parameters:
baseUrl
- the string which contains {dimName}dimName
- the value in baseurl that needs to be replaced. Should NOT have the curly braces around itdimValue
- the encoded value to replace {dimName} with. If this is null then a blank string is used- Returns:
- baseUrl with {dimName} substituted with dimValue
-
appendQueryString
Append the parameters to the baseUrl.Add a ? mark if baseUrl doesn't have it.
Does not add existing parameters
If a value starts with {, it will avoid url-encoding
-
encodeParameter
Encodes a parameter using UTF-8 encoding (suitable for URLs). It will also replace spaces with %20 instead of + (as raised in GEOT-4317) so that the encoded parameter can be used in any part of a URL- Parameters:
name
- The parameter to be encoded- Returns:
- the encoded parameter
-