|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.webresource.BatchPluginResource
public class BatchPluginResource
Represents a batch of plugin resources.
It provides methods to parse and generate urls to locate a batch of plugin resources. Note BatchPluginResource is also a type ofDownloadableResource. The underlying implementation simply
keeps a list of DownloadableResource of which this batch represents and delegates method calls.
| Constructor Summary | |
|---|---|
BatchPluginResource(String moduleCompleteKey,
String type,
Map<String,String> params)
A constructor that creates a default resource name for the batch in the format: moduleCompleteKey.type For example: test.plugin:resources.js Note that name of the batch does not identify what the batch includes and could have been static e.g. |
|
BatchPluginResource(String moduleCompleteKey,
String type,
Map<String,String> params,
Iterable<DownloadableResource> resources)
A constructor that creates a default resource name for the batch in the format: moduleCompleteKey.type For example: test.plugin:resources.js This constructor includes the resources that are contained in the batch, and so is primarily for use when serving the resource. |
|
| Method Summary | |
|---|---|
protected void |
addParamsToUrl(StringBuilder sb,
Map<String,String> params)
|
boolean |
equals(Object o)
|
String |
getContentType()
Returns the content type for the resource. |
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()
|
boolean |
isEmpty()
|
boolean |
isResourceModified(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Returns true if the plugin resource has been modified. |
void |
serveResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Writes the resource content out into the response. |
void |
streamResource(OutputStream out)
Write the resource to the supplied OutputStream. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BatchPluginResource(String moduleCompleteKey,
String type,
Map<String,String> params)
moduleCompleteKey - - the key of the plugin moduletype - - the type of resource (CSS/JS)params - - the parameters of the resource (ieonly, media, etc)
public BatchPluginResource(String moduleCompleteKey,
String type,
Map<String,String> params,
Iterable<DownloadableResource> resources)
moduleCompleteKey - - the key of the plugin moduletype - - the type of resource (CSS/JS)params - - the parameters of the resource (ieonly, media, etc)resources - - the resources included in the batch.| Method Detail |
|---|
public boolean isEmpty()
public boolean isResourceModified(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
DownloadableResource
isResourceModified in interface DownloadableResource
public void serveResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws DownloadException
DownloadableResource
serveResource in interface DownloadableResourceDownloadException - if there were errors writing to the response.
public void streamResource(OutputStream out)
throws DownloadException
DownloadableResource
streamResource in interface DownloadableResourceout - the stream to write to
DownloadException - if there were errors writing to the response. Since 2.3.public String getContentType()
DownloadableResource
getContentType in interface DownloadableResourcepublic String getUrl()
getUrl in interface PluginResource
protected void addParamsToUrl(StringBuilder sb,
Map<String,String> params)
public String getResourceName()
getResourceName in interface PluginResourcepublic Map<String,String> getParams()
getParams in interface BatchResourcegetParams in interface PluginResourcepublic String getVersion(WebResourceIntegration integration)
getVersion in interface PluginResourcepublic String getModuleCompleteKey()
getModuleCompleteKey in interface PluginResourcepublic boolean isCacheSupported()
isCacheSupported in interface PluginResourcepublic String getType()
getType in interface BatchResourcepublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||