Class RefreshSynchroParser

java.lang.Object
be.gaudry.model.file.AbstractFileParser<Long>
be.gaudry.model.file.parser.RefreshSynchroParser
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class RefreshSynchroParser extends AbstractFileParser<Long>
TODO: allow files exclusions (ie. based on extensions or name like thumbs.db) \n Provided by the broldev.file.synchro.model project.
Since:
1.0 (Nov 29, 2011), broldev.file.synchro.model 0.0.1-SNAPSHOT dependency
Version:
1.0 (Nov 29, 2011)
Author:
Steph GAUDRY
  • Constructor Details

    • RefreshSynchroParser

      public RefreshSynchroParser(String id)
  • Method Details

    • getId

      public String getId()
      Returns:
      the id
    • isValidPath

      public boolean isValidPath()
    • performOnFile

      protected boolean performOnFile(AbstractBrolWorker<Long> bgw, File file, int progressPercent, int subDirDeep)
      Description copied from class: AbstractFileParser
      Do something on each file
      Specified by:
      performOnFile in class AbstractFileParser<Long>
      Parameters:
      bgw - AbstractBrolWorker to perform cancel if needed, and report progress
      file - file to check
      progressPercent - Progress percentage
      subDirDeep - Deep of the directory in comparison with start directory
      Returns:
      true if we must stop the parsing of current directory (ie. if we have a vob file, we don't check the other files in this directory) false otherwise
    • getRelativePath

      public static String getRelativePath(String absolutePath, String startPath)
      Relative path from the start path to the file
      Parameters:
      absolutePath -
      startPath -
      Returns:
    • getFile

      public File getFile(File file, RefreshSynchroParser parser)
      Computes and builds a new absolute path by replacing starting path of the given parser by starting path of this parser. \n i.e. calling this method with /a/b/c/d.ext, a given parser with /a/b/ as starting path, and this parser with /e/ as starting path will returns /e/c/d.ext.
      Parameters:
      file -
      parser -
      Returns: