|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
org.apache.sling.api.servlets.SlingSafeMethodsServlet
com.day.cq.wcm.commons.AbstractImageServlet
public abstract class AbstractImageServlet
Servers as base for image servlets
| Nested Class Summary | |
|---|---|
static class |
AbstractImageServlet.ImageContext
Convenience class that holds usefull stuff needed for image generation |
| Constructor Summary | |
|---|---|
AbstractImageServlet()
|
|
| Method Summary | |
|---|---|
protected boolean |
checkModifiedSince(org.apache.sling.api.SlingHttpServletRequest req,
org.apache.sling.api.SlingHttpServletResponse resp)
Checks if the request contains a if-last-modified-since header and if the node has a jcr:lastModified property. |
protected abstract com.day.image.Layer |
createLayer(AbstractImageServlet.ImageContext c)
Creates the image layer. |
protected void |
doGet(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
Handles a GET request and created the desired image. |
protected double |
getImageQuality()
Returns the image quality. |
protected String |
getImageType()
Returns the image type. |
protected String |
getImageType(String ext)
Returns the image type for the given extension. |
protected void |
writeLayer(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
AbstractImageServlet.ImageContext context,
com.day.image.Layer layer)
Writes the layer to the response. |
| Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet |
|---|
doGeneric, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractImageServlet()
| Method Detail |
|---|
protected void doGet(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
checkModifiedSince(SlingHttpServletRequest, SlingHttpServletResponse)
createLayer(ImageContext)
writeLayer(SlingHttpServletRequest, SlingHttpServletResponse, ImageContext, Layer)
getImageType(String), a 404 is responded.
doGet in class org.apache.sling.api.servlets.SlingSafeMethodsServletjavax.servlet.ServletException
IOException
protected void writeLayer(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
AbstractImageServlet.ImageContext context,
com.day.image.Layer layer)
throws IOException,
RepositoryException
request - servlet requestresponse - servlet responsecontext - the contextlayer - layer
IOException - if an I/O error occurs.
RepositoryException - if an repositor error occurs.protected String getImageType()
protected String getImageType(String ext)
ext - the extension
null.protected double getImageQuality()
protected boolean checkModifiedSince(org.apache.sling.api.SlingHttpServletRequest req,
org.apache.sling.api.SlingHttpServletResponse resp)
req - the requestresp - the response
true if the response was sent
protected abstract com.day.image.Layer createLayer(AbstractImageServlet.ImageContext c)
throws RepositoryException,
IOException
c - the convenience context
RepositoryException - if an error occurs.
IOException - if an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||