Class QuickVerifier

java.lang.Object
nl.knaw.dans.bagit.verify.QuickVerifier

public final class QuickVerifier extends Object
responsible for all things related to quick verification. Quick verification does not mean that a Bag is valid, only that a cursory check has been made. For a full verification see BagVerifier
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • messages

      private static final ResourceBundle messages
    • PAYLOAD_OXUM_REGEX

      private static final String PAYLOAD_OXUM_REGEX
      See Also:
  • Constructor Details

    • QuickVerifier

      private QuickVerifier()
  • Method Details

    • canQuickVerify

      public static boolean canQuickVerify(Bag bag)
      Determine if we can quickly verify by comparing the number of files and the total number of bytes expected
      Parameters:
      bag - the Bag object you wish to check
      Returns:
      true if the bag can be quickly verified
    • getPayloadOxum

      private static String getPayloadOxum(Bag bag)
    • quicklyVerify

      public static void quicklyVerify(Bag bag) throws IOException, InvalidPayloadOxumException
      Quickly verify by comparing the number of files and the total number of bytes expected
      Parameters:
      bag - the bag to verify by payload-oxum
      Throws:
      IOException - if there is an error reading a file
      InvalidPayloadOxumException - if either the total bytes or the number of files calculated for the payload directory of the bag is different than the supplied values
      PayloadOxumDoesNotExistException - if the bag does not contain a payload-oxum. To check, run BagVerifier.canQuickVerify(nl.knaw.dans.bagit.domain.Bag)