com.atlassian.plugin.webresource
Class SinglePluginResource

java.lang.Object
  extended by com.atlassian.plugin.webresource.SinglePluginResource
All Implemented Interfaces:
PluginResource

public class SinglePluginResource
extends Object
implements PluginResource

Represents a single plugin resource. It provides methods to parse and generate urls to locate a single plugin resource. Note: This PluginResource does not use it's parameters in generating the url.

Since:
2.2

Constructor Summary
SinglePluginResource(String resourceName, String moduleCompleteKey, boolean cached)
           
SinglePluginResource(String resourceName, String moduleCompleteKey, boolean cached, Map<String,String> params)
           
 
Method Summary
 Set<com.atlassian.plugin.webresource.BatchedWebResourceDescriptor> getBatchedWebResourceDescriptors()
          This method provides the mechanism for discovering the contents of a PluginResource.
 String getModuleCompleteKey()
           
 Map<String,String> getParams()
           
 String getResourceName()
           
 String getType()
           
 String getUrl()
          Returns a url string in the format: /download/resources/MODULE_COMPLETE_KEY/RESOURCE_NAME e.g.
 String getVersion(WebResourceIntegration integration)
           
 boolean isCacheSupported()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SinglePluginResource

public SinglePluginResource(String resourceName,
                            String moduleCompleteKey,
                            boolean cached)

SinglePluginResource

public SinglePluginResource(String resourceName,
                            String moduleCompleteKey,
                            boolean cached,
                            Map<String,String> params)
Method Detail

getResourceName

public String getResourceName()
Specified by:
getResourceName in interface PluginResource
Returns:
the resource name for the plugin resource.

getModuleCompleteKey

public String getModuleCompleteKey()
Specified by:
getModuleCompleteKey in interface PluginResource
Returns:
the plugin module's complete key for which this resource belongs to.

getParams

public Map<String,String> getParams()
Specified by:
getParams in interface PluginResource
Returns:
a map of parameter key and value pairs for this resource.

getVersion

public String getVersion(WebResourceIntegration integration)
Specified by:
getVersion in interface PluginResource
Returns:
the version prefix string for a cached resource

isCacheSupported

public boolean isCacheSupported()
Specified by:
isCacheSupported in interface PluginResource
Returns:
true if caching for this resource is supported. Use this check to append a static caching url prefix to this resource's url.

getBatchedWebResourceDescriptors

public Set<com.atlassian.plugin.webresource.BatchedWebResourceDescriptor> getBatchedWebResourceDescriptors()
Description copied from interface: PluginResource
This method provides the mechanism for discovering the contents of a PluginResource.

The primary use of this method is in providing a representation of the contents (for dependency tracking) when formatting a PluginResource.

Specified by:
getBatchedWebResourceDescriptors in interface PluginResource
Returns:
a Set of descriptors providing information about the contents of this PluginResource.

getUrl

public String getUrl()
Returns a url string in the format: /download/resources/MODULE_COMPLETE_KEY/RESOURCE_NAME e.g. /download/resources/example.plugin:webresources/foo.css

Specified by:
getUrl in interface PluginResource
Returns:
the url for this plugin resource.

getType

public String getType()
Specified by:
getType in interface PluginResource
Returns:
the type (e.g. file extension) of the resource.


Copyright © 2012 Atlassian. All Rights Reserved.