public class ResourceStreamRequestHandler extends Object implements IRequestHandler, ILoggableRequestHandler
Constructor and Description |
---|
ResourceStreamRequestHandler(IResourceStream resourceStream)
Construct.
|
ResourceStreamRequestHandler(IResourceStream resourceStream,
String fileName)
Construct.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configure(ResourceStreamResource resource)
Configures the ResourceStreamResource used by this request handler
|
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(Object obj) |
Duration |
getCacheDuration() |
ContentDisposition |
getContentDisposition() |
String |
getFileName() |
ResourceStreamLogData |
getLogData()
Returns the collected log data for this request handler and should never throw an exception.
|
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() |
public ResourceStreamRequestHandler(IResourceStream resourceStream)
resourceStream
- the resource stream for the responsepublic ResourceStreamRequestHandler(IResourceStream resourceStream, String fileName)
resourceStream
- the resource stream for the responsefileName
- public void detach(IRequestCycle requestCycle)
IRequestHandler
detach
in interface IRequestHandler
requestCycle
- the current request cyclepublic ResourceStreamLogData getLogData()
getLogData
in interface ILoggableRequestHandler
public final String getFileName()
public final IResourceStream getResourceStream()
public void respond(IRequestCycle requestCycle)
respond
in interface IRequestHandler
requestCycle
- the current request cycleIRequestHandler.respond(org.apache.wicket.request.IRequestCycle)
protected void configure(ResourceStreamResource resource)
resource
- the resource to configurepublic final ResourceStreamRequestHandler setFileName(String fileName)
fileName
- Optional filename, used to set the content disposition header. Only meaningful
when using with web requests.public String toString()
toString
in class Object
Object.toString()
public final ContentDisposition getContentDisposition()
public final ResourceStreamRequestHandler setContentDisposition(ContentDisposition contentDisposition)
contentDisposition
- public Duration getCacheDuration()
public ResourceStreamRequestHandler setCacheDuration(Duration cacheDuration)
cacheDuration
- the duration for which the resource will be cached by the browserCopyright © 2006–2022 Apache Software Foundation. All rights reserved.