|
||||||||||
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(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,
Locale locale,
String filename)
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 | |
---|---|
IResourceStream |
getResourceStream()
Returns a new IResourceStream that provides all data for the request. |
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(String contentType, byte[] array)
contentType
- The Content type of the array.array
- The binary contentpublic ByteArrayResource(String contentType, byte[] array, 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(String contentType, byte[] array, Locale locale)
contentType
- The Content type of the array.array
- The binary content.locale
- The locale of this resourcepublic ByteArrayResource(String contentType, byte[] array, Locale locale, 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 WebResource
response
- The WebResponse where set(Date)Header can be called on.WebResource.setHeaders(org.apache.wicket.protocol.http.WebResponse)
public IResourceStream getResourceStream()
Resource
getResourceStream
in class Resource
Resource.getResourceStream()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |