org.apache.wicket.request.resource
Class ByteArrayResource
java.lang.Object
org.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.ByteArrayResource
- All Implemented Interfaces:
- Serializable, IResource, IClusterable
public class ByteArrayResource
- extends AbstractResource
An IResource
for byte arrays. The byte array can be static - passed to the constructor,
or dynamic - by overriding
getData(org.apache.wicket.request.resource.IResource.Attributes)
- Author:
- Matej Knopp
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteArrayResource
public ByteArrayResource(String contentType)
- Creates a
ByteArrayResource
which will provide its data dynamically with
getData(org.apache.wicket.request.resource.IResource.Attributes)
- Parameters:
contentType
- The Content type of the array.
ByteArrayResource
public ByteArrayResource(String contentType,
byte[] array)
- Creates a Resource from the given byte array with its content type
- Parameters:
contentType
- The Content type of the array.array
- The binary content
ByteArrayResource
public ByteArrayResource(String contentType,
byte[] array,
String filename)
- Creates a Resource from the given byte array with its content type
- Parameters:
contentType
- The Content type of the array.array
- The binary contentfilename
- The filename that will be set as the Content-Disposition header.
configureResponse
protected void configureResponse(AbstractResource.ResourceResponse response,
IResource.Attributes attributes)
newResourceResponse
protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
- Description copied from class:
AbstractResource
- Override this method to return a
AbstractResource.ResourceResponse
for the request.
- Specified by:
newResourceResponse
in class AbstractResource
- Parameters:
attributes
- request attributes
- Returns:
- resource data instance
- See Also:
AbstractResource.newResourceResponse(org.apache.wicket.request.resource.IResource.Attributes)
getData
protected byte[] getData(IResource.Attributes attributes)
- Gets the data for this resource.
- Parameters:
attributes
- the context bringing the request, response and the parameters
- Returns:
- The byte array data for this resource
Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.