com.atlassian.plugin.webresource
Class ResourceUtils

java.lang.Object
  extended by com.atlassian.plugin.webresource.ResourceUtils

public class ResourceUtils
extends Object


Field Summary
static String STATIC_HASH
           
 
Constructor Summary
ResourceUtils()
           
 
Method Summary
static void addParamsToUrl(StringBuilder sb, Map<String,String> params)
           
static boolean canRequestedResourcesContentBeAssumedConstant(Map<String,String> params)
          Given a parameter map, determine if a web resource is cacheable.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATIC_HASH

public static final String STATIC_HASH
Since:
2.13
Constructor Detail

ResourceUtils

public ResourceUtils()
Method Detail

getType

public static String getType(@NotNull
                             String path)
Determines the type (css/js) of the resource from the given path.

Parameters:
path - - the path to use
Returns:
the type of resource

addParamsToUrl

public static void addParamsToUrl(StringBuilder sb,
                                  Map<String,String> params)

getQueryParameters

public static Map<String,String> getQueryParameters(javax.servlet.http.HttpServletRequest request)
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:
javax.servlet.ServletRequest#getParameterMap()}

canRequestedResourcesContentBeAssumedConstant

public static boolean canRequestedResourcesContentBeAssumedConstant(Map<String,String> params)
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.

Parameters:
params -
Returns:
if the PluginResourceDownload.STATIC_HASH is set and cache does not equal false.


Copyright © 2012 Atlassian. All Rights Reserved.