Package org.javlo.servlet
Class ImageTransformServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.javlo.servlet.FileServlet
-
- org.javlo.servlet.ImageTransformServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class ImageTransformServlet extends FileServlet
transform a image. url : /transform/[filter]/[template]/[area]/[local*]|[]/uri_to_image. *local = access to a file in the webapp, if not local the file come from data folder.- Author:
- pvandermaesen.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImageTransformServlet.ImageTransforming-
Nested classes/interfaces inherited from class org.javlo.servlet.FileServlet
FileServlet.Range
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENT_ID_URL_DIR_PREFIXstatic longCOUNT_304static longCOUNT_ACCESSstatic StringDEFAULT_IMAGE_TYPEstatic StringHASH_PREFIXstatic StringLARGE_IMAGE_SUFFIXstatic StringLOCAL_TEMPLATE_SUFFIXstatic Loggerloggercreate a static logger.static StringMOBILE_IMAGE_SUFFIXstatic StringNO_IMAGE_FILEstatic StringPRELOAD_IMAGE_SUFFIXstatic StringRESOURCE_TOKEN_KEYstatic StringSMALL_IMAGE_SUFFIXstatic StringVIEW_PICTURE_ACTION-
Fields inherited from class org.javlo.servlet.FileServlet
DEFAULT_EXPIRE_TIME
-
-
Constructor Summary
Constructors Constructor Description ImageTransformServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()protected voiddoGet(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)Process GET request.protected voiddoPost(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)longgetLastModified(ContentContext ctx, String name, String filter, String area, Device device, Template template, IImageFilter comp, ImageConfig.ImageParameters param)voidinit()protected static BufferedImageloadLayer(File file)protected static BufferedImageloadSourceImage(File file)protected voidprocessRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean content)get the text and the picture and build a button-
Methods inherited from class org.javlo.servlet.FileServlet
doHead, matches, processRequest
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
RESOURCE_TOKEN_KEY
public static final String RESOURCE_TOKEN_KEY
- See Also:
- Constant Field Values
-
PRELOAD_IMAGE_SUFFIX
public static final String PRELOAD_IMAGE_SUFFIX
- See Also:
- Constant Field Values
-
LARGE_IMAGE_SUFFIX
public static final String LARGE_IMAGE_SUFFIX
- See Also:
- Constant Field Values
-
SMALL_IMAGE_SUFFIX
public static final String SMALL_IMAGE_SUFFIX
- See Also:
- Constant Field Values
-
MOBILE_IMAGE_SUFFIX
public static final String MOBILE_IMAGE_SUFFIX
- See Also:
- Constant Field Values
-
COUNT_ACCESS
public static long COUNT_ACCESS
-
COUNT_304
public static long COUNT_304
-
COMPONENT_ID_URL_DIR_PREFIX
public static final String COMPONENT_ID_URL_DIR_PREFIX
- See Also:
- Constant Field Values
-
HASH_PREFIX
public static final String HASH_PREFIX
- See Also:
- Constant Field Values
-
logger
public static Logger logger
create a static logger.
-
VIEW_PICTURE_ACTION
public static final String VIEW_PICTURE_ACTION
- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_TYPE
public static final String DEFAULT_IMAGE_TYPE
- See Also:
- Constant Field Values
-
LOCAL_TEMPLATE_SUFFIX
public static final String LOCAL_TEMPLATE_SUFFIX
- See Also:
- Constant Field Values
-
NO_IMAGE_FILE
public static final String NO_IMAGE_FILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
loadLayer
protected static BufferedImage loadLayer(File file) throws IOException
- Throws:
IOException
-
loadSourceImage
protected static BufferedImage loadSourceImage(File file) throws IOException
- Throws:
IOException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws javax.servlet.ServletException, IOExceptionDescription copied from class:FileServletProcess GET request.- Overrides:
doGetin classFileServlet- Throws:
javax.servlet.ServletExceptionIOException- See Also:
HttpServlet.doGet(HttpServletRequest, HttpServletResponse)
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws javax.servlet.ServletException, IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException- See Also:
HttpServlet.doPost(HttpServletRequest, HttpServletResponse)
-
getLastModified
public long getLastModified(ContentContext ctx, String name, String filter, String area, Device device, Template template, IImageFilter comp, ImageConfig.ImageParameters param) throws FileNotFoundException
- Throws:
FileNotFoundException
-
processRequest
protected void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean content) throws IOExceptionget the text and the picture and build a button- Overrides:
processRequestin classFileServlet- Throws:
ExceptionIOException
-
-