Package org.silverpeas.core.io.file
Interface SilverpeasFileProcessor
-
- All Superinterfaces:
Comparable<SilverpeasFileProcessor>
- All Known Implementing Classes:
AbstractSilverpeasFileProcessor
,AttachmentUrlLinkProcessor
,FileExistenceCheckingProcessor
,ImageResizingProcessor
,RelativePathCheckingProcessor
public interface SilverpeasFileProcessor extends Comparable<SilverpeasFileProcessor>
A processor of aSilverpeasFile
instance. It performs some peculiar tasks according to a file path in order to apply some additional business or technical rules on the asked file.- Author:
- mmoquillon
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SilverpeasFileProcessor.ProcessingContext
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_PRIORITY
The value of the maximum priority
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getPriority()
Gets the priority that permits to sort the processor list to execute.
The more the value of the priority is high, the more the processor is executed first.
The chained execution of processors that have the same priority could be known.
By default, the priority is set to 50.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 interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
MAX_PRIORITY
static final int MAX_PRIORITY
The value of the maximum priority- See Also:
- Constant Field Values
-
-
Method Detail
-
getPriority
int getPriority()
Gets the priority that permits to sort the processor list to execute.
The more the value of the priority is high, the more the processor is executed first.
The chained execution of processors that have the same priority could be known.
By default, the priority is set to 50.- Returns:
- the priority value.
-
processBefore
String processBefore(String path, SilverpeasFileProcessor.ProcessingContext context)
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
SilverpeasFile processAfter(SilverpeasFile file, SilverpeasFileProcessor.ProcessingContext context)
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.
-
-