According to BagIt spec 16 a bag is complete when:
- Every required element is present (
bagit.txt, data/, manifest-<alg>.txt)
- Every file listed in every tag manifest is present
- Every file listed in every payload manifest is present
- (BagIt >= 1.0) every payload file is listed in every payload manifest
- Every fetch file is present in the payload
A bag is valid when:
- The bag is complete
- Every checksum in every payload manifest and tag manifest has been successfully verified against the contents of the corresponding file.
Implement methods bag.isComplete and bag.isValid according to the statements above.