public class GenticsImageStoreServlet
extends javax.servlet.http.HttpServlet
![]() |
![]() |
![]() |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
GenticsImageStoreServlet() |
Modifier and Type | Method and Description |
---|---|
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
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
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
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 responsejavax.servlet.ServletException
IOException
protected void writeImageToResponse(com.gentics.api.lib.upload.FileInformation image, javax.servlet.http.HttpServletResponse response) throws IOException
image
- image dataresponse
- servlet responseIOException
Copyright © 2014 Gentics Software GmbH. All Rights Reserved.