Class TransfertPhotosParser

java.lang.Object
be.gaudry.model.file.AbstractFileParser<Long>
be.gaudry.model.photo.parser.TransfertPhotosParser
All Implemented Interfaces:
PropertyChangeListener, EventListener
Direct Known Subclasses:
IMRTPPImplementation

public class TransfertPhotosParser extends AbstractFileParser<Long>
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 Details

    • destinationRoot

      protected File destinationRoot
    • photoExtensions

      protected Set<String> photoExtensions
    • transferOnlyNewFiles

      protected boolean transferOnlyNewFiles
    • useCameraModel

      protected boolean useCameraModel
    • createSubDirs

      protected boolean createSubDirs
    • prefix

      protected String prefix
    • suffix

      protected String suffix
    • directoryDateHelper

      protected DateHelper<Long> directoryDateHelper
    • fileDateHelper

      protected DateHelper<Long> fileDateHelper
  • Constructor Details

    • TransfertPhotosParser

      public TransfertPhotosParser()
  • Method Details

    • setDestinationRoot

      public void setDestinationRoot(File destinationRoot)
    • setDirectoryDateFormat

      public void setDirectoryDateFormat(IPhotoFormat photoDateFormat)
      Parameters:
      photoDateFormat - the photoDateFormat to set
    • setFileDateFormat

      public void setFileDateFormat(IPhotoFormat photoDateFormat)
      Parameters:
      photoDateFormat - the photoDateFormat to set
    • setPrefix

      public void setPrefix(String prefix)
      Parameters:
      prefix - the prefix to set
    • setSuffix

      public void setSuffix(String suffix)
      Parameters:
      suffix - the suffix to set
    • setDirectoryDateType

      public void setDirectoryDateType(PhotoDateType dateType)
      Parameters:
      dateType - the dateType to set
    • setFileDateType

      public void setFileDateType(PhotoDateType dateType)
      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

      public void setPhotoExtensions(Set<String> photoExtensions)
      Parameters:
      photoExtensions - the photoExtensions to set
    • getErrors

      public Map<File,​Exception> getErrors()
      Returns:
      the errors
    • getTransfered

      public Collection<String> 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 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
    • 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 class AbstractFileParser<Long>
    • addError

      protected void addError(Exception e, File file)