com.atlassian.plugin.servlet
Interface DownloadableResource

All Known Implementing Classes:
AbstractStringTransformedDownloadableResource, AbstractTransformedDownloadableResource, BatchPluginResource, DownloadableClasspathResource, DownloadableWebResource, ForwardableResource, SuperBatchPluginResource, SuperBatchSubResource

public interface DownloadableResource

Represents a plugin resource that can be downloaded. It is up to the calling class to check if the resource is modified before calling serveResource(HttpServletRequest, HttpServletResponse) to serve the resource.


Method Summary
 String getContentType()
          Returns the content type for the resource.
 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.
 

Method Detail

isResourceModified

boolean isResourceModified(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
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.


serveResource

void serveResource(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
                   throws DownloadException
Writes the resource content out into the response.

Throws:
DownloadException - if there were errors writing to the response.
Since:
2.2

streamResource

void streamResource(OutputStream out)
                    throws DownloadException
Write the resource to the supplied OutputStream. Note that the OutputStream will not be closed by this method.

Parameters:
out - the stream to write to
Throws:
DownloadException - if there were errors writing to the response. Since 2.3.
Since:
2.2

getContentType

String getContentType()
Returns the content type for the resource. May return null if it cannot resolve its own content type.

Since:
2.2


Copyright © 2010 Atlassian. All Rights Reserved.