org.apache.wicket.request.handler.resource
Class ResourceStreamRequestHandler

java.lang.Object
  extended by org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler
All Implemented Interfaces:
IRequestHandler
Direct Known Subclasses:
WebExternalResourceRequestHandler

public class ResourceStreamRequestHandler
extends java.lang.Object
implements IRequestHandler

Request target that responds by sending its resource stream.

Author:
Eelco Hillenius

Constructor Summary
ResourceStreamRequestHandler(IResourceStream resourceStream)
          Construct.
ResourceStreamRequestHandler(IResourceStream resourceStream, java.lang.String fileName)
          Construct.
 
Method Summary
 void detach(IRequestCycle requestCycle)
          This method is called at the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.
 boolean equals(java.lang.Object obj)
           
 ContentDisposition getContentDisposition()
           
 java.lang.String getFileName()
           
 IResourceStream getResourceStream()
          Gets the resource stream for the response.
 int hashCode()
           
 void respond(IRequestCycle requestCycle)
          Responds by sending the contents of the resource stream.
 ResourceStreamRequestHandler setContentDisposition(ContentDisposition contentDisposition)
           
 ResourceStreamRequestHandler setFileName(java.lang.String fileName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceStreamRequestHandler

public ResourceStreamRequestHandler(IResourceStream resourceStream)
Construct.

Parameters:
resourceStream - the resource stream for the response

ResourceStreamRequestHandler

public ResourceStreamRequestHandler(IResourceStream resourceStream,
                                    java.lang.String fileName)
Construct.

Parameters:
resourceStream - the resource stream for the response
fileName -
Method Detail

detach

public void detach(IRequestCycle requestCycle)
Description copied from interface: IRequestHandler
This method is called at the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.

Specified by:
detach in interface IRequestHandler
Parameters:
requestCycle - the current request cycle

getFileName

public final java.lang.String getFileName()
Returns:
Optional filename, used to set the content disposition header. Only meaningful when using with web requests.

getResourceStream

public final IResourceStream getResourceStream()
Gets the resource stream for the response.

Returns:
the resource stream for the response

respond

public void respond(IRequestCycle requestCycle)
Responds by sending the contents of the resource stream.

Specified by:
respond in interface IRequestHandler
Parameters:
requestCycle - the current request cycle
See Also:
IRequestHandler.respond(org.apache.wicket.request.IRequestCycle)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

setFileName

public final ResourceStreamRequestHandler setFileName(java.lang.String fileName)
Parameters:
fileName - Optional filename, used to set the content disposition header. Only meaningful when using with web requests.
Returns:
The this.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getContentDisposition

public final ContentDisposition getContentDisposition()
Returns:
ContentDisposition

setContentDisposition

public final ResourceStreamRequestHandler setContentDisposition(ContentDisposition contentDisposition)
Parameters:
contentDisposition -
Returns:
this


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.