com.atlassian.plugin.webresource
Class BatchPluginResource

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

public class BatchPluginResource
extends Object
implements PluginResource

Represents a batch of plugin resources.

It provides methods to parse and generate urls to locate a batch of plugin resources.

Since:
2.2

Method Summary
 boolean equals(Object o)
           
 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/batch/MODULE_COMPLETE_KEY/resourceName?PARAMS

e.g.

 String getVersion(WebResourceIntegration integration)
           
 int hashCode()
           
 boolean isCacheSupported()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getUrl

public String getUrl()
Returns a url string in the format: /download/batch/MODULE_COMPLETE_KEY/resourceName?PARAMS

e.g. /download/batch/example.plugin:webresources/example.plugin:webresources.css?ie=true

It is important for the url structure to be: 1. the same number of sectioned paths as the SinglePluginResource 2. include the module completey key in the path before the resource name This is due to css resources referencing other resources such as images in relative path forms.

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

getResourceName

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

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

getModuleCompleteKey

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

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.

getType

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

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.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Atlassian. All Rights Reserved.