Package com.atlassian.plugin.webresource
Class ResourceUtils
java.lang.Object
com.atlassian.plugin.webresource.ResourceUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanGiven a parameter map, determine if a web resource is cacheable.static StringgetBasename(String path) Determines the base name (name without the extension) of the resource from the given path.getQueryParameters(javax.servlet.http.HttpServletRequest request) Returns a Map of query parameters from the request.static StringDetermines the type (css/js) of the resource from the given path.static booleanshouldValidateRequest(Map<String, String> params) Allows HTTP request filters to opt-out of some WRM URL validation on a per-request basis.
-
Field Details
-
STATIC_HASH
- Since:
- 2.13
- See Also:
-
WRM_INTEGRITY
- Since:
- 4.3
- See Also:
-
-
Method Details
-
getType
Determines the type (css/js) of the resource from the given path.- Parameters:
path- - the path to use- Returns:
- the type of resource
-
getBasename
Determines the base name (name without the extension) of the resource from the given path.- Parameters:
path- - the path to use- Returns:
- the basename of resource
- Since:
- 3.3
-
getQueryParameters
Returns a Map of query parameters from the request. If there are multiple values for the same query parameter, the first value is used.- See Also:
-
ServletRequest.getParameterMap()ServletRequest.getAttribute(String)
-
canRequestedResourcesContentBeAssumedConstant
Given a parameter map, determine if a web resource is cacheable.This determines whether we store in the file cache or not, as well as dictating 304 behaviour.
- Returns:
- if the
STATIC_HASHis set and cache does not equal false.
-
shouldValidateRequest
Allows HTTP request filters to opt-out of some WRM URL validation on a per-request basis.This determines whether the WRM may respond to HTTP requests with non-200 values if any validations fail.
- Parameters:
params- key-value pairs derived from the HTTP request to check.- Returns:
- false if the HTTP request has a
WRM_INTEGRITYattribute with a `no-validate` value, otherwise true.
-