com.atlassian.plugin.webresource
Class AbstractBatchDownloadableResource

java.lang.Object
  extended by com.atlassian.plugin.webresource.AbstractBatchDownloadableResource
All Implemented Interfaces:
DownloadableResource
Direct Known Subclasses:
BatchDownloadableResource, SuperBatchDownloadableResource

public abstract class AbstractBatchDownloadableResource
extends Object
implements DownloadableResource

A base class that batches together a sequence of DownloableResources

Since:
2.13

Method Summary
 String getContentType()
          Returns the content type for the resource.
 Map<String,String> getParams()
           
 String getType()
           
 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 originalOut)
          Write the resource to the supplied OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEmpty

public boolean isEmpty()
Returns:
true if there are no resources included in this batch

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 originalOut)
                    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:
originalOut - 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

getParams

public Map<String,String> getParams()

getType

public String getType()


Copyright © 2013 Atlassian. All Rights Reserved.