public class ResourceUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
STATIC_HASH |
static String |
WRM_INTEGRITY |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canRequestedResourcesContentBeAssumedConstant(Map<String,String> params)
Given a parameter map, determine if a web resource is cacheable.
|
static String |
getBasename(String path)
Determines the base name (name without the extension) of the resource from the given path.
|
static Map<String,String> |
getQueryParameters(javax.servlet.http.HttpServletRequest request)
Returns a Map of query parameters from the request.
|
static String |
getType(String path)
Determines the type (css/js) of the resource from the given path.
|
static boolean |
shouldValidateRequest(Map<String,String> params)
Allows HTTP request filters to opt-out of some WRM URL validation on a per-request basis.
|
public static final String STATIC_HASH
public static final String WRM_INTEGRITY
public static String getType(@Nonnull String path)
path - - the path to usepublic static String getBasename(@Nonnull String path)
path - - the path to usepublic static Map<String,String> getQueryParameters(javax.servlet.http.HttpServletRequest request)
ServletRequest.getParameterMap(),
ServletRequest.getAttribute(String)public static boolean canRequestedResourcesContentBeAssumedConstant(Map<String,String> params)
This determines whether we store in the file cache or not, as well as dictating 304 behaviour.
STATIC_HASH is set and cache does not equal false.public static boolean shouldValidateRequest(Map<String,String> params)
This determines whether the WRM may respond to HTTP requests with non-200 values if any validations fail.
params - key-value pairs derived from the HTTP request to check.WRM_INTEGRITY attribute with a `no-validate` value,
otherwise true.Copyright © 2024 Atlassian. All rights reserved.