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 Object
implements IRequestHandler

Request target that responds by sending its resource stream.

Author:
Eelco Hillenius

Constructor Summary
ResourceStreamRequestHandler(IResourceStream resourceStream)
          Construct.
ResourceStreamRequestHandler(IResourceStream resourceStream, String fileName)
          Construct.
 
Method Summary
 void detach(IRequestCycle requestCycle)
           
 boolean equals(Object obj)
           
 ContentDisposition getContentDisposition()
           
 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(String fileName)
           
 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,
                                    String fileName)
Construct.

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

detach

public void detach(IRequestCycle requestCycle)
Specified by:
detach in interface IRequestHandler

equals

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

getFileName

public final 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

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

respond

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

Specified by:
respond in interface IRequestHandler
See Also:
IRequestHandler.respond(org.apache.wicket.request.IRequestCycle)

setFileName

public final ResourceStreamRequestHandler setFileName(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 String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getContentDisposition

public final ContentDisposition getContentDisposition()

setContentDisposition

public final ResourceStreamRequestHandler setContentDisposition(ContentDisposition contentDisposition)


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