Table of Contents

Class FileInfoExtensions

Namespace
Cuemon.Extensions.Data.Integrity
Assembly
Cuemon.Extensions.Data.Integrity.dll

Extension methods for the FileInfo class.

public static class FileInfoExtensions
Inheritance
FileInfoExtensions

Methods

GetCacheValidator(FileInfo, Func<Hash>, Action<FileChecksumOptions>)

Returns a CacheValidator from the specified file.

public static CacheValidator GetCacheValidator(this FileInfo file, Func<Hash> hashFactory = null, Action<FileChecksumOptions> setup = null)

Parameters

file FileInfo

The FileInfo to extend.

hashFactory Func<Hash>

The function delegate that is invoked to produce the HashResult. Default is CreateFnv128(Action<FowlerNollVoOptions>).

setup Action<FileChecksumOptions>

The FileChecksumOptions which may be configured.

Returns

CacheValidator

A CacheValidator that represents either a weak, medium or strong integrity check of the specified file.

Remarks

Should the specified file trigger any sort of exception, a Default is returned.

Exceptions

ArgumentNullException

file is null.