Class Crawler

java.lang.Object
com.logicaldoc.importfolder.Crawler
All Implemented Interfaces:
Callable<CrawlStats>

public class Crawler extends Object implements Callable<CrawlStats>
A task that processes a list of ImportFolders
Since:
9.2
Author:
Marco Meschieri - LogicalDOC
  • Field Details

  • Constructor Details

  • Method Details

    • call

      public CrawlStats call() throws Exception
      Specified by:
      call in interface Callable<CrawlStats>
      Throws:
      Exception
    • isInterrupt

      public boolean isInterrupt()
    • getLog

      public org.slf4j.Logger getLog()
    • getStats

      public CrawlStats getStats()
    • interrupt

      public void interrupt()
    • afterCrawlingCompleted

      public void afterCrawlingCompleted(ImportFolder importFolder)
      To be invoked after the crawling has completed
      Parameters:
      importFolder - the used import folder
    • beforeDocumentImported

      public static void beforeDocumentImported(ImportFolder importFolder, com.logicaldoc.core.document.DocumentHistory transaction)
      To be invoked before a file gets imported
      Parameters:
      importFolder - the used import folder
      transaction - the target created / updated document event (the original path is expected to be the pathOld)
    • afterDocumentImported

      public void afterDocumentImported(ImportFolder importFolder, com.logicaldoc.core.document.DocumentHistory transaction)
      To be invoked after a file has been imported
      Parameters:
      importFolder - the used import folder
      transaction - the target created / updated document event (the original path is expected to be the pathOld)
    • onError

      public void onError(ImportFolder importFolder, com.logicaldoc.core.document.Document document, String originalPath, Throwable error)
      To be invoked after an error has been detected
      Parameters:
      importFolder - the used import folder
      document - the target document
      originalPath - the original path of the file
      error - the exception generated by the error