Package be.gaudry.model.file.parser
Class RefreshSynchroParser
- All Implemented Interfaces:
PropertyChangeListener,EventListener
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
-
Field Summary
Fields inherited from class be.gaudry.model.file.AbstractFileParser
validPreviousProgress -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFile(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.getId()static StringgetRelativePath(String absolutePath, String startPath)Relative path from the start path to the filebooleanprotected booleanperformOnFile(AbstractBrolWorker<Long> bgw, File file, int progressPercent, int subDirDeep)Do something on each fileMethods inherited from class be.gaudry.model.file.AbstractFileParser
equals, finalize, getProgressMax, getStartPath, hashCode, init, isIncludeHiddenFiles, isIncludeSubFolders, isPauseProcessing, isPreCalcProgress, isPreCalculated, parse, parseFiles, performOnDirectory, propertyChange, setIncludeHiddenFiles, setIncludeSubFolders, setLanguage, setPreCalcProgress, setStartPath, togglePause
-
Constructor Details
-
RefreshSynchroParser
-
-
Method Details
-
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:AbstractFileParserDo something on each file- Specified by:
performOnFilein classAbstractFileParser<Long>- Parameters:
bgw-AbstractBrolWorkerto perform cancel if needed, and report progressfile- file to checkprogressPercent- Progress percentagesubDirDeep- 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
Relative path from the start path to the file- Parameters:
absolutePath-startPath-- Returns:
-
getFile
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:
-