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 class
ImageTransformServlet.ImageTransforming
-
Nested classes/interfaces inherited from class org.javlo.servlet.FileServlet
FileServlet.Range
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_ID_URL_DIR_PREFIX
static long
COUNT_304
static long
COUNT_ACCESS
static String
DEFAULT_IMAGE_TYPE
static String
HASH_PREFIX
static String
LARGE_IMAGE_SUFFIX
static String
LOCAL_TEMPLATE_SUFFIX
static Logger
logger
create a static logger.static String
MOBILE_IMAGE_SUFFIX
static String
NO_IMAGE_FILE
static String
PRELOAD_IMAGE_SUFFIX
static String
RESOURCE_TOKEN_KEY
static String
SMALL_IMAGE_SUFFIX
static String
VIEW_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 void
destroy()
protected void
doGet(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
Process GET request.protected void
doPost(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
long
getLastModified(ContentContext ctx, String name, String filter, String area, Device device, Template template, IImageFilter comp, ImageConfig.ImageParameters param)
void
init()
protected static BufferedImage
loadLayer(File file)
protected static BufferedImage
loadSourceImage(File file)
protected void
processRequest(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:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in 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, IOException
Description copied from class:FileServlet
Process GET request.- Overrides:
doGet
in classFileServlet
- Throws:
javax.servlet.ServletException
IOException
- 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:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
- 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 IOException
get the text and the picture and build a button- Overrides:
processRequest
in classFileServlet
- Throws:
Exception
IOException
-
-