Click or drag to resize

PackageInfoVerifyLengthAndHashOfPackageZipFile Method

Verifies the length and hash of the package's zip file. If length or hash differ, an exception is thrown.

Namespace: Altaxo.Serialization.AutoUpdates
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3618.0 (4.8.3618.0)
Syntax
C#
public FileStream? VerifyLengthAndHashOfPackageZipFile(
	FileInfo fileInfo,
	bool leavePackageFileStreamOpen = false
)

Parameters

fileInfo  FileInfo
The file information of the package file.
leavePackageFileStreamOpen  Boolean  (Optional)
If true, the file stream to the package file is left open. You are responsible then for disposing the returned file stream.

Return Value

FileStream
If the argument leavePackageFileStreamOpen was true, the opened (read-only) stream of the package file. You must not forget to dispose that stream. Otherwise, the return value is null.
Exceptions
ExceptionCondition
InvalidDataException The file {FileNameOfPackageZipFile} can't be found in directory {storagePath} or The downloaded file {fileInfo.FullName} has an unexpected length of {fileInfo.Length}. The expected value is {FileLength} or The downloaded file {fileInfo.FullName} has a different hash and is considered corrupted.
NotImplementedExceptionThe downloaded file {fileInfo.FullName} was hashed with algorithm {HashName}, which is not implemented here.
See Also