|
||||||||||
| 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(java.lang.String moduleCompleteKey,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.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. |
|
| Method Summary | |
|---|---|
void |
add(DownloadableResource resource)
|
protected void |
addParamsToUrl(java.lang.StringBuilder sb,
java.util.Map<java.lang.String,java.lang.String> params)
|
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getContentType()
Returns the content type for the resource. |
java.lang.String |
getModuleCompleteKey()
|
java.util.Map<java.lang.String,java.lang.String> |
getParams()
|
java.lang.String |
getResourceName()
|
java.lang.String |
getType()
|
java.lang.String |
getUrl()
Returns a url string in the format: /download/batch/MODULE_COMPLETE_KEY/resourceName?PARAMS e.g. |
java.lang.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. |
static boolean |
matches(java.lang.String url)
|
static BatchPluginResource |
parse(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> queryParams)
Parses the given url and query parameter map into a BatchPluginResource. |
void |
serveResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Writes the resource content out into the response. |
void |
streamResource(java.io.OutputStream out)
Write the resource to the supplied OutputStream. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BatchPluginResource(java.lang.String moduleCompleteKey,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.String> params)
| Method Detail |
|---|
public boolean isEmpty()
public void add(DownloadableResource resource)
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(java.io.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 java.lang.String getContentType()
DownloadableResource
getContentType in interface DownloadableResource
public static BatchPluginResource parse(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> queryParams)
throws UrlParseException
url - the url to parsequeryParams - a map of String key and value pairs representing the query parameters in the url
UrlParseException - if the url passed in is not a valid batch resource urlpublic static boolean matches(java.lang.String url)
public java.lang.String getUrl()
getUrl in interface PluginResource
protected void addParamsToUrl(java.lang.StringBuilder sb,
java.util.Map<java.lang.String,java.lang.String> params)
public java.lang.String getResourceName()
getResourceName in interface PluginResourcepublic java.util.Map<java.lang.String,java.lang.String> getParams()
getParams in interface BatchResourcegetParams in interface PluginResourcepublic java.lang.String getVersion(WebResourceIntegration integration)
getVersion in interface PluginResourcepublic java.lang.String getModuleCompleteKey()
getModuleCompleteKey in interface PluginResourcepublic boolean isCacheSupported()
isCacheSupported in interface PluginResourcepublic java.lang.String getType()
getType in interface BatchResourcepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||