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

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

public class ResourceStreamRequestHandler
extends Object
implements IRequestHandler, ILoggableRequestHandler

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)
           
 Duration getCacheDuration()
           
 ContentDisposition getContentDisposition()
           
 String getFileName()
           
 ResourceStreamLogData getLogData()
          
 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 setCacheDuration(Duration cacheDuration)
           
 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

getLogData

public ResourceStreamLogData getLogData()

Specified by:
getLogData in interface ILoggableRequestHandler

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

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)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

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()
Returns:
ContentDisposition

setContentDisposition

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

getCacheDuration

public Duration getCacheDuration()
Returns:
the duration for which the resource will be cached by the browser

setCacheDuration

public ResourceStreamRequestHandler setCacheDuration(Duration cacheDuration)
Parameters:
cacheDuration - the duration for which the resource will be cached by the browser
Returns:
this component


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