com.atlassian.plugin.webresource
Class BatchSubResource

java.lang.Object
  extended by com.atlassian.plugin.webresource.BatchSubResource
All Implemented Interfaces:
DownloadableResource

public class BatchSubResource
extends Object
implements DownloadableResource

Represents a plugin resource that is a subordinate of a batch. This is typically the case for CSS in the superbatch or context batch with relative urls to images. For example: /download/superbatch/css/images/foo.png /download/contextbatch/css/contexta/images/foo.png

Since:
2.9.0

Constructor Summary
BatchSubResource(String resourceName, String type, Map<String,String> params)
           
BatchSubResource(String resourceName, String type, Map<String,String> params, List<DownloadableResource> resources)
           
 
Method Summary
 String getContentType()
          Returns the content type for the resource.
 String getResourceName()
           
 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BatchSubResource

public BatchSubResource(String resourceName,
                        String type,
                        Map<String,String> params)

BatchSubResource

public BatchSubResource(String resourceName,
                        String type,
                        Map<String,String> params,
                        List<DownloadableResource> resources)
Method Detail

isResourceModified

public boolean isResourceModified(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
Description copied from interface: DownloadableResource
Returns true if the plugin resource has been modified. The implementing class is responsible for setting any appropriate response codes or headers on the response. If the resource has been modified, the resource shouldn't be served.

Specified by:
isResourceModified in interface DownloadableResource

serveResource

public void serveResource(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws DownloadException
Description copied from interface: DownloadableResource
Writes the resource content out into the response.

Specified by:
serveResource in interface DownloadableResource
Throws:
DownloadException - if there were errors writing to the response.

streamResource

public void streamResource(OutputStream out)
                    throws DownloadException
Description copied from interface: DownloadableResource
Write the resource to the supplied OutputStream. Note that the OutputStream will not be closed by this method.

Specified by:
streamResource in interface DownloadableResource
Parameters:
out - the stream to write to
Throws:
DownloadException - if there were errors writing to the response. Since 2.3.

getContentType

public String getContentType()
Description copied from interface: DownloadableResource
Returns the content type for the resource. May return null if it cannot resolve its own content type.

Specified by:
getContentType in interface DownloadableResource

isEmpty

public boolean isEmpty()

getResourceName

public String getResourceName()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Atlassian. All Rights Reserved.