Package org.silverpeas.core.io.file
Class ImageResizingProcessor
- java.lang.Object
-
- org.silverpeas.core.io.file.AbstractSilverpeasFileProcessor
-
- org.silverpeas.core.io.file.ImageResizingProcessor
-
- All Implemented Interfaces:
Comparable<SilverpeasFileProcessor>
,Initialization
,SilverpeasFileProcessor
@Service public class ImageResizingProcessor extends AbstractSilverpeasFileProcessor
A processor dedicated to resize an image on the demand. If the image is already resized, then nothing the resized image is just returned.- Author:
- mmoquillon
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.io.file.SilverpeasFileProcessor
SilverpeasFileProcessor.ProcessingContext
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
IMAGE_CACHE_PATH
-
Fields inherited from interface org.silverpeas.core.io.file.SilverpeasFileProcessor
MAX_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ImageResizingProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SilverpeasFile
processAfter(SilverpeasFile file, SilverpeasFileProcessor.ProcessingContext context)
Processes the specified SilverpeasFile and returns the new one.String
processBefore(String path, SilverpeasFileProcessor.ProcessingContext context)
Processes the specified path and returns the new path of the SilverpeasFile to get.-
Methods inherited from class org.silverpeas.core.io.file.AbstractSilverpeasFileProcessor
compareTo, getPriority, init
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.initialization.Initialization
release
-
-
-
-
Field Detail
-
IMAGE_CACHE_PATH
protected static final String IMAGE_CACHE_PATH
-
-
Method Detail
-
processBefore
public String processBefore(String path, SilverpeasFileProcessor.ProcessingContext context)
Description copied from interface:SilverpeasFileProcessor
Processes the specified path and returns the new path of the SilverpeasFile to get. This method is triggered before retrieving the SilverpeasFile matching a given file path. If nothing should be done with the path, then just returns the path passed as argument.- Parameters:
path
- the path of the asked file.context
- the processing context.- Returns:
- either the specified path or a new path of the asked file.
-
processAfter
public SilverpeasFile processAfter(SilverpeasFile file, SilverpeasFileProcessor.ProcessingContext context)
Description copied from interface:SilverpeasFileProcessor
Processes the specified SilverpeasFile and returns the new one. This method is triggered after retrieving the SilverpeasFile. If nothing should be done with the path, then just returns the SilverpeasFile instance passed as argument.- Parameters:
file
- the SilverpeasFile to process.context
- the processing context.- Returns:
- either the specified one or a new one.
-
-