|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.Resource
org.apache.wicket.markup.html.WebResource
org.apache.wicket.resource.ByteArrayResource
public class ByteArrayResource
This class can be used to easy make a Resource from a predefined byte array. If your data comes from a database then a DynamicWebResource is a better choice. Only use this class if you have to have the byte array in memory. Like a pdf that is generated on the fly.
| Field Summary |
|---|
| Fields inherited from interface org.apache.wicket.IResourceListener |
|---|
INTERFACE |
| Constructor Summary | |
|---|---|
ByteArrayResource(java.lang.String contentType,
byte[] array)
Creates a Resource from the given byte array with its content type |
|
ByteArrayResource(java.lang.String contentType,
byte[] array,
java.util.Locale locale)
Creates a Resource from the given byte array with its content type and the locale for which it is valid. |
|
ByteArrayResource(java.lang.String contentType,
byte[] array,
java.util.Locale locale,
java.lang.String filename)
Creates a Resource from the given byte array with its content type and the locale for which it is valid. |
|
ByteArrayResource(java.lang.String contentType,
byte[] array,
java.lang.String filename)
Creates a Resource from the given byte array with its content type |
|
| Method Summary | |
|---|---|
IResourceStream |
getResourceStream()
|
protected void |
setHeaders(WebResponse response)
Subclasses can override this to set there headers when the resource is being served. |
| Methods inherited from class org.apache.wicket.markup.html.WebResource |
|---|
configureResponse, getCacheDuration |
| Methods inherited from class org.apache.wicket.Resource |
|---|
getParameters, invalidate, isCacheable, onResourceRequested, setCacheable, setParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArrayResource(java.lang.String contentType,
byte[] array)
contentType - The Content type of the array.array - The binary content
public ByteArrayResource(java.lang.String contentType,
byte[] array,
java.lang.String filename)
contentType - The Content type of the array.array - The binary contentfilename - The filename that will be set as the Content-Disposition header.
public ByteArrayResource(java.lang.String contentType,
byte[] array,
java.util.Locale locale)
contentType - The Content type of the array.array - The binary content.locale - The locale of this resource
public ByteArrayResource(java.lang.String contentType,
byte[] array,
java.util.Locale locale,
java.lang.String filename)
contentType - The Content type of the array.array - The binary content.locale - The locale of this resourcefilename - The filename that will be set as the Content-Disposition header.| Method Detail |
|---|
protected void setHeaders(WebResponse response)
WebResource
response.setDateHeader("Expires", System.currentTimeMillis() + (3600 * 1000));
response.setHeader("Cache-Control", "max-age=" + 3600);
So if a resource wants to control this or doesn't want to set this info it should override
this method and don't call super.
setHeaders in class WebResourceresponse - The WebResponse where set(Date)Header can be called on.WebResource.setHeaders(org.apache.wicket.protocol.http.WebResponse)public IResourceStream getResourceStream()
getResourceStream in class ResourceResource.getResourceStream()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||