com.atlassian.plugin.webresource
Class PluginResourceLocatorImpl

java.lang.Object
  extended by com.atlassian.plugin.webresource.PluginResourceLocatorImpl
All Implemented Interfaces:
PluginResourceLocator

public class PluginResourceLocatorImpl
extends java.lang.Object
implements PluginResourceLocator

Default implementation of PluginResourceLocator.

Since:
2.2

Field Summary
static java.lang.String PLUGIN_WEBRESOURCE_BATCHING_OFF
           
 
Constructor Summary
PluginResourceLocatorImpl(PluginAccessor pluginAccessor, ServletContextFactory servletContextFactory)
           
 
Method Summary
 DownloadableResource getDownloadableResource(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> queryParams)
          Returns a DownloadableResource represented by the given url and query params.
 java.util.List<PluginResource> getPluginResources(java.lang.String moduleCompleteKey)
          Returns a list of PluginResources for a given plugin module's complete key.
 java.lang.String getResourceUrl(java.lang.String moduleCompleteKey, java.lang.String resourceName)
          Constructs and returns url for the given resource.
 boolean matches(java.lang.String url)
          Returns true if this locator can parse the given url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUGIN_WEBRESOURCE_BATCHING_OFF

public static final java.lang.String PLUGIN_WEBRESOURCE_BATCHING_OFF
See Also:
Constant Field Values
Constructor Detail

PluginResourceLocatorImpl

public PluginResourceLocatorImpl(PluginAccessor pluginAccessor,
                                 ServletContextFactory servletContextFactory)
Method Detail

matches

public boolean matches(java.lang.String url)
Description copied from interface: PluginResourceLocator
Returns true if this locator can parse the given url.

Specified by:
matches in interface PluginResourceLocator

getDownloadableResource

public DownloadableResource getDownloadableResource(java.lang.String url,
                                                    java.util.Map<java.lang.String,java.lang.String> queryParams)
Description copied from interface: PluginResourceLocator
Returns a DownloadableResource represented by the given url and query params. PluginResourceLocator.matches(String) should be called before invoking this method. If the url is not understood by the locator, null will be returned.

Specified by:
getDownloadableResource in interface PluginResourceLocator

getPluginResources

public java.util.List<PluginResource> getPluginResources(java.lang.String moduleCompleteKey)
Description copied from interface: PluginResourceLocator
Returns a list of PluginResources for a given plugin module's complete key. If the plugin the module belongs to is not enabled or does not exist, an empty list is returned.

Specified by:
getPluginResources in interface PluginResourceLocator

getResourceUrl

public java.lang.String getResourceUrl(java.lang.String moduleCompleteKey,
                                       java.lang.String resourceName)
Description copied from interface: PluginResourceLocator
Constructs and returns url for the given resource. This method is not responsible for adding any static caching url prefixes.

Specified by:
getResourceUrl in interface PluginResourceLocator
Parameters:
moduleCompleteKey - a plugin module's complete key
resourceName - the name of the resource described in the module


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.