View Javadoc

1   package com.atlassian.plugin.webresource;
2   
3   import com.atlassian.plugin.servlet.DownloadableResource;
4   import com.atlassian.plugin.webresource.cache.CacheHandle;
5   
6   import java.util.Map;
7   
8   /**
9    * Represents a batch download of all the resources in a web-resource module of a plugin. <p/>
10   *
11   * @since 2.2
12   */
13  public class BatchDownloadableResource extends AbstractBatchDownloadableResource
14  {
15      private final String moduleCompleteKey;
16  
17      /**
18       * This constructor should only ever be used internally within this class. It does not ensure that the resourceName's
19       * file extension is the same as the given type. It is up to the calling code to ensure this.
20       * @param type - the type of resource (CSS/JS)
21       * @param params - the parameters of the resource (ieonly, media, etc)
22       * @param resources - the resources included in the batch.
23       */
24      BatchDownloadableResource(final String moduleCompleteKey, final String type, final Map<String, String> params,
25                                final Iterable<DownloadableResource> resources,
26                                final CacheHandle cacher)
27      {
28          super(type, params, resources, cacher);
29          this.moduleCompleteKey = moduleCompleteKey;
30      }
31  
32      public String getModuleCompleteKey() {
33          return moduleCompleteKey;
34      }
35  
36      @Override
37      public String toString()
38      {
39          return "[moduleCompleteKey=" + moduleCompleteKey + ", type=" + getType() + ", params=" + getParams() + "]";
40      }
41  }