com.atlassian.plugin.servlet
Class ForwardableResource

java.lang.Object
  extended by com.atlassian.plugin.servlet.ForwardableResource
All Implemented Interfaces:
DownloadableResource

public class ForwardableResource
extends java.lang.Object
implements DownloadableResource

A DownloadableResource that simply forwards the request to the given location. This should be used to reference dynamic resources available in the web application e.g dwr js files


Constructor Summary
ForwardableResource(ResourceLocation resourceLocation)
           
 
Method Summary
 java.lang.String getContentType()
          Returns the content type for the resource.
protected  java.lang.String getLocation()
           
 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(java.io.OutputStream out)
          Not implemented by a ForwardableResource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardableResource

public ForwardableResource(ResourceLocation resourceLocation)
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(java.io.OutputStream out)
Not implemented by a ForwardableResource. The supplied OutputStream will not be modified.

Specified by:
streamResource in interface DownloadableResource
Parameters:
out - the stream to write to

getContentType

public java.lang.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

getLocation

protected java.lang.String getLocation()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.