Class CheckIfFileExistsTask

java.lang.Object
nl.knaw.dans.bagit.verify.CheckIfFileExistsTask
All Implemented Interfaces:
Runnable

public class CheckIfFileExistsTask extends Object implements Runnable
A simple task to check if a file exists on the filesystem. This is thread safe, so many can be called at once.
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • messages

      private static final ResourceBundle messages
    • file

      private final transient Path file
    • missingFiles

      private final transient Set<Path> missingFiles
    • latch

      private final transient CountDownLatch latch
  • Constructor Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • existsNormalized

      private boolean existsNormalized()
      if a file is parially normalized or of a different normalization then the manifest specifies it will fail the existence test. This method checks for that by normalizing what is on disk with the normalized filename and see if they match.
      Returns:
      true if the normalized filename matches one on disk in the specified folder