Package org.silverpeas.core.io.file
Class AttachmentUrlLinkProcessor
- java.lang.Object
-
- org.silverpeas.core.io.file.AbstractSilverpeasFileProcessor
-
- org.silverpeas.core.io.file.AttachmentUrlLinkProcessor
-
- All Implemented Interfaces:
Comparable<SilverpeasFileProcessor>
,Initialization
,SilverpeasFileProcessor
@Service public class AttachmentUrlLinkProcessor extends AbstractSilverpeasFileProcessor
A processor to verify if the given path corresponds to an attachment URL link in order to transform it into the FileSystem attachment path.
This processor must have a high priority.- Author:
- Yohann Chastagnier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.io.file.SilverpeasFileProcessor
SilverpeasFileProcessor.ProcessingContext
-
-
Field Summary
-
Fields inherited from interface org.silverpeas.core.io.file.SilverpeasFileProcessor
MAX_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AttachmentUrlLinkProcessor()
-
Method Summary
All Methods Instance Methods Concrete 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 attachmentLink, 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, 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
-
-
-
-
Method Detail
-
processBefore
public String processBefore(String attachmentLink, 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:
attachmentLink
- 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.
-
getPriority
public int getPriority()
Description copied from interface:SilverpeasFileProcessor
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.- Specified by:
getPriority
in interfaceInitialization
- Specified by:
getPriority
in interfaceSilverpeasFileProcessor
- Overrides:
getPriority
in classAbstractSilverpeasFileProcessor
- Returns:
- the priority value.
-
-