org.apache.wicket.request.resource
Class ByteArrayResource

java.lang.Object
  extended by org.apache.wicket.request.resource.AbstractResource
      extended by org.apache.wicket.request.resource.ByteArrayResource
All Implemented Interfaces:
Serializable, IResource

public class ByteArrayResource
extends AbstractResource

Author:
Matej Knopp
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource
AbstractResource.ResourceResponse, AbstractResource.WriteCallback
 
Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource
IResource.Attributes
 
Constructor Summary
ByteArrayResource(String contentType, byte[] array)
          Creates a Resource from the given byte array with its content type
ByteArrayResource(String contentType, byte[] array, Locale locale)
          Creates a Resource from the given byte array with its content type and the locale for which it is valid.
ByteArrayResource(String contentType, byte[] array, String filename)
          Creates a Resource from the given byte array with its content type
 
Method Summary
protected  void configureResponse(AbstractResource.ResourceResponse response, IResource.Attributes attributes)
           
protected  AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
          Override this method to return a AbstractResource.ResourceResponse for the request.
 
Methods inherited from class org.apache.wicket.request.resource.AbstractResource
configureCache, respond
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 content
filename - The filename that will be set as the Content-Disposition header.

ByteArrayResource

public ByteArrayResource(String contentType,
                         byte[] array,
                         Locale locale)
Creates a Resource from the given byte array with its content type and the locale for which it is valid.

Parameters:
contentType - The Content type of the array.
array - The binary content.
locale - The locale of this resource
Method Detail

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)


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