public override ExitCode Execute() { try { switch (AdditionalArgs.Count) { case 1: // Verify a directory inside the store ImplementationStore.Verify(new ManifestDigest(AdditionalArgs[0]), Handler); break; case 2: // Verify an arbitrary directory ImplementationStoreUtils.Verify(AdditionalArgs[0], new ManifestDigest(AdditionalArgs[1]), Handler); break; } } catch (DigestMismatchException ex) { Handler.Output(Resources.VerifyImplementation, ex.LongMessage); return(ExitCode.DigestMismatch); } return(ExitCode.OK); }
/// <summary> /// Verify this implementation is undamaged. /// </summary> /// <param name="handler">A callback object used when the the user needs to be asked questions or informed about IO tasks.</param> /// <exception cref="OperationCanceledException">The user canceled the task.</exception> /// <exception cref="IOException">The entry's directory could not be processed.</exception> /// <exception cref="UnauthorizedAccessException">Read access to the entry's directory is not permitted.</exception> public void Verify(ITaskHandler handler) => ImplementationStore.Verify(_digest, handler);