|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.gentics.cr.portlet.imagestore.GenticsImageStoreServlet
public class GenticsImageStoreServlet
Servlet for resizing images for Content.Node
![]() |
![]() |
![]() |
Field Summary | |
---|---|
static int |
BUFFER_SIZE
buffer size for writing the image to the response |
protected com.gentics.lib.log.NodeLogger |
logger
logger |
private String |
portalBasePath
Portal basepath |
private String |
portalBasePathRegEx
Regex that will be used to determine the portal basepath |
private com.gentics.api.imagestore.RequestDecorator |
requestDecoratorClass
Will be instantiated with a class given by an optional servlet parameter which enables the user to modify header information and data in requests to the GenticsImageStore May be null. |
private String |
secret
Configured secret for resize validation |
private static long |
serialVersionUID
serial version uid |
private com.gentics.api.imagestore.ImageUriMapper |
uriMapper
Will be instantiated with a class given by an optional servlet parameter which enables the user to customize exactly how requests to images are mapped to the actual location where the image will be fetched from. |
private URI |
urlPrefix
The GenticsImageStore by default fetches the subject image from the host of the request (usually identical to the host the GenticsImageStore runs on). |
Constructor Summary | |
---|---|
GenticsImageStoreServlet()
|
Method Summary | |
---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected void |
doResizing(String mode,
String width,
String height,
boolean cropandresize,
String topleftx,
String toplefty,
String cropwidth,
String cropheight,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String imagePath)
Do the resizing of an image and return the image |
void |
init()
|
private URI |
toImageUri(javax.servlet.http.HttpServletRequest request,
String imagePath)
Gets the absolute URI for a relative image path. |
protected void |
writeImageToResponse(com.gentics.api.lib.upload.FileInformation image,
javax.servlet.http.HttpServletResponse response)
Write the image into the servlet response |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public static final int BUFFER_SIZE
private String portalBasePath
private String portalBasePathRegEx
protected com.gentics.lib.log.NodeLogger logger
private volatile URI urlPrefix
private volatile com.gentics.api.imagestore.ImageUriMapper uriMapper
private volatile com.gentics.api.imagestore.RequestDecorator requestDecoratorClass
private volatile String secret
Constructor Detail |
---|
public GenticsImageStoreServlet()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
private URI toImageUri(javax.servlet.http.HttpServletRequest request, String imagePath) throws javax.servlet.ServletException
request
- The request to this servlet which fetches the image from the path specified with imagePath.imagePath
- The relative path to an image.
javax.servlet.ServletException
- If the given imagePath can not be made absolute because it is of an incorrect format.protected void doResizing(String mode, String width, String height, boolean cropandresize, String topleftx, String toplefty, String cropwidth, String cropheight, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String imagePath) throws javax.servlet.ServletException, IOException
mode
- resizing modewidth
- new widthheight
- new heightrequest
- servlet requestresponse
- servlet response
javax.servlet.ServletException
IOException
protected void writeImageToResponse(com.gentics.api.lib.upload.FileInformation image, javax.servlet.http.HttpServletResponse response) throws IOException
image
- image dataresponse
- servlet response
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |