Package be.gaudry.model.photo.parser
Class TransfertPhotosParser
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
- Direct Known Subclasses:
IMRTPPImplementation
set the origine and destination,
for each file, extract meta,
if dest dir with date (YYYY_MM_DD camera_model) does not exists, create it,
copy file,
check if dest file exists with same date (add counter after filename if exists)
paste file into dest subdir with new name
Provided by the broldev.all.ribbon.launcher project.
- Since:
- 1.0 (May 05, 2018), broldev.all.ribbon.launcher 0.0.1-SNAPSHOT dependency
- Version:
- 1.0 (May 05, 2018)
- Author:
- Steph GAUDRY
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected File
protected DateHelper<Long>
protected DateHelper<Long>
protected String
protected String
protected boolean
protected boolean
Fields inherited from class be.gaudry.model.file.AbstractFileParser
validPreviousProgress
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
init()
Override this to do some initializations before starting the parsing, like reset errors, etc.protected boolean
performOnFile(AbstractBrolWorker<Long> bgw, File file, int progressPercent, int subDirDeep)
Do something on each filevoid
setCreateSubDirs(boolean createSubDirs)
void
setDestinationRoot(File destinationRoot)
void
setDirectoryDateFormat(IPhotoFormat photoDateFormat)
void
setDirectoryDateType(PhotoDateType dateType)
void
setFileDateFormat(IPhotoFormat photoDateFormat)
void
setFileDateType(PhotoDateType dateType)
void
setPhotoExtensions(Set<String> photoExtensions)
void
void
void
setTransferOnlyNewFiles(boolean transferOnlyNewFiles)
void
setUseCameraModel(boolean useCameraModel)
Methods inherited from class be.gaudry.model.file.AbstractFileParser
equals, finalize, getProgressMax, getStartPath, hashCode, isIncludeHiddenFiles, isIncludeSubFolders, isPauseProcessing, isPreCalcProgress, isPreCalculated, parse, parseFiles, performOnDirectory, propertyChange, setIncludeHiddenFiles, setIncludeSubFolders, setLanguage, setPreCalcProgress, setStartPath, togglePause
-
Field Details
-
destinationRoot
-
photoExtensions
-
transferOnlyNewFiles
protected boolean transferOnlyNewFiles -
useCameraModel
protected boolean useCameraModel -
createSubDirs
protected boolean createSubDirs -
prefix
-
suffix
-
directoryDateHelper
-
fileDateHelper
-
-
Constructor Details
-
TransfertPhotosParser
public TransfertPhotosParser()
-
-
Method Details
-
setDestinationRoot
-
setDirectoryDateFormat
- Parameters:
photoDateFormat
- the photoDateFormat to set
-
setFileDateFormat
- Parameters:
photoDateFormat
- the photoDateFormat to set
-
setPrefix
- Parameters:
prefix
- the prefix to set
-
setSuffix
- Parameters:
suffix
- the suffix to set
-
setDirectoryDateType
- Parameters:
dateType
- the dateType to set
-
setFileDateType
- Parameters:
dateType
- the dateType to set
-
setUseCameraModel
public void setUseCameraModel(boolean useCameraModel)- Parameters:
useCameraModel
- the useCameraModel to set
-
setCreateSubDirs
public void setCreateSubDirs(boolean createSubDirs)- Parameters:
createSubDirs
- the useSubDirs to set
-
setTransferOnlyNewFiles
public void setTransferOnlyNewFiles(boolean transferOnlyNewFiles)- Parameters:
transferOnlyNewFiles
- the transferOnlyNewFiles to set
-
setPhotoExtensions
- Parameters:
photoExtensions
- the photoExtensions to set
-
getErrors
- Returns:
- the errors
-
getTransfered
-
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 classAbstractFileParser<Long>
- Parameters:
bgw
-AbstractBrolWorker
to 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
-
init
protected void init()Description copied from class:AbstractFileParser
Override this to do some initializations before starting the parsing, like reset errors, etc.- Overrides:
init
in classAbstractFileParser<Long>
-
addError
-