org.silverpeas.file
Class FileExistenceCheckingProcessor

java.lang.Object
  extended by org.silverpeas.file.AbstractSilverpeasFileProcessor
      extended by org.silverpeas.file.FileExistenceCheckingProcessor
All Implemented Interfaces:
Comparable<SilverpeasFileProcessor>, SilverpeasFileProcessor

@Named(value="fileExistenceCheckingProcessor")
public class FileExistenceCheckingProcessor
extends AbstractSilverpeasFileProcessor

A processor to check the existence of a SilverpeasFile. It the file doesn't exist, then is returned.

Author:
mmoquillon

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.silverpeas.file.SilverpeasFileProcessor
SilverpeasFileProcessor.ProcessingContext
 
Constructor Summary
FileExistenceCheckingProcessor()
           
 
Method Summary
 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.file.AbstractSilverpeasFileProcessor
compareTo, getPriority, registerItself
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileExistenceCheckingProcessor

public FileExistenceCheckingProcessor()
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.


Copyright © 2016 Silverpeas. All Rights Reserved.