com.atlassian.plugin.webresource
Class SingleDownloadableResourceBuilder

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

public class SingleDownloadableResourceBuilder
extends Object

Constructs a single resource for download

Since:
2.9.0

Constructor Summary
SingleDownloadableResourceBuilder(PluginAccessor pluginAccessor, ServletContextFactory servletContextFactory)
           
 
Method Summary
 DownloadableResource find(String moduleKey, String resourceName)
          Finds a resource to upload given a module key and resource name If the resource cannot be found null is returned.
 boolean matches(String path)
          Returns true if the builder can parse the given url
 DownloadableResource parse(String path, Map<String,String> params)
          Parses the url and params and then builds a resource to upload If the resource cannot be found null is returned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleDownloadableResourceBuilder

public SingleDownloadableResourceBuilder(PluginAccessor pluginAccessor,
                                         ServletContextFactory servletContextFactory)
Method Detail

matches

public boolean matches(String path)
Returns true if the builder can parse the given url

Parameters:
path - - the url to parse
Returns:
true if the builder can parse the given url

parse

public DownloadableResource parse(String path,
                                  Map<String,String> params)
                           throws UrlParseException
Parses the url and params and then builds a resource to upload If the resource cannot be found null is returned.

Parameters:
path - - the url
params - - query parameters provided in the url
Returns:
a resource to upload
Throws:
UrlParseException - - if the path cannot be parsed

find

public DownloadableResource find(String moduleKey,
                                 String resourceName)
Finds a resource to upload given a module key and resource name If the resource cannot be found null is returned.

Parameters:
moduleKey - - the key of the web resource
resourceName - - the name or the resource inside the given web resource
Returns:
a resource to upload


Copyright © 2011 Atlassian. All Rights Reserved.